1#![warn(clippy::all)]
3#![allow(unused_parens, unused_variables, unused_mut, unused_imports, unreachable_code)]
4
5#[derive(PartialEq, Debug)]
6pub enum Task {
7 Job(::fidl_next::fuchsia::zx::Job),
8
9 Process(::fidl_next::fuchsia::zx::Process),
10
11 Thread(::fidl_next::fuchsia::zx::Thread),
12
13 UnknownOrdinal_(u64),
14}
15
16impl ::fidl_next::Encodable for Task {
17 type Encoded = WireTask<'static>;
18}
19
20unsafe impl<___E> ::fidl_next::Encode<___E> for Task
21where
22 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
23 ___E: ::fidl_next::Encoder,
24 ___E: ::fidl_next::fuchsia::HandleEncoder,
25{
26 #[inline]
27 fn encode(
28 self,
29 encoder: &mut ___E,
30 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
31 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
32 ::fidl_next::munge!(let WireTask { raw, _phantom: _ } = out);
33
34 match self {
35 Self::Job(value) => ::fidl_next::RawWireUnion::encode_as::<
36 ___E,
37 ::fidl_next::fuchsia::zx::Job,
38 >(value, 1, encoder, raw)?,
39
40 Self::Process(value) => ::fidl_next::RawWireUnion::encode_as::<
41 ___E,
42 ::fidl_next::fuchsia::zx::Process,
43 >(value, 2, encoder, raw)?,
44
45 Self::Thread(value) => ::fidl_next::RawWireUnion::encode_as::<
46 ___E,
47 ::fidl_next::fuchsia::zx::Thread,
48 >(value, 3, encoder, raw)?,
49
50 Self::UnknownOrdinal_(ordinal) => {
51 return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize));
52 }
53 }
54
55 Ok(())
56 }
57}
58
59impl ::fidl_next::EncodableOption for Task {
60 type EncodedOption = WireOptionalTask<'static>;
61}
62
63unsafe impl<___E> ::fidl_next::EncodeOption<___E> for Task
64where
65 ___E: ?Sized,
66 Task: ::fidl_next::Encode<___E>,
67{
68 #[inline]
69 fn encode_option(
70 this: ::core::option::Option<Self>,
71 encoder: &mut ___E,
72 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
73 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
74 ::fidl_next::munge!(let WireOptionalTask { raw, _phantom: _ } = &mut *out);
75
76 if let Some(inner) = this {
77 let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
78 ::fidl_next::Encode::encode(inner, encoder, value_out)?;
79 } else {
80 ::fidl_next::RawWireUnion::encode_absent(raw);
81 }
82
83 Ok(())
84 }
85}
86
87impl<'de> ::fidl_next::FromWire<WireTask<'de>> for Task {
88 #[inline]
89 fn from_wire(wire: WireTask<'de>) -> Self {
90 let wire = ::core::mem::ManuallyDrop::new(wire);
91 match wire.raw.ordinal() {
92 1 => Self::Job(::fidl_next::FromWire::from_wire(unsafe {
93 wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireJob>()
94 })),
95
96 2 => Self::Process(::fidl_next::FromWire::from_wire(unsafe {
97 wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireProcess>()
98 })),
99
100 3 => Self::Thread(::fidl_next::FromWire::from_wire(unsafe {
101 wire.raw.get().read_unchecked::<::fidl_next::fuchsia::WireThread>()
102 })),
103
104 _ => unsafe { ::core::hint::unreachable_unchecked() },
105 }
106 }
107}
108
109impl<'de> ::fidl_next::IntoNatural for WireTask<'de> {
110 type Natural = Task;
111}
112
113impl<'de> ::fidl_next::FromWireOption<WireOptionalTask<'de>> for Task {
114 #[inline]
115 fn from_wire_option(wire: WireOptionalTask<'de>) -> ::core::option::Option<Self> {
116 if let Some(inner) = wire.into_option() {
117 Some(::fidl_next::FromWire::from_wire(inner))
118 } else {
119 None
120 }
121 }
122}
123
124impl<'de> ::fidl_next::IntoNatural for WireOptionalTask<'de> {
125 type Natural = ::core::option::Option<Task>;
126}
127
128impl<'de> ::fidl_next::FromWireOption<WireOptionalTask<'de>> for Box<Task> {
129 #[inline]
130 fn from_wire_option(wire: WireOptionalTask<'de>) -> ::core::option::Option<Self> {
131 <Task as ::fidl_next::FromWireOption<WireOptionalTask<'de>>>::from_wire_option(wire)
132 .map(Box::new)
133 }
134}
135
136#[repr(transparent)]
138pub struct WireTask<'de> {
139 raw: ::fidl_next::RawWireUnion,
140 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
141}
142
143impl<'de> Drop for WireTask<'de> {
144 fn drop(&mut self) {
145 match self.raw.ordinal() {
146 1 => {
147 let _ = unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireJob>() };
148 }
149
150 2 => {
151 let _ =
152 unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireProcess>() };
153 }
154
155 3 => {
156 let _ =
157 unsafe { self.raw.get().read_unchecked::<::fidl_next::fuchsia::WireThread>() };
158 }
159
160 _ => (),
161 }
162 }
163}
164
165unsafe impl ::fidl_next::Wire for WireTask<'static> {
166 type Decoded<'de> = WireTask<'de>;
167
168 #[inline]
169 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
170 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
171 ::fidl_next::RawWireUnion::zero_padding(raw);
172 }
173}
174
175pub mod task {
176 pub enum Ref<'de> {
177 Job(&'de ::fidl_next::fuchsia::WireJob),
178
179 Process(&'de ::fidl_next::fuchsia::WireProcess),
180
181 Thread(&'de ::fidl_next::fuchsia::WireThread),
182
183 UnknownOrdinal_(u64),
184 }
185}
186
187impl<'de> WireTask<'de> {
188 pub fn as_ref(&self) -> crate::task::Ref<'_> {
189 match self.raw.ordinal() {
190 1 => crate::task::Ref::Job(unsafe {
191 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireJob>()
192 }),
193
194 2 => crate::task::Ref::Process(unsafe {
195 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireProcess>()
196 }),
197
198 3 => crate::task::Ref::Thread(unsafe {
199 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireThread>()
200 }),
201
202 unknown => crate::task::Ref::UnknownOrdinal_(unknown),
203 }
204 }
205}
206
207unsafe impl<___D> ::fidl_next::Decode<___D> for WireTask<'static>
208where
209 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
210 ___D: ::fidl_next::Decoder,
211 ___D: ::fidl_next::fuchsia::HandleDecoder,
212{
213 fn decode(
214 mut slot: ::fidl_next::Slot<'_, Self>,
215 decoder: &mut ___D,
216 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
217 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
218 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
219 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireJob>(
220 raw, decoder,
221 )?,
222
223 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireProcess>(
224 raw, decoder,
225 )?,
226
227 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireThread>(
228 raw, decoder,
229 )?,
230
231 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
232 }
233
234 Ok(())
235 }
236}
237
238impl<'de> ::core::fmt::Debug for WireTask<'de> {
239 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
240 match self.raw.ordinal() {
241 1 => unsafe {
242 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireJob>().fmt(f)
243 },
244 2 => unsafe {
245 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireProcess>().fmt(f)
246 },
247 3 => unsafe {
248 self.raw.get().deref_unchecked::<::fidl_next::fuchsia::WireThread>().fmt(f)
249 },
250 _ => unsafe { ::core::hint::unreachable_unchecked() },
251 }
252 }
253}
254
255#[repr(transparent)]
256pub struct WireOptionalTask<'de> {
257 raw: ::fidl_next::RawWireUnion,
258 _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
259}
260
261unsafe impl ::fidl_next::Wire for WireOptionalTask<'static> {
262 type Decoded<'de> = WireOptionalTask<'de>;
263
264 #[inline]
265 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
266 ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
267 ::fidl_next::RawWireUnion::zero_padding(raw);
268 }
269}
270
271impl<'de> WireOptionalTask<'de> {
272 pub fn is_some(&self) -> bool {
273 self.raw.is_some()
274 }
275
276 pub fn is_none(&self) -> bool {
277 self.raw.is_none()
278 }
279
280 pub fn as_ref(&self) -> ::core::option::Option<&WireTask<'de>> {
281 if self.is_some() { Some(unsafe { &*(self as *const Self).cast() }) } else { None }
282 }
283
284 pub fn into_option(self) -> ::core::option::Option<WireTask<'de>> {
285 if self.is_some() {
286 Some(WireTask { raw: self.raw, _phantom: ::core::marker::PhantomData })
287 } else {
288 None
289 }
290 }
291}
292
293unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalTask<'static>
294where
295 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
296 ___D: ::fidl_next::Decoder,
297 ___D: ::fidl_next::fuchsia::HandleDecoder,
298{
299 fn decode(
300 mut slot: ::fidl_next::Slot<'_, Self>,
301 decoder: &mut ___D,
302 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
303 ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
304 match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
305 1 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireJob>(
306 raw, decoder,
307 )?,
308
309 2 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireProcess>(
310 raw, decoder,
311 )?,
312
313 3 => ::fidl_next::RawWireUnion::decode_as::<___D, ::fidl_next::fuchsia::WireThread>(
314 raw, decoder,
315 )?,
316
317 0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
318 _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
319 }
320
321 Ok(())
322 }
323}
324
325impl<'de> ::core::fmt::Debug for WireOptionalTask<'de> {
326 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
327 self.as_ref().fmt(f)
328 }
329}
330
331#[derive(PartialEq, Debug, Default)]
332pub struct ComponentTasks {
333 pub component_task: ::core::option::Option<crate::Task>,
334
335 pub parent_task: ::core::option::Option<crate::Task>,
336}
337
338impl ComponentTasks {
339 fn __max_ordinal(&self) -> usize {
340 if self.parent_task.is_some() {
341 return 2;
342 }
343
344 if self.component_task.is_some() {
345 return 1;
346 }
347
348 0
349 }
350}
351
352impl ::fidl_next::Encodable for ComponentTasks {
353 type Encoded = WireComponentTasks<'static>;
354}
355
356unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentTasks
357where
358 ___E: ::fidl_next::Encoder + ?Sized,
359 ___E: ::fidl_next::fuchsia::HandleEncoder,
360{
361 #[inline]
362 fn encode(
363 mut self,
364 encoder: &mut ___E,
365 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
366 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
367 ::fidl_next::munge!(let WireComponentTasks { table } = out);
368
369 let max_ord = self.__max_ordinal();
370
371 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
372 ::fidl_next::Wire::zero_padding(&mut out);
373
374 let mut preallocated =
375 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
376
377 for i in 1..=max_ord {
378 match i {
379 2 => {
380 if let Some(value) = self.parent_task.take() {
381 ::fidl_next::WireEnvelope::encode_value(
382 value,
383 preallocated.encoder,
384 &mut out,
385 )?;
386 } else {
387 ::fidl_next::WireEnvelope::encode_zero(&mut out)
388 }
389 }
390
391 1 => {
392 if let Some(value) = self.component_task.take() {
393 ::fidl_next::WireEnvelope::encode_value(
394 value,
395 preallocated.encoder,
396 &mut out,
397 )?;
398 } else {
399 ::fidl_next::WireEnvelope::encode_zero(&mut out)
400 }
401 }
402
403 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
404 }
405 unsafe {
406 preallocated.write_next(out.assume_init_ref());
407 }
408 }
409
410 ::fidl_next::WireTable::encode_len(table, max_ord);
411
412 Ok(())
413 }
414}
415
416impl<'de> ::fidl_next::FromWire<WireComponentTasks<'de>> for ComponentTasks {
417 #[inline]
418 fn from_wire(wire_: WireComponentTasks<'de>) -> Self {
419 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
420
421 let component_task = wire_.table.get(1);
422
423 let parent_task = wire_.table.get(2);
424
425 Self {
426 component_task: component_task.map(|envelope| {
427 ::fidl_next::FromWire::from_wire(unsafe {
428 envelope.read_unchecked::<crate::WireTask<'de>>()
429 })
430 }),
431
432 parent_task: parent_task.map(|envelope| {
433 ::fidl_next::FromWire::from_wire(unsafe {
434 envelope.read_unchecked::<crate::WireTask<'de>>()
435 })
436 }),
437 }
438 }
439}
440
441impl<'de> ::fidl_next::IntoNatural for WireComponentTasks<'de> {
442 type Natural = ComponentTasks;
443}
444
445#[repr(C)]
447pub struct WireComponentTasks<'de> {
448 table: ::fidl_next::WireTable<'de>,
449}
450
451impl<'de> Drop for WireComponentTasks<'de> {
452 fn drop(&mut self) {
453 let _ = self
454 .table
455 .get(1)
456 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireTask<'de>>() });
457
458 let _ = self
459 .table
460 .get(2)
461 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireTask<'de>>() });
462 }
463}
464
465unsafe impl ::fidl_next::Wire for WireComponentTasks<'static> {
466 type Decoded<'de> = WireComponentTasks<'de>;
467
468 #[inline]
469 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
470 ::fidl_next::munge!(let Self { table } = out);
471 ::fidl_next::WireTable::zero_padding(table);
472 }
473}
474
475unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentTasks<'static>
476where
477 ___D: ::fidl_next::Decoder + ?Sized,
478 ___D: ::fidl_next::fuchsia::HandleDecoder,
479{
480 fn decode(
481 slot: ::fidl_next::Slot<'_, Self>,
482 decoder: &mut ___D,
483 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
484 ::fidl_next::munge!(let Self { table } = slot);
485
486 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
487 match ordinal {
488 0 => unsafe { ::core::hint::unreachable_unchecked() },
489
490 1 => {
491 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireTask<'static>>(
492 slot.as_mut(),
493 decoder,
494 )?;
495
496 Ok(())
497 }
498
499 2 => {
500 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireTask<'static>>(
501 slot.as_mut(),
502 decoder,
503 )?;
504
505 Ok(())
506 }
507
508 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
509 }
510 })
511 }
512}
513
514impl<'de> WireComponentTasks<'de> {
515 pub fn component_task(&self) -> ::core::option::Option<&crate::WireTask<'de>> {
516 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
517 }
518
519 pub fn parent_task(&self) -> ::core::option::Option<&crate::WireTask<'de>> {
520 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
521 }
522}
523
524impl<'de> ::core::fmt::Debug for WireComponentTasks<'de> {
525 fn fmt(
526 &self,
527 f: &mut ::core::fmt::Formatter<'_>,
528 ) -> ::core::result::Result<(), ::core::fmt::Error> {
529 f.debug_struct("ComponentTasks")
530 .field("component_task", &self.component_task())
531 .field("parent_task", &self.parent_task())
532 .finish()
533 }
534}
535
536#[derive(PartialEq, Debug, Default)]
537pub struct ComponentDiagnostics {
538 pub tasks: ::core::option::Option<crate::ComponentTasks>,
539}
540
541impl ComponentDiagnostics {
542 fn __max_ordinal(&self) -> usize {
543 if self.tasks.is_some() {
544 return 1;
545 }
546
547 0
548 }
549}
550
551impl ::fidl_next::Encodable for ComponentDiagnostics {
552 type Encoded = WireComponentDiagnostics<'static>;
553}
554
555unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentDiagnostics
556where
557 ___E: ::fidl_next::Encoder + ?Sized,
558 ___E: ::fidl_next::fuchsia::HandleEncoder,
559{
560 #[inline]
561 fn encode(
562 mut self,
563 encoder: &mut ___E,
564 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
565 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
566 ::fidl_next::munge!(let WireComponentDiagnostics { table } = out);
567
568 let max_ord = self.__max_ordinal();
569
570 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
571 ::fidl_next::Wire::zero_padding(&mut out);
572
573 let mut preallocated =
574 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
575
576 for i in 1..=max_ord {
577 match i {
578 1 => {
579 if let Some(value) = self.tasks.take() {
580 ::fidl_next::WireEnvelope::encode_value(
581 value,
582 preallocated.encoder,
583 &mut out,
584 )?;
585 } else {
586 ::fidl_next::WireEnvelope::encode_zero(&mut out)
587 }
588 }
589
590 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
591 }
592 unsafe {
593 preallocated.write_next(out.assume_init_ref());
594 }
595 }
596
597 ::fidl_next::WireTable::encode_len(table, max_ord);
598
599 Ok(())
600 }
601}
602
603impl<'de> ::fidl_next::FromWire<WireComponentDiagnostics<'de>> for ComponentDiagnostics {
604 #[inline]
605 fn from_wire(wire_: WireComponentDiagnostics<'de>) -> Self {
606 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
607
608 let tasks = wire_.table.get(1);
609
610 Self {
611 tasks: tasks.map(|envelope| {
612 ::fidl_next::FromWire::from_wire(unsafe {
613 envelope.read_unchecked::<crate::WireComponentTasks<'de>>()
614 })
615 }),
616 }
617 }
618}
619
620impl<'de> ::fidl_next::IntoNatural for WireComponentDiagnostics<'de> {
621 type Natural = ComponentDiagnostics;
622}
623
624#[repr(C)]
626pub struct WireComponentDiagnostics<'de> {
627 table: ::fidl_next::WireTable<'de>,
628}
629
630impl<'de> Drop for WireComponentDiagnostics<'de> {
631 fn drop(&mut self) {
632 let _ = self
633 .table
634 .get(1)
635 .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireComponentTasks<'de>>() });
636 }
637}
638
639unsafe impl ::fidl_next::Wire for WireComponentDiagnostics<'static> {
640 type Decoded<'de> = WireComponentDiagnostics<'de>;
641
642 #[inline]
643 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
644 ::fidl_next::munge!(let Self { table } = out);
645 ::fidl_next::WireTable::zero_padding(table);
646 }
647}
648
649unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentDiagnostics<'static>
650where
651 ___D: ::fidl_next::Decoder + ?Sized,
652 ___D: ::fidl_next::fuchsia::HandleDecoder,
653{
654 fn decode(
655 slot: ::fidl_next::Slot<'_, Self>,
656 decoder: &mut ___D,
657 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
658 ::fidl_next::munge!(let Self { table } = slot);
659
660 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
661 match ordinal {
662 0 => unsafe { ::core::hint::unreachable_unchecked() },
663
664 1 => {
665 ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireComponentTasks<'static>>(
666 slot.as_mut(),
667 decoder,
668 )?;
669
670 Ok(())
671 }
672
673 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
674 }
675 })
676 }
677}
678
679impl<'de> WireComponentDiagnostics<'de> {
680 pub fn tasks(&self) -> ::core::option::Option<&crate::WireComponentTasks<'de>> {
681 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
682 }
683}
684
685impl<'de> ::core::fmt::Debug for WireComponentDiagnostics<'de> {
686 fn fmt(
687 &self,
688 f: &mut ::core::fmt::Formatter<'_>,
689 ) -> ::core::result::Result<(), ::core::fmt::Error> {
690 f.debug_struct("ComponentDiagnostics").field("tasks", &self.tasks()).finish()
691 }
692}
693
694#[derive(PartialEq, Debug)]
695pub struct ComponentControllerOnPublishDiagnosticsRequest {
696 pub payload: crate::ComponentDiagnostics,
697}
698
699impl ::fidl_next::Encodable for ComponentControllerOnPublishDiagnosticsRequest {
700 type Encoded = WireComponentControllerOnPublishDiagnosticsRequest<'static>;
701}
702
703unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentControllerOnPublishDiagnosticsRequest
704where
705 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
706 ___E: ::fidl_next::Encoder,
707 ___E: ::fidl_next::fuchsia::HandleEncoder,
708{
709 #[inline]
710 fn encode(
711 self,
712 encoder_: &mut ___E,
713 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
714 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
715 ::fidl_next::munge! {
716 let Self::Encoded {
717 payload,
718
719 } = out_;
720 }
721
722 ::fidl_next::Encode::encode(self.payload, encoder_, payload)?;
723
724 Ok(())
725 }
726}
727
728impl ::fidl_next::EncodableOption for ComponentControllerOnPublishDiagnosticsRequest {
729 type EncodedOption =
730 ::fidl_next::WireBox<'static, WireComponentControllerOnPublishDiagnosticsRequest<'static>>;
731}
732
733unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ComponentControllerOnPublishDiagnosticsRequest
734where
735 ___E: ::fidl_next::Encoder + ?Sized,
736 ComponentControllerOnPublishDiagnosticsRequest: ::fidl_next::Encode<___E>,
737{
738 #[inline]
739 fn encode_option(
740 this: ::core::option::Option<Self>,
741 encoder: &mut ___E,
742 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
743 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
744 if let Some(inner) = this {
745 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
746 ::fidl_next::WireBox::encode_present(out);
747 } else {
748 ::fidl_next::WireBox::encode_absent(out);
749 }
750
751 Ok(())
752 }
753}
754
755impl<'de> ::fidl_next::FromWire<WireComponentControllerOnPublishDiagnosticsRequest<'de>>
756 for ComponentControllerOnPublishDiagnosticsRequest
757{
758 #[inline]
759 fn from_wire(wire: WireComponentControllerOnPublishDiagnosticsRequest<'de>) -> Self {
760 Self { payload: ::fidl_next::FromWire::from_wire(wire.payload) }
761 }
762}
763
764impl<'de> ::fidl_next::IntoNatural for WireComponentControllerOnPublishDiagnosticsRequest<'de> {
765 type Natural = ComponentControllerOnPublishDiagnosticsRequest;
766}
767
768#[derive(Debug)]
770#[repr(C)]
771pub struct WireComponentControllerOnPublishDiagnosticsRequest<'de> {
772 pub payload: crate::WireComponentDiagnostics<'de>,
773}
774static_assertions::const_assert_eq!(
775 std::mem::size_of::<WireComponentControllerOnPublishDiagnosticsRequest<'_>>(),
776 16
777);
778static_assertions::const_assert_eq!(
779 std::mem::align_of::<WireComponentControllerOnPublishDiagnosticsRequest<'_>>(),
780 8
781);
782
783static_assertions::const_assert_eq!(
784 std::mem::offset_of!(WireComponentControllerOnPublishDiagnosticsRequest<'_>, payload),
785 0
786);
787
788unsafe impl ::fidl_next::Wire for WireComponentControllerOnPublishDiagnosticsRequest<'static> {
789 type Decoded<'de> = WireComponentControllerOnPublishDiagnosticsRequest<'de>;
790
791 #[inline]
792 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
793 ::fidl_next::munge! {
794 let Self {
795
796 payload,
797
798 } = &mut *out_;
799 }
800
801 ::fidl_next::Wire::zero_padding(payload);
802 }
803}
804
805unsafe impl<___D> ::fidl_next::Decode<___D>
806 for WireComponentControllerOnPublishDiagnosticsRequest<'static>
807where
808 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
809 ___D: ::fidl_next::Decoder,
810 ___D: ::fidl_next::fuchsia::HandleDecoder,
811{
812 fn decode(
813 slot_: ::fidl_next::Slot<'_, Self>,
814 decoder_: &mut ___D,
815 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
816 ::fidl_next::munge! {
817 let Self {
818
819 mut payload,
820
821 } = slot_;
822 }
823
824 ::fidl_next::Decode::decode(payload.as_mut(), decoder_)?;
825
826 Ok(())
827 }
828}
829
830#[derive(PartialEq, Debug, Default)]
831pub struct ComponentStopInfo {
832 pub termination_status: ::core::option::Option<i32>,
833
834 pub exit_code: ::core::option::Option<i64>,
835}
836
837impl ComponentStopInfo {
838 fn __max_ordinal(&self) -> usize {
839 if self.exit_code.is_some() {
840 return 2;
841 }
842
843 if self.termination_status.is_some() {
844 return 1;
845 }
846
847 0
848 }
849}
850
851impl ::fidl_next::Encodable for ComponentStopInfo {
852 type Encoded = WireComponentStopInfo<'static>;
853}
854
855unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentStopInfo
856where
857 ___E: ::fidl_next::Encoder + ?Sized,
858 ___E: ::fidl_next::fuchsia::HandleEncoder,
859{
860 #[inline]
861 fn encode(
862 mut self,
863 encoder: &mut ___E,
864 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
865 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
866 ::fidl_next::munge!(let WireComponentStopInfo { table } = out);
867
868 let max_ord = self.__max_ordinal();
869
870 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
871 ::fidl_next::Wire::zero_padding(&mut out);
872
873 let mut preallocated =
874 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
875
876 for i in 1..=max_ord {
877 match i {
878 2 => {
879 if let Some(value) = self.exit_code.take() {
880 ::fidl_next::WireEnvelope::encode_value(
881 value,
882 preallocated.encoder,
883 &mut out,
884 )?;
885 } else {
886 ::fidl_next::WireEnvelope::encode_zero(&mut out)
887 }
888 }
889
890 1 => {
891 if let Some(value) = self.termination_status.take() {
892 ::fidl_next::WireEnvelope::encode_value(
893 value,
894 preallocated.encoder,
895 &mut out,
896 )?;
897 } else {
898 ::fidl_next::WireEnvelope::encode_zero(&mut out)
899 }
900 }
901
902 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
903 }
904 unsafe {
905 preallocated.write_next(out.assume_init_ref());
906 }
907 }
908
909 ::fidl_next::WireTable::encode_len(table, max_ord);
910
911 Ok(())
912 }
913}
914
915impl<'de> ::fidl_next::FromWire<WireComponentStopInfo<'de>> for ComponentStopInfo {
916 #[inline]
917 fn from_wire(wire_: WireComponentStopInfo<'de>) -> Self {
918 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
919
920 let termination_status = wire_.table.get(1);
921
922 let exit_code = wire_.table.get(2);
923
924 Self {
925 termination_status: termination_status.map(|envelope| {
926 ::fidl_next::FromWire::from_wire(unsafe {
927 envelope.read_unchecked::<::fidl_next::WireI32>()
928 })
929 }),
930
931 exit_code: exit_code.map(|envelope| {
932 ::fidl_next::FromWire::from_wire(unsafe {
933 envelope.read_unchecked::<::fidl_next::WireI64>()
934 })
935 }),
936 }
937 }
938}
939
940impl<'de> ::fidl_next::IntoNatural for WireComponentStopInfo<'de> {
941 type Natural = ComponentStopInfo;
942}
943
944#[repr(C)]
946pub struct WireComponentStopInfo<'de> {
947 table: ::fidl_next::WireTable<'de>,
948}
949
950impl<'de> Drop for WireComponentStopInfo<'de> {
951 fn drop(&mut self) {
952 let _ = self
953 .table
954 .get(1)
955 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireI32>() });
956
957 let _ = self
958 .table
959 .get(2)
960 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireI64>() });
961 }
962}
963
964unsafe impl ::fidl_next::Wire for WireComponentStopInfo<'static> {
965 type Decoded<'de> = WireComponentStopInfo<'de>;
966
967 #[inline]
968 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
969 ::fidl_next::munge!(let Self { table } = out);
970 ::fidl_next::WireTable::zero_padding(table);
971 }
972}
973
974unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentStopInfo<'static>
975where
976 ___D: ::fidl_next::Decoder + ?Sized,
977 ___D: ::fidl_next::fuchsia::HandleDecoder,
978{
979 fn decode(
980 slot: ::fidl_next::Slot<'_, Self>,
981 decoder: &mut ___D,
982 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
983 ::fidl_next::munge!(let Self { table } = slot);
984
985 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
986 match ordinal {
987 0 => unsafe { ::core::hint::unreachable_unchecked() },
988
989 1 => {
990 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI32>(
991 slot.as_mut(),
992 decoder,
993 )?;
994
995 Ok(())
996 }
997
998 2 => {
999 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI64>(
1000 slot.as_mut(),
1001 decoder,
1002 )?;
1003
1004 Ok(())
1005 }
1006
1007 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1008 }
1009 })
1010 }
1011}
1012
1013impl<'de> WireComponentStopInfo<'de> {
1014 pub fn termination_status(&self) -> ::core::option::Option<&::fidl_next::WireI32> {
1015 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1016 }
1017
1018 pub fn exit_code(&self) -> ::core::option::Option<&::fidl_next::WireI64> {
1019 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1020 }
1021}
1022
1023impl<'de> ::core::fmt::Debug for WireComponentStopInfo<'de> {
1024 fn fmt(
1025 &self,
1026 f: &mut ::core::fmt::Formatter<'_>,
1027 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1028 f.debug_struct("ComponentStopInfo")
1029 .field("termination_status", &self.termination_status())
1030 .field("exit_code", &self.exit_code())
1031 .finish()
1032 }
1033}
1034
1035#[derive(PartialEq, Debug, Default)]
1036pub struct ComponentControllerOnEscrowRequest {
1037 pub outgoing_dir: ::core::option::Option<
1038 ::fidl_next::ServerEnd<
1039 ::fidl_next_fuchsia_io::Directory,
1040 ::fidl_next::fuchsia::zx::Channel,
1041 >,
1042 >,
1043
1044 pub escrowed_dictionary:
1045 ::core::option::Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
1046}
1047
1048impl ComponentControllerOnEscrowRequest {
1049 fn __max_ordinal(&self) -> usize {
1050 if self.escrowed_dictionary.is_some() {
1051 return 2;
1052 }
1053
1054 if self.outgoing_dir.is_some() {
1055 return 1;
1056 }
1057
1058 0
1059 }
1060}
1061
1062impl ::fidl_next::Encodable for ComponentControllerOnEscrowRequest {
1063 type Encoded = WireComponentControllerOnEscrowRequest<'static>;
1064}
1065
1066unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentControllerOnEscrowRequest
1067where
1068 ___E: ::fidl_next::Encoder + ?Sized,
1069 ___E: ::fidl_next::fuchsia::HandleEncoder,
1070{
1071 #[inline]
1072 fn encode(
1073 mut self,
1074 encoder: &mut ___E,
1075 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1076 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1077 ::fidl_next::munge!(let WireComponentControllerOnEscrowRequest { table } = out);
1078
1079 let max_ord = self.__max_ordinal();
1080
1081 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1082 ::fidl_next::Wire::zero_padding(&mut out);
1083
1084 let mut preallocated =
1085 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1086
1087 for i in 1..=max_ord {
1088 match i {
1089 2 => {
1090 if let Some(value) = self.escrowed_dictionary.take() {
1091 ::fidl_next::WireEnvelope::encode_value(
1092 value,
1093 preallocated.encoder,
1094 &mut out,
1095 )?;
1096 } else {
1097 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1098 }
1099 }
1100
1101 1 => {
1102 if let Some(value) = self.outgoing_dir.take() {
1103 ::fidl_next::WireEnvelope::encode_value(
1104 value,
1105 preallocated.encoder,
1106 &mut out,
1107 )?;
1108 } else {
1109 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1110 }
1111 }
1112
1113 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1114 }
1115 unsafe {
1116 preallocated.write_next(out.assume_init_ref());
1117 }
1118 }
1119
1120 ::fidl_next::WireTable::encode_len(table, max_ord);
1121
1122 Ok(())
1123 }
1124}
1125
1126impl<'de> ::fidl_next::FromWire<WireComponentControllerOnEscrowRequest<'de>>
1127 for ComponentControllerOnEscrowRequest
1128{
1129 #[inline]
1130 fn from_wire(wire_: WireComponentControllerOnEscrowRequest<'de>) -> Self {
1131 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1132
1133 let outgoing_dir = wire_.table.get(1);
1134
1135 let escrowed_dictionary = wire_.table.get(2);
1136
1137 Self {
1138 outgoing_dir: outgoing_dir.map(|envelope| {
1139 ::fidl_next::FromWire::from_wire(unsafe {
1140 envelope.read_unchecked::<::fidl_next::ServerEnd<
1141 ::fidl_next_fuchsia_io::Directory,
1142 ::fidl_next::fuchsia::WireChannel,
1143 >>()
1144 })
1145 }),
1146
1147 escrowed_dictionary: escrowed_dictionary.map(|envelope| {
1148 ::fidl_next::FromWire::from_wire(unsafe {
1149 envelope
1150 .read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>(
1151 )
1152 })
1153 }),
1154 }
1155 }
1156}
1157
1158impl<'de> ::fidl_next::IntoNatural for WireComponentControllerOnEscrowRequest<'de> {
1159 type Natural = ComponentControllerOnEscrowRequest;
1160}
1161
1162#[repr(C)]
1164pub struct WireComponentControllerOnEscrowRequest<'de> {
1165 table: ::fidl_next::WireTable<'de>,
1166}
1167
1168impl<'de> Drop for WireComponentControllerOnEscrowRequest<'de> {
1169 fn drop(&mut self) {
1170 let _ = self.table.get(1).map(|envelope| unsafe {
1171 envelope.read_unchecked::<::fidl_next::ServerEnd<
1172 ::fidl_next_fuchsia_io::Directory,
1173 ::fidl_next::fuchsia::WireChannel,
1174 >>()
1175 });
1176
1177 let _ = self.table.get(2).map(|envelope| unsafe {
1178 envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>()
1179 });
1180 }
1181}
1182
1183unsafe impl ::fidl_next::Wire for WireComponentControllerOnEscrowRequest<'static> {
1184 type Decoded<'de> = WireComponentControllerOnEscrowRequest<'de>;
1185
1186 #[inline]
1187 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1188 ::fidl_next::munge!(let Self { table } = out);
1189 ::fidl_next::WireTable::zero_padding(table);
1190 }
1191}
1192
1193unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentControllerOnEscrowRequest<'static>
1194where
1195 ___D: ::fidl_next::Decoder + ?Sized,
1196 ___D: ::fidl_next::fuchsia::HandleDecoder,
1197{
1198 fn decode(
1199 slot: ::fidl_next::Slot<'_, Self>,
1200 decoder: &mut ___D,
1201 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1202 ::fidl_next::munge!(let Self { table } = slot);
1203
1204 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1205 match ordinal {
1206 0 => unsafe { ::core::hint::unreachable_unchecked() },
1207
1208 1 => {
1209 ::fidl_next::WireEnvelope::decode_as::<
1210 ___D,
1211 ::fidl_next::ServerEnd<
1212 ::fidl_next_fuchsia_io::Directory,
1213 ::fidl_next::fuchsia::WireChannel,
1214 >,
1215 >(slot.as_mut(), decoder)?;
1216
1217 Ok(())
1218 }
1219
1220 2 => {
1221 ::fidl_next::WireEnvelope::decode_as::<
1222 ___D,
1223 ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
1224 >(slot.as_mut(), decoder)?;
1225
1226 Ok(())
1227 }
1228
1229 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1230 }
1231 })
1232 }
1233}
1234
1235impl<'de> WireComponentControllerOnEscrowRequest<'de> {
1236 pub fn outgoing_dir(
1237 &self,
1238 ) -> ::core::option::Option<
1239 &::fidl_next::ServerEnd<
1240 ::fidl_next_fuchsia_io::Directory,
1241 ::fidl_next::fuchsia::WireChannel,
1242 >,
1243 > {
1244 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1245 }
1246
1247 pub fn escrowed_dictionary(
1248 &self,
1249 ) -> ::core::option::Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
1250 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1251 }
1252}
1253
1254impl<'de> ::core::fmt::Debug for WireComponentControllerOnEscrowRequest<'de> {
1255 fn fmt(
1256 &self,
1257 f: &mut ::core::fmt::Formatter<'_>,
1258 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1259 f.debug_struct("ComponentControllerOnEscrowRequest")
1260 .field("outgoing_dir", &self.outgoing_dir())
1261 .field("escrowed_dictionary", &self.escrowed_dictionary())
1262 .finish()
1263 }
1264}
1265
1266#[doc = " A protocol for binding and controlling the lifetime of a component instance\n started using `ComponentRunner.Start()`. The component manager is the\n intended direct client of this protocol.\n\n When the controlled component instance terminates or becomes inaccessible\n for any reason, the server closes the connection with an epitaph.\n\n # Lifecycle\n\n A component may exist in one of two states: `Started`, or `Stopped`. The\n component is `Started` from the time `ComponentRunner.Start()` is called\n until the ComponentRunner closes the ComponentController handle. The\n component then transitions to `Stopped`.\n\n Component manager uses ComponentController to terminate a component in two\n steps:\n\n 1. Component manager calls `Stop()` to indicate that the ComponentRunner\n should stop a component\'s execution and send the `OnStop` event.\n 2. If after some time the ComponentController is not closed, component\n manager calls `Kill()` to indicate that the ComponentRunner must halt a\n component\'s execution immediately, and then send the `OnStop` event.\n The component manager may wait some period of time after calling `Kill()`\n before sending `OnStop`, but makes no guarantees it will wait or for how long.\n\n Component manager first waits for the ComponentController to close, and\n then tears down the namespace it hosts for the stopped component. Component\n manager may call `Kill()` without first having called `Stop()`.\n\n Before stopping, a component can optionally use `OnEscrow` to store some\n state in the framework, to receive those state again the next time it is\n started.\n\n When the component stops, the runner should send an `OnStop` event\n instead of just closing the channel, to report the component\'s termination status\n (see below) and (optionally) an exit code. Once the runner has sent `OnStop`\n it is free to close [ComponentRunner]; the component framework will close\n its end of the channel when it receives this event.\n\n ## Legacy\n\n Instead of sending `OnStop`, it is also legal for a runner to close the channel\n with with an epitaph equal to the termination status, but this is a legacy method\n for backward compatibility that\'s no longer recommended.\n\n # Termination status\n\n The termination status indicates the component\'s final disposition in the eyes of\n the runner.\n\n Note that termination status is _not_ synonymous with a component\'s exit code.\n A component\'s exit code, which is optional for a runner to report, is an\n integer that represents the program\'s own return code. For example, for ELF\n components, it is the value returned by main(). The termination status is\n the _runner_\'s status code for the component\'s termination, which may capture\n failure modes that occur in the context of the runner itself rather than the\n program.\n\n The following termination statuses may be sent by the server on error:\n\n - `ZX_OK`: The component exited successfully, typically because the\n component was asked to stop or it decided independently to exit.\n - `INVALID_ARGUMENTS`:\n * `start_info.resolved_url` is not supported by this\n runner;\n * `start_info` contains missing or invalid arguments.\n - `INSTANCE_CANNOT_START`: The runner could not start the component.\n For example, a critical part of the program could not be found or\n loaded, or the referenced binary was invalid for this runner.\n - `RESOURCE_UNAVAILABLE`: The component could not be launched due to\n lack of resources.\n - `INTERNAL`: An unexpected internal runner error was encountered.\n - `INSTANCE_DIED`: The component instance was started but\n subsequently terminated with an error.\n - Other status codes (e.g. `ZX_ERR_PEER_CLOSED`) may indicate a failure\n of the component runner itself. The component manager may respond to such\n failures by terminating the component runner\'s job to ensure system\n stability.\n"]
1268#[derive(PartialEq, Debug)]
1269pub struct ComponentController;
1270
1271pub mod component_controller {
1272 pub mod prelude {
1273 pub use crate::{
1274 ComponentController, ComponentControllerClientHandler,
1275 ComponentControllerServerHandler, component_controller,
1276 };
1277
1278 pub use crate::ComponentControllerOnEscrowRequest;
1279
1280 pub use crate::ComponentControllerOnPublishDiagnosticsRequest;
1281
1282 pub use crate::ComponentStopInfo;
1283 }
1284
1285 pub struct Stop;
1286
1287 impl ::fidl_next::Method for Stop {
1288 const ORDINAL: u64 = 4804506821232171874;
1289
1290 type Protocol = crate::ComponentController;
1291
1292 type Request = ();
1293
1294 type Response = ::fidl_next::Never;
1295 }
1296
1297 pub struct Kill;
1298
1299 impl ::fidl_next::Method for Kill {
1300 const ORDINAL: u64 = 4514346391631670964;
1301
1302 type Protocol = crate::ComponentController;
1303
1304 type Request = ();
1305
1306 type Response = ::fidl_next::Never;
1307 }
1308
1309 pub struct OnPublishDiagnostics;
1310
1311 impl ::fidl_next::Method for OnPublishDiagnostics {
1312 const ORDINAL: u64 = 2240216199992207687;
1313
1314 type Protocol = crate::ComponentController;
1315
1316 type Request = ::fidl_next::Never;
1317
1318 type Response = crate::WireComponentControllerOnPublishDiagnosticsRequest<'static>;
1319 }
1320
1321 pub struct OnEscrow;
1322
1323 impl ::fidl_next::Method for OnEscrow {
1324 const ORDINAL: u64 = 730448769712342012;
1325
1326 type Protocol = crate::ComponentController;
1327
1328 type Request = ::fidl_next::Never;
1329
1330 type Response = crate::WireComponentControllerOnEscrowRequest<'static>;
1331 }
1332
1333 pub struct OnStop;
1334
1335 impl ::fidl_next::Method for OnStop {
1336 const ORDINAL: u64 = 4322651556509354674;
1337
1338 type Protocol = crate::ComponentController;
1339
1340 type Request = ::fidl_next::Never;
1341
1342 type Response = crate::WireComponentStopInfo<'static>;
1343 }
1344
1345 mod ___detail {
1346
1347 pub struct OnPublishDiagnostics<T0> {
1348 payload: T0,
1349 }
1350
1351 impl<T0> ::fidl_next::Encodable for OnPublishDiagnostics<T0>
1352 where
1353 T0: ::fidl_next::Encodable<Encoded = crate::WireComponentDiagnostics<'static>>,
1354 {
1355 type Encoded = crate::WireComponentControllerOnPublishDiagnosticsRequest<'static>;
1356 }
1357
1358 unsafe impl<___E, T0> ::fidl_next::Encode<___E> for OnPublishDiagnostics<T0>
1359 where
1360 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1361 ___E: ::fidl_next::Encoder,
1362 ___E: ::fidl_next::fuchsia::HandleEncoder,
1363 T0: ::fidl_next::Encode<___E, Encoded = crate::WireComponentDiagnostics<'static>>,
1364 {
1365 #[inline]
1366 fn encode(
1367 self,
1368 encoder_: &mut ___E,
1369 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1370 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1371 ::fidl_next::munge! {
1372 let Self::Encoded {
1373 payload,
1374
1375 } = out_;
1376 }
1377
1378 ::fidl_next::Encode::encode(self.payload, encoder_, payload)?;
1379
1380 Ok(())
1381 }
1382 }
1383
1384 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::ComponentController
1385 where
1386 ___T: ::fidl_next::Transport,
1387 {
1388 type Client = ComponentControllerClient<___T>;
1389 type Server = ComponentControllerServer<___T>;
1390 }
1391
1392 #[repr(transparent)]
1394 pub struct ComponentControllerClient<___T: ::fidl_next::Transport> {
1395 #[allow(dead_code)]
1396 client: ::fidl_next::protocol::Client<___T>,
1397 }
1398
1399 impl<___T> ComponentControllerClient<___T>
1400 where
1401 ___T: ::fidl_next::Transport,
1402 {
1403 #[doc = " Request to stop the component instance.\n\n After stopping the component instance, the server should close this\n connection with an epitaph. After the connection\n closes, component manager considers this component instance to be\n Stopped and the component\'s namespace will be torn down.\n"]
1404 pub fn stop(&self) -> ::fidl_next::SendFuture<'_, ___T> {
1405 ::fidl_next::SendFuture::from_untyped(
1406 self.client.send_one_way(4804506821232171874, ()),
1407 )
1408 }
1409
1410 #[doc = " Stop this component instance immediately.\n\n The ComponentRunner must immediately kill the component instance, and\n then close this connection with an epitaph. After the connection\n closes, component manager considers this component instance to be\n Stopped and the component\'s namespace will be torn down.\n\n In some cases Kill() may be issued before Stop(), but that is not\n guaranteed.\n"]
1411 pub fn kill(&self) -> ::fidl_next::SendFuture<'_, ___T> {
1412 ::fidl_next::SendFuture::from_untyped(
1413 self.client.send_one_way(4514346391631670964, ()),
1414 )
1415 }
1416 }
1417
1418 #[repr(transparent)]
1420 pub struct ComponentControllerServer<___T: ::fidl_next::Transport> {
1421 server: ::fidl_next::protocol::Server<___T>,
1422 }
1423
1424 impl<___T> ComponentControllerServer<___T>
1425 where
1426 ___T: ::fidl_next::Transport,
1427 {
1428 #[doc = " Event for runners to publish diagnostics to the platform.\n\n This event signals to the platform that the runner for this\n component is publishing diagnostics about the runtime of the\n component. The component manager may optionally expose this data\n to clients.\n"]
1429 pub fn on_publish_diagnostics(
1430 &self,
1431
1432 payload: impl ::fidl_next::Encode<
1433 <___T as ::fidl_next::Transport>::SendBuffer,
1434 Encoded = crate::WireComponentDiagnostics<'static>,
1435 >,
1436 ) -> ::fidl_next::SendFuture<'_, ___T>
1437 where
1438 <___T as ::fidl_next::Transport>::SendBuffer:
1439 ::fidl_next::encoder::InternalHandleEncoder,
1440 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
1441 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
1442 {
1443 self.on_publish_diagnostics_with(OnPublishDiagnostics { payload })
1444 }
1445
1446 #[doc = " Event for runners to publish diagnostics to the platform.\n\n This event signals to the platform that the runner for this\n component is publishing diagnostics about the runtime of the\n component. The component manager may optionally expose this data\n to clients.\n"]
1447
1448 pub fn on_publish_diagnostics_with<___R>(
1449 &self,
1450 request: ___R,
1451 ) -> ::fidl_next::SendFuture<'_, ___T>
1452 where
1453 ___R: ::fidl_next::Encode<
1454 <___T as ::fidl_next::Transport>::SendBuffer,
1455 Encoded = <super::OnPublishDiagnostics as ::fidl_next::Method>::Response,
1456 >,
1457 {
1458 ::fidl_next::SendFuture::from_untyped(
1459 self.server.send_event(2240216199992207687, request),
1460 )
1461 }
1462
1463 #[doc = " Store some of the component\'s state in the framework, to be redelivered\n to the component the next time it\'s started (a practice called\n \"escrowing\").\n\n When the framework receives this event, it will wait until the current\n execution of the component has finished, then start the component again\n when the `ZX_CHANNEL_READABLE` signal is observed on `outgoing_dir`.\n\n Repeated calls will replace the old escrowed value. This is discouraged.\n\n Handles escrowed via `OnEscrow` are always delivered to the next\n execution of the component.\n"]
1464
1465 pub fn on_escrow_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1466 where
1467 ___R: ::fidl_next::Encode<
1468 <___T as ::fidl_next::Transport>::SendBuffer,
1469 Encoded = <super::OnEscrow as ::fidl_next::Method>::Response,
1470 >,
1471 {
1472 ::fidl_next::SendFuture::from_untyped(
1473 self.server.send_event(730448769712342012, request),
1474 )
1475 }
1476
1477 #[doc = " Report that the component has stopped, with data about its termination. This will\n cause the component to make a lifecycle transition to `Stopped`.\n\n Once the runner has sent `OnStop` it is free to close this [ComponentRunner]; the\n component framework will close its end of the channel when it receives this event.\n\n Alternatively, a runner may close the controller channel without this event to signal\n component stop, but this method is legacy and no longer recommended.\n"]
1478
1479 pub fn on_stop_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
1480 where
1481 ___R: ::fidl_next::Encode<
1482 <___T as ::fidl_next::Transport>::SendBuffer,
1483 Encoded = <super::OnStop as ::fidl_next::Method>::Response,
1484 >,
1485 {
1486 ::fidl_next::SendFuture::from_untyped(
1487 self.server.send_event(4322651556509354674, request),
1488 )
1489 }
1490 }
1491 }
1492}
1493
1494pub trait ComponentControllerClientHandler<
1498 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1499 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1500>
1501{
1502 #[doc = " Event for runners to publish diagnostics to the platform.\n\n This event signals to the platform that the runner for this\n component is publishing diagnostics about the runtime of the\n component. The component manager may optionally expose this data\n to clients.\n"]
1503 fn on_publish_diagnostics(
1504 &mut self,
1505
1506 event: ::fidl_next::Response<component_controller::OnPublishDiagnostics, ___T>,
1507 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1508
1509 #[doc = " Store some of the component\'s state in the framework, to be redelivered\n to the component the next time it\'s started (a practice called\n \"escrowing\").\n\n When the framework receives this event, it will wait until the current\n execution of the component has finished, then start the component again\n when the `ZX_CHANNEL_READABLE` signal is observed on `outgoing_dir`.\n\n Repeated calls will replace the old escrowed value. This is discouraged.\n\n Handles escrowed via `OnEscrow` are always delivered to the next\n execution of the component.\n"]
1510 fn on_escrow(
1511 &mut self,
1512
1513 event: ::fidl_next::Response<component_controller::OnEscrow, ___T>,
1514 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1515
1516 #[doc = " Report that the component has stopped, with data about its termination. This will\n cause the component to make a lifecycle transition to `Stopped`.\n\n Once the runner has sent `OnStop` it is free to close this [ComponentRunner]; the\n component framework will close its end of the channel when it receives this event.\n\n Alternatively, a runner may close the controller channel without this event to signal\n component stop, but this method is legacy and no longer recommended.\n"]
1517 fn on_stop(
1518 &mut self,
1519
1520 event: ::fidl_next::Response<component_controller::OnStop, ___T>,
1521 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1522
1523 fn on_unknown_interaction(
1524 &mut self,
1525 ordinal: u64,
1526 ) -> impl ::core::future::Future<
1527 Output = ::core::result::Result<
1528 (),
1529 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1530 >,
1531 > + ::core::marker::Send {
1532 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
1533 }
1534}
1535
1536impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentController
1537where
1538 ___H: ComponentControllerClientHandler<___T> + ::core::marker::Send,
1539 ___T: ::fidl_next::Transport,
1540 <component_controller::OnPublishDiagnostics as ::fidl_next::Method>::Response:
1541 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1542 <component_controller::OnEscrow as ::fidl_next::Method>::Response:
1543 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1544 <component_controller::OnStop as ::fidl_next::Method>::Response:
1545 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
1546{
1547 async fn on_event(
1548 handler: &mut ___H,
1549 ordinal: u64,
1550 buffer: ___T::RecvBuffer,
1551 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
1552 match ordinal {
1553 2240216199992207687 => match ::fidl_next::DecoderExt::decode(buffer) {
1554 Ok(decoded) => {
1555 handler.on_publish_diagnostics(decoded).await;
1556 Ok(())
1557 }
1558 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1559 ordinal: 2240216199992207687,
1560 error,
1561 }),
1562 },
1563
1564 730448769712342012 => match ::fidl_next::DecoderExt::decode(buffer) {
1565 Ok(decoded) => {
1566 handler.on_escrow(decoded).await;
1567 Ok(())
1568 }
1569 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1570 ordinal: 730448769712342012,
1571 error,
1572 }),
1573 },
1574
1575 4322651556509354674 => match ::fidl_next::DecoderExt::decode(buffer) {
1576 Ok(decoded) => {
1577 handler.on_stop(decoded).await;
1578 Ok(())
1579 }
1580 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
1581 ordinal: 4322651556509354674,
1582 error,
1583 }),
1584 },
1585
1586 ordinal => handler.on_unknown_interaction(ordinal).await,
1587 }
1588 }
1589}
1590
1591pub trait ComponentControllerServerHandler<
1595 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
1596 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
1597>
1598{
1599 #[doc = " Request to stop the component instance.\n\n After stopping the component instance, the server should close this\n connection with an epitaph. After the connection\n closes, component manager considers this component instance to be\n Stopped and the component\'s namespace will be torn down.\n"]
1600 fn stop(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1601
1602 #[doc = " Stop this component instance immediately.\n\n The ComponentRunner must immediately kill the component instance, and\n then close this connection with an epitaph. After the connection\n closes, component manager considers this component instance to be\n Stopped and the component\'s namespace will be torn down.\n\n In some cases Kill() may be issued before Stop(), but that is not\n guaranteed.\n"]
1603 fn kill(&mut self) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
1604
1605 fn on_unknown_interaction(
1606 &mut self,
1607 ordinal: u64,
1608 ) -> impl ::core::future::Future<
1609 Output = ::core::result::Result<
1610 (),
1611 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1612 >,
1613 > + ::core::marker::Send {
1614 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
1615 }
1616}
1617
1618impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentController
1619where
1620 ___H: ComponentControllerServerHandler<___T> + ::core::marker::Send,
1621 ___T: ::fidl_next::Transport,
1622{
1623 async fn on_one_way(
1624 handler: &mut ___H,
1625 ordinal: u64,
1626 buffer: ___T::RecvBuffer,
1627 ) -> ::core::result::Result<
1628 (),
1629 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1630 > {
1631 match ordinal {
1632 4804506821232171874 => {
1633 handler.stop().await;
1634 Ok(())
1635 }
1636
1637 4514346391631670964 => {
1638 handler.kill().await;
1639 Ok(())
1640 }
1641
1642 ordinal => handler.on_unknown_interaction(ordinal).await,
1643 }
1644 }
1645
1646 async fn on_two_way(
1647 handler: &mut ___H,
1648 ordinal: u64,
1649 buffer: ___T::RecvBuffer,
1650 responder: ::fidl_next::protocol::Responder<___T>,
1651 ) -> ::core::result::Result<
1652 (),
1653 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
1654 > {
1655 match ordinal {
1656 ordinal => handler.on_unknown_interaction(ordinal).await,
1657 }
1658 }
1659}
1660
1661#[doc = " A single component namespace entry, which describes a namespace mount point\n (`path`) and the directory backing it (`directory`). This type is usually\n composed inside a vector. See `ComponentStartInfo.ns` for more details.\n"]
1662#[derive(PartialEq, Debug, Default)]
1663pub struct ComponentNamespaceEntry {
1664 pub path: ::core::option::Option<::std::string::String>,
1665
1666 pub directory: ::core::option::Option<
1667 ::fidl_next::ClientEnd<
1668 ::fidl_next_fuchsia_io::Directory,
1669 ::fidl_next::fuchsia::zx::Channel,
1670 >,
1671 >,
1672}
1673
1674impl ComponentNamespaceEntry {
1675 fn __max_ordinal(&self) -> usize {
1676 if self.directory.is_some() {
1677 return 2;
1678 }
1679
1680 if self.path.is_some() {
1681 return 1;
1682 }
1683
1684 0
1685 }
1686}
1687
1688impl ::fidl_next::Encodable for ComponentNamespaceEntry {
1689 type Encoded = WireComponentNamespaceEntry<'static>;
1690}
1691
1692unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentNamespaceEntry
1693where
1694 ___E: ::fidl_next::Encoder + ?Sized,
1695 ___E: ::fidl_next::fuchsia::HandleEncoder,
1696{
1697 #[inline]
1698 fn encode(
1699 mut self,
1700 encoder: &mut ___E,
1701 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1702 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1703 ::fidl_next::munge!(let WireComponentNamespaceEntry { table } = out);
1704
1705 let max_ord = self.__max_ordinal();
1706
1707 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1708 ::fidl_next::Wire::zero_padding(&mut out);
1709
1710 let mut preallocated =
1711 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1712
1713 for i in 1..=max_ord {
1714 match i {
1715 2 => {
1716 if let Some(value) = self.directory.take() {
1717 ::fidl_next::WireEnvelope::encode_value(
1718 value,
1719 preallocated.encoder,
1720 &mut out,
1721 )?;
1722 } else {
1723 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1724 }
1725 }
1726
1727 1 => {
1728 if let Some(value) = self.path.take() {
1729 ::fidl_next::WireEnvelope::encode_value(
1730 value,
1731 preallocated.encoder,
1732 &mut out,
1733 )?;
1734 } else {
1735 ::fidl_next::WireEnvelope::encode_zero(&mut out)
1736 }
1737 }
1738
1739 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1740 }
1741 unsafe {
1742 preallocated.write_next(out.assume_init_ref());
1743 }
1744 }
1745
1746 ::fidl_next::WireTable::encode_len(table, max_ord);
1747
1748 Ok(())
1749 }
1750}
1751
1752impl<'de> ::fidl_next::FromWire<WireComponentNamespaceEntry<'de>> for ComponentNamespaceEntry {
1753 #[inline]
1754 fn from_wire(wire_: WireComponentNamespaceEntry<'de>) -> Self {
1755 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
1756
1757 let path = wire_.table.get(1);
1758
1759 let directory = wire_.table.get(2);
1760
1761 Self {
1762 path: path.map(|envelope| {
1763 ::fidl_next::FromWire::from_wire(unsafe {
1764 envelope.read_unchecked::<::fidl_next::WireString<'de>>()
1765 })
1766 }),
1767
1768 directory: directory.map(|envelope| {
1769 ::fidl_next::FromWire::from_wire(unsafe {
1770 envelope.read_unchecked::<::fidl_next::ClientEnd<
1771 ::fidl_next_fuchsia_io::Directory,
1772 ::fidl_next::fuchsia::WireChannel,
1773 >>()
1774 })
1775 }),
1776 }
1777 }
1778}
1779
1780impl<'de> ::fidl_next::IntoNatural for WireComponentNamespaceEntry<'de> {
1781 type Natural = ComponentNamespaceEntry;
1782}
1783
1784#[repr(C)]
1786pub struct WireComponentNamespaceEntry<'de> {
1787 table: ::fidl_next::WireTable<'de>,
1788}
1789
1790impl<'de> Drop for WireComponentNamespaceEntry<'de> {
1791 fn drop(&mut self) {
1792 let _ = self
1793 .table
1794 .get(1)
1795 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
1796
1797 let _ = self.table.get(2).map(|envelope| unsafe {
1798 envelope.read_unchecked::<::fidl_next::ClientEnd<
1799 ::fidl_next_fuchsia_io::Directory,
1800 ::fidl_next::fuchsia::WireChannel,
1801 >>()
1802 });
1803 }
1804}
1805
1806unsafe impl ::fidl_next::Wire for WireComponentNamespaceEntry<'static> {
1807 type Decoded<'de> = WireComponentNamespaceEntry<'de>;
1808
1809 #[inline]
1810 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1811 ::fidl_next::munge!(let Self { table } = out);
1812 ::fidl_next::WireTable::zero_padding(table);
1813 }
1814}
1815
1816unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentNamespaceEntry<'static>
1817where
1818 ___D: ::fidl_next::Decoder + ?Sized,
1819 ___D: ::fidl_next::fuchsia::HandleDecoder,
1820{
1821 fn decode(
1822 slot: ::fidl_next::Slot<'_, Self>,
1823 decoder: &mut ___D,
1824 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
1825 ::fidl_next::munge!(let Self { table } = slot);
1826
1827 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1828 match ordinal {
1829 0 => unsafe { ::core::hint::unreachable_unchecked() },
1830
1831 1 => {
1832 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
1833 slot.as_mut(),
1834 decoder,
1835 )?;
1836
1837 let value = unsafe {
1838 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
1839 };
1840
1841 if value.len() > 4095 {
1842 return Err(::fidl_next::DecodeError::VectorTooLong {
1843 size: value.len() as u64,
1844 limit: 4095,
1845 });
1846 }
1847
1848 Ok(())
1849 }
1850
1851 2 => {
1852 ::fidl_next::WireEnvelope::decode_as::<
1853 ___D,
1854 ::fidl_next::ClientEnd<
1855 ::fidl_next_fuchsia_io::Directory,
1856 ::fidl_next::fuchsia::WireChannel,
1857 >,
1858 >(slot.as_mut(), decoder)?;
1859
1860 Ok(())
1861 }
1862
1863 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1864 }
1865 })
1866 }
1867}
1868
1869impl<'de> WireComponentNamespaceEntry<'de> {
1870 pub fn path(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
1871 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1872 }
1873
1874 pub fn directory(
1875 &self,
1876 ) -> ::core::option::Option<
1877 &::fidl_next::ClientEnd<
1878 ::fidl_next_fuchsia_io::Directory,
1879 ::fidl_next::fuchsia::WireChannel,
1880 >,
1881 > {
1882 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1883 }
1884}
1885
1886impl<'de> ::core::fmt::Debug for WireComponentNamespaceEntry<'de> {
1887 fn fmt(
1888 &self,
1889 f: &mut ::core::fmt::Formatter<'_>,
1890 ) -> ::core::result::Result<(), ::core::fmt::Error> {
1891 f.debug_struct("ComponentNamespaceEntry")
1892 .field("path", &self.path())
1893 .field("directory", &self.directory())
1894 .finish()
1895 }
1896}
1897
1898pub const MAX_NAMESPACE_COUNT: u32 = 32 as u32;
1899
1900pub const MAX_HANDLE_COUNT: u32 = 128 as u32;
1901
1902#[doc = " Parameters for starting a new component instance.\n"]
1903#[derive(PartialEq, Debug, Default)]
1904pub struct ComponentStartInfo {
1905 pub resolved_url: ::core::option::Option<::std::string::String>,
1906
1907 pub program: ::core::option::Option<::fidl_next_fuchsia_data::Dictionary>,
1908
1909 pub ns: ::core::option::Option<::std::vec::Vec<crate::ComponentNamespaceEntry>>,
1910
1911 pub outgoing_dir: ::core::option::Option<
1912 ::fidl_next::ServerEnd<
1913 ::fidl_next_fuchsia_io::Directory,
1914 ::fidl_next::fuchsia::zx::Channel,
1915 >,
1916 >,
1917
1918 pub runtime_dir: ::core::option::Option<
1919 ::fidl_next::ServerEnd<
1920 ::fidl_next_fuchsia_io::Directory,
1921 ::fidl_next::fuchsia::zx::Channel,
1922 >,
1923 >,
1924
1925 pub numbered_handles:
1926 ::core::option::Option<::std::vec::Vec<::fidl_next_fuchsia_process::HandleInfo>>,
1927
1928 pub encoded_config: ::core::option::Option<::fidl_next_fuchsia_mem::Data>,
1929
1930 pub break_on_start: ::core::option::Option<::fidl_next::fuchsia::zx::EventPair>,
1931
1932 pub component_instance: ::core::option::Option<::fidl_next::fuchsia::zx::Event>,
1933
1934 pub escrowed_dictionary:
1935 ::core::option::Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
1936}
1937
1938impl ComponentStartInfo {
1939 fn __max_ordinal(&self) -> usize {
1940 if self.escrowed_dictionary.is_some() {
1941 return 10;
1942 }
1943
1944 if self.component_instance.is_some() {
1945 return 9;
1946 }
1947
1948 if self.break_on_start.is_some() {
1949 return 8;
1950 }
1951
1952 if self.encoded_config.is_some() {
1953 return 7;
1954 }
1955
1956 if self.numbered_handles.is_some() {
1957 return 6;
1958 }
1959
1960 if self.runtime_dir.is_some() {
1961 return 5;
1962 }
1963
1964 if self.outgoing_dir.is_some() {
1965 return 4;
1966 }
1967
1968 if self.ns.is_some() {
1969 return 3;
1970 }
1971
1972 if self.program.is_some() {
1973 return 2;
1974 }
1975
1976 if self.resolved_url.is_some() {
1977 return 1;
1978 }
1979
1980 0
1981 }
1982}
1983
1984impl ::fidl_next::Encodable for ComponentStartInfo {
1985 type Encoded = WireComponentStartInfo<'static>;
1986}
1987
1988unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentStartInfo
1989where
1990 ___E: ::fidl_next::Encoder + ?Sized,
1991 ___E: ::fidl_next::fuchsia::HandleEncoder,
1992{
1993 #[inline]
1994 fn encode(
1995 mut self,
1996 encoder: &mut ___E,
1997 out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1998 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
1999 ::fidl_next::munge!(let WireComponentStartInfo { table } = out);
2000
2001 let max_ord = self.__max_ordinal();
2002
2003 let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2004 ::fidl_next::Wire::zero_padding(&mut out);
2005
2006 let mut preallocated =
2007 ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2008
2009 for i in 1..=max_ord {
2010 match i {
2011 10 => {
2012 if let Some(value) = self.escrowed_dictionary.take() {
2013 ::fidl_next::WireEnvelope::encode_value(
2014 value,
2015 preallocated.encoder,
2016 &mut out,
2017 )?;
2018 } else {
2019 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2020 }
2021 }
2022
2023 9 => {
2024 if let Some(value) = self.component_instance.take() {
2025 ::fidl_next::WireEnvelope::encode_value(
2026 value,
2027 preallocated.encoder,
2028 &mut out,
2029 )?;
2030 } else {
2031 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2032 }
2033 }
2034
2035 8 => {
2036 if let Some(value) = self.break_on_start.take() {
2037 ::fidl_next::WireEnvelope::encode_value(
2038 value,
2039 preallocated.encoder,
2040 &mut out,
2041 )?;
2042 } else {
2043 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2044 }
2045 }
2046
2047 7 => {
2048 if let Some(value) = self.encoded_config.take() {
2049 ::fidl_next::WireEnvelope::encode_value(
2050 value,
2051 preallocated.encoder,
2052 &mut out,
2053 )?;
2054 } else {
2055 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2056 }
2057 }
2058
2059 6 => {
2060 if let Some(value) = self.numbered_handles.take() {
2061 ::fidl_next::WireEnvelope::encode_value(
2062 value,
2063 preallocated.encoder,
2064 &mut out,
2065 )?;
2066 } else {
2067 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2068 }
2069 }
2070
2071 5 => {
2072 if let Some(value) = self.runtime_dir.take() {
2073 ::fidl_next::WireEnvelope::encode_value(
2074 value,
2075 preallocated.encoder,
2076 &mut out,
2077 )?;
2078 } else {
2079 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2080 }
2081 }
2082
2083 4 => {
2084 if let Some(value) = self.outgoing_dir.take() {
2085 ::fidl_next::WireEnvelope::encode_value(
2086 value,
2087 preallocated.encoder,
2088 &mut out,
2089 )?;
2090 } else {
2091 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2092 }
2093 }
2094
2095 3 => {
2096 if let Some(value) = self.ns.take() {
2097 ::fidl_next::WireEnvelope::encode_value(
2098 value,
2099 preallocated.encoder,
2100 &mut out,
2101 )?;
2102 } else {
2103 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2104 }
2105 }
2106
2107 2 => {
2108 if let Some(value) = self.program.take() {
2109 ::fidl_next::WireEnvelope::encode_value(
2110 value,
2111 preallocated.encoder,
2112 &mut out,
2113 )?;
2114 } else {
2115 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2116 }
2117 }
2118
2119 1 => {
2120 if let Some(value) = self.resolved_url.take() {
2121 ::fidl_next::WireEnvelope::encode_value(
2122 value,
2123 preallocated.encoder,
2124 &mut out,
2125 )?;
2126 } else {
2127 ::fidl_next::WireEnvelope::encode_zero(&mut out)
2128 }
2129 }
2130
2131 _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2132 }
2133 unsafe {
2134 preallocated.write_next(out.assume_init_ref());
2135 }
2136 }
2137
2138 ::fidl_next::WireTable::encode_len(table, max_ord);
2139
2140 Ok(())
2141 }
2142}
2143
2144impl<'de> ::fidl_next::FromWire<WireComponentStartInfo<'de>> for ComponentStartInfo {
2145 #[inline]
2146 fn from_wire(wire_: WireComponentStartInfo<'de>) -> Self {
2147 let wire_ = ::core::mem::ManuallyDrop::new(wire_);
2148
2149 let resolved_url = wire_.table.get(1);
2150
2151 let program = wire_.table.get(2);
2152
2153 let ns = wire_.table.get(3);
2154
2155 let outgoing_dir = wire_.table.get(4);
2156
2157 let runtime_dir = wire_.table.get(5);
2158
2159 let numbered_handles = wire_.table.get(6);
2160
2161 let encoded_config = wire_.table.get(7);
2162
2163 let break_on_start = wire_.table.get(8);
2164
2165 let component_instance = wire_.table.get(9);
2166
2167 let escrowed_dictionary = wire_.table.get(10);
2168
2169 Self {
2170
2171
2172 resolved_url: resolved_url.map(|envelope| ::fidl_next::FromWire::from_wire(
2173 unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() }
2174 )),
2175
2176
2177 program: program.map(|envelope| ::fidl_next::FromWire::from_wire(
2178 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>() }
2179 )),
2180
2181
2182 ns: ns.map(|envelope| ::fidl_next::FromWire::from_wire(
2183 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireComponentNamespaceEntry<'de>>>() }
2184 )),
2185
2186
2187 outgoing_dir: outgoing_dir.map(|envelope| ::fidl_next::FromWire::from_wire(
2188 unsafe { envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next_fuchsia_io::Directory, ::fidl_next::fuchsia::WireChannel>>() }
2189 )),
2190
2191
2192 runtime_dir: runtime_dir.map(|envelope| ::fidl_next::FromWire::from_wire(
2193 unsafe { envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next_fuchsia_io::Directory, ::fidl_next::fuchsia::WireChannel>>() }
2194 )),
2195
2196
2197 numbered_handles: numbered_handles.map(|envelope| ::fidl_next::FromWire::from_wire(
2198 unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>>() }
2199 )),
2200
2201
2202 encoded_config: encoded_config.map(|envelope| ::fidl_next::FromWire::from_wire(
2203 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_mem::WireData<'de>>() }
2204 )),
2205
2206
2207 break_on_start: break_on_start.map(|envelope| ::fidl_next::FromWire::from_wire(
2208 unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireEventPair>() }
2209 )),
2210
2211
2212 component_instance: component_instance.map(|envelope| ::fidl_next::FromWire::from_wire(
2213 unsafe { envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>() }
2214 )),
2215
2216
2217 escrowed_dictionary: escrowed_dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
2218 unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>() }
2219 )),
2220
2221 }
2222 }
2223}
2224
2225impl<'de> ::fidl_next::IntoNatural for WireComponentStartInfo<'de> {
2226 type Natural = ComponentStartInfo;
2227}
2228
2229#[repr(C)]
2231pub struct WireComponentStartInfo<'de> {
2232 table: ::fidl_next::WireTable<'de>,
2233}
2234
2235impl<'de> Drop for WireComponentStartInfo<'de> {
2236 fn drop(&mut self) {
2237 let _ = self
2238 .table
2239 .get(1)
2240 .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
2241
2242 let _ = self.table.get(2).map(|envelope| unsafe {
2243 envelope.read_unchecked::<::fidl_next_fuchsia_data::WireDictionary<'de>>()
2244 });
2245
2246 let _ = self.table.get(3)
2247 .map(|envelope| unsafe {
2248 envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireComponentNamespaceEntry<'de>>>()
2249 });
2250
2251 let _ = self.table.get(4).map(|envelope| unsafe {
2252 envelope.read_unchecked::<::fidl_next::ServerEnd<
2253 ::fidl_next_fuchsia_io::Directory,
2254 ::fidl_next::fuchsia::WireChannel,
2255 >>()
2256 });
2257
2258 let _ = self.table.get(5).map(|envelope| unsafe {
2259 envelope.read_unchecked::<::fidl_next::ServerEnd<
2260 ::fidl_next_fuchsia_io::Directory,
2261 ::fidl_next::fuchsia::WireChannel,
2262 >>()
2263 });
2264
2265 let _ = self.table.get(6)
2266 .map(|envelope| unsafe {
2267 envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>>()
2268 });
2269
2270 let _ = self.table.get(7).map(|envelope| unsafe {
2271 envelope.read_unchecked::<::fidl_next_fuchsia_mem::WireData<'de>>()
2272 });
2273
2274 let _ = self.table.get(8).map(|envelope| unsafe {
2275 envelope.read_unchecked::<::fidl_next::fuchsia::WireEventPair>()
2276 });
2277
2278 let _ = self.table.get(9).map(|envelope| unsafe {
2279 envelope.read_unchecked::<::fidl_next::fuchsia::WireEvent>()
2280 });
2281
2282 let _ = self.table.get(10).map(|envelope| unsafe {
2283 envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>()
2284 });
2285 }
2286}
2287
2288unsafe impl ::fidl_next::Wire for WireComponentStartInfo<'static> {
2289 type Decoded<'de> = WireComponentStartInfo<'de>;
2290
2291 #[inline]
2292 fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2293 ::fidl_next::munge!(let Self { table } = out);
2294 ::fidl_next::WireTable::zero_padding(table);
2295 }
2296}
2297
2298unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentStartInfo<'static>
2299where
2300 ___D: ::fidl_next::Decoder + ?Sized,
2301 ___D: ::fidl_next::fuchsia::HandleDecoder,
2302{
2303 fn decode(
2304 slot: ::fidl_next::Slot<'_, Self>,
2305 decoder: &mut ___D,
2306 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2307 ::fidl_next::munge!(let Self { table } = slot);
2308
2309 ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2310 match ordinal {
2311 0 => unsafe { ::core::hint::unreachable_unchecked() },
2312
2313 1 => {
2314 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
2315 slot.as_mut(),
2316 decoder,
2317 )?;
2318
2319 let value = unsafe {
2320 slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
2321 };
2322
2323 if value.len() > 4096 {
2324 return Err(::fidl_next::DecodeError::VectorTooLong {
2325 size: value.len() as u64,
2326 limit: 4096,
2327 });
2328 }
2329
2330 Ok(())
2331 }
2332
2333 2 => {
2334 ::fidl_next::WireEnvelope::decode_as::<
2335 ___D,
2336 ::fidl_next_fuchsia_data::WireDictionary<'static>,
2337 >(slot.as_mut(), decoder)?;
2338
2339 Ok(())
2340 }
2341
2342 3 => {
2343 ::fidl_next::WireEnvelope::decode_as::<
2344 ___D,
2345 ::fidl_next::WireVector<
2346 'static,
2347 crate::WireComponentNamespaceEntry<'static>,
2348 >,
2349 >(slot.as_mut(), decoder)?;
2350
2351 let value = unsafe {
2352 slot
2353 .deref_unchecked()
2354 .deref_unchecked::<
2355 ::fidl_next::WireVector<'_, crate::WireComponentNamespaceEntry<'_>>
2356 >()
2357 };
2358
2359 if value.len() > 32 {
2360 return Err(::fidl_next::DecodeError::VectorTooLong {
2361 size: value.len() as u64,
2362 limit: 32,
2363 });
2364 }
2365
2366 Ok(())
2367 }
2368
2369 4 => {
2370 ::fidl_next::WireEnvelope::decode_as::<
2371 ___D,
2372 ::fidl_next::ServerEnd<
2373 ::fidl_next_fuchsia_io::Directory,
2374 ::fidl_next::fuchsia::WireChannel,
2375 >,
2376 >(slot.as_mut(), decoder)?;
2377
2378 Ok(())
2379 }
2380
2381 5 => {
2382 ::fidl_next::WireEnvelope::decode_as::<
2383 ___D,
2384 ::fidl_next::ServerEnd<
2385 ::fidl_next_fuchsia_io::Directory,
2386 ::fidl_next::fuchsia::WireChannel,
2387 >,
2388 >(slot.as_mut(), decoder)?;
2389
2390 Ok(())
2391 }
2392
2393 6 => {
2394 ::fidl_next::WireEnvelope::decode_as::<
2395 ___D,
2396 ::fidl_next::WireVector<
2397 'static,
2398 ::fidl_next_fuchsia_process::WireHandleInfo,
2399 >,
2400 >(slot.as_mut(), decoder)?;
2401
2402 let value = unsafe {
2403 slot
2404 .deref_unchecked()
2405 .deref_unchecked::<
2406 ::fidl_next::WireVector<'_, ::fidl_next_fuchsia_process::WireHandleInfo>
2407 >()
2408 };
2409
2410 if value.len() > 128 {
2411 return Err(::fidl_next::DecodeError::VectorTooLong {
2412 size: value.len() as u64,
2413 limit: 128,
2414 });
2415 }
2416
2417 Ok(())
2418 }
2419
2420 7 => {
2421 ::fidl_next::WireEnvelope::decode_as::<
2422 ___D,
2423 ::fidl_next_fuchsia_mem::WireData<'static>,
2424 >(slot.as_mut(), decoder)?;
2425
2426 Ok(())
2427 }
2428
2429 8 => {
2430 ::fidl_next::WireEnvelope::decode_as::<
2431 ___D,
2432 ::fidl_next::fuchsia::WireEventPair,
2433 >(slot.as_mut(), decoder)?;
2434
2435 Ok(())
2436 }
2437
2438 9 => {
2439 ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireEvent>(
2440 slot.as_mut(),
2441 decoder,
2442 )?;
2443
2444 Ok(())
2445 }
2446
2447 10 => {
2448 ::fidl_next::WireEnvelope::decode_as::<
2449 ___D,
2450 ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
2451 >(slot.as_mut(), decoder)?;
2452
2453 Ok(())
2454 }
2455
2456 _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2457 }
2458 })
2459 }
2460}
2461
2462impl<'de> WireComponentStartInfo<'de> {
2463 pub fn resolved_url(&self) -> ::core::option::Option<&::fidl_next::WireString<'de>> {
2464 unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2465 }
2466
2467 pub fn program(
2468 &self,
2469 ) -> ::core::option::Option<&::fidl_next_fuchsia_data::WireDictionary<'de>> {
2470 unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2471 }
2472
2473 pub fn ns(
2474 &self,
2475 ) -> ::core::option::Option<
2476 &::fidl_next::WireVector<'de, crate::WireComponentNamespaceEntry<'de>>,
2477 > {
2478 unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2479 }
2480
2481 pub fn outgoing_dir(
2482 &self,
2483 ) -> ::core::option::Option<
2484 &::fidl_next::ServerEnd<
2485 ::fidl_next_fuchsia_io::Directory,
2486 ::fidl_next::fuchsia::WireChannel,
2487 >,
2488 > {
2489 unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2490 }
2491
2492 pub fn runtime_dir(
2493 &self,
2494 ) -> ::core::option::Option<
2495 &::fidl_next::ServerEnd<
2496 ::fidl_next_fuchsia_io::Directory,
2497 ::fidl_next::fuchsia::WireChannel,
2498 >,
2499 > {
2500 unsafe { Some(self.table.get(5)?.deref_unchecked()) }
2501 }
2502
2503 pub fn numbered_handles(
2504 &self,
2505 ) -> ::core::option::Option<
2506 &::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>,
2507 > {
2508 unsafe { Some(self.table.get(6)?.deref_unchecked()) }
2509 }
2510
2511 pub fn encoded_config(
2512 &self,
2513 ) -> ::core::option::Option<&::fidl_next_fuchsia_mem::WireData<'de>> {
2514 unsafe { Some(self.table.get(7)?.deref_unchecked()) }
2515 }
2516
2517 pub fn break_on_start(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireEventPair> {
2518 unsafe { Some(self.table.get(8)?.deref_unchecked()) }
2519 }
2520
2521 pub fn component_instance(&self) -> ::core::option::Option<&::fidl_next::fuchsia::WireEvent> {
2522 unsafe { Some(self.table.get(9)?.deref_unchecked()) }
2523 }
2524
2525 pub fn escrowed_dictionary(
2526 &self,
2527 ) -> ::core::option::Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
2528 unsafe { Some(self.table.get(10)?.deref_unchecked()) }
2529 }
2530}
2531
2532impl<'de> ::core::fmt::Debug for WireComponentStartInfo<'de> {
2533 fn fmt(
2534 &self,
2535 f: &mut ::core::fmt::Formatter<'_>,
2536 ) -> ::core::result::Result<(), ::core::fmt::Error> {
2537 f.debug_struct("ComponentStartInfo")
2538 .field("resolved_url", &self.resolved_url())
2539 .field("program", &self.program())
2540 .field("ns", &self.ns())
2541 .field("outgoing_dir", &self.outgoing_dir())
2542 .field("runtime_dir", &self.runtime_dir())
2543 .field("numbered_handles", &self.numbered_handles())
2544 .field("encoded_config", &self.encoded_config())
2545 .field("break_on_start", &self.break_on_start())
2546 .field("component_instance", &self.component_instance())
2547 .field("escrowed_dictionary", &self.escrowed_dictionary())
2548 .finish()
2549 }
2550}
2551
2552#[derive(PartialEq, Debug)]
2553pub struct ComponentRunnerStartRequest {
2554 pub start_info: crate::ComponentStartInfo,
2555
2556 pub controller:
2557 ::fidl_next::ServerEnd<crate::ComponentController, ::fidl_next::fuchsia::zx::Channel>,
2558}
2559
2560impl ::fidl_next::Encodable for ComponentRunnerStartRequest {
2561 type Encoded = WireComponentRunnerStartRequest<'static>;
2562}
2563
2564unsafe impl<___E> ::fidl_next::Encode<___E> for ComponentRunnerStartRequest
2565where
2566 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2567 ___E: ::fidl_next::Encoder,
2568 ___E: ::fidl_next::fuchsia::HandleEncoder,
2569{
2570 #[inline]
2571 fn encode(
2572 self,
2573 encoder_: &mut ___E,
2574 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2575 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2576 ::fidl_next::munge! {
2577 let Self::Encoded {
2578 start_info,
2579 controller,
2580
2581 } = out_;
2582 }
2583
2584 ::fidl_next::Encode::encode(self.start_info, encoder_, start_info)?;
2585
2586 ::fidl_next::Encode::encode(self.controller, encoder_, controller)?;
2587
2588 Ok(())
2589 }
2590}
2591
2592impl ::fidl_next::EncodableOption for ComponentRunnerStartRequest {
2593 type EncodedOption = ::fidl_next::WireBox<'static, WireComponentRunnerStartRequest<'static>>;
2594}
2595
2596unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ComponentRunnerStartRequest
2597where
2598 ___E: ::fidl_next::Encoder + ?Sized,
2599 ComponentRunnerStartRequest: ::fidl_next::Encode<___E>,
2600{
2601 #[inline]
2602 fn encode_option(
2603 this: ::core::option::Option<Self>,
2604 encoder: &mut ___E,
2605 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
2606 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2607 if let Some(inner) = this {
2608 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
2609 ::fidl_next::WireBox::encode_present(out);
2610 } else {
2611 ::fidl_next::WireBox::encode_absent(out);
2612 }
2613
2614 Ok(())
2615 }
2616}
2617
2618impl<'de> ::fidl_next::FromWire<WireComponentRunnerStartRequest<'de>>
2619 for ComponentRunnerStartRequest
2620{
2621 #[inline]
2622 fn from_wire(wire: WireComponentRunnerStartRequest<'de>) -> Self {
2623 Self {
2624 start_info: ::fidl_next::FromWire::from_wire(wire.start_info),
2625
2626 controller: ::fidl_next::FromWire::from_wire(wire.controller),
2627 }
2628 }
2629}
2630
2631impl<'de> ::fidl_next::IntoNatural for WireComponentRunnerStartRequest<'de> {
2632 type Natural = ComponentRunnerStartRequest;
2633}
2634
2635#[derive(Debug)]
2637#[repr(C)]
2638pub struct WireComponentRunnerStartRequest<'de> {
2639 pub start_info: crate::WireComponentStartInfo<'de>,
2640
2641 pub controller:
2642 ::fidl_next::ServerEnd<crate::ComponentController, ::fidl_next::fuchsia::WireChannel>,
2643}
2644static_assertions::const_assert_eq!(std::mem::size_of::<WireComponentRunnerStartRequest<'_>>(), 24);
2645static_assertions::const_assert_eq!(std::mem::align_of::<WireComponentRunnerStartRequest<'_>>(), 8);
2646
2647static_assertions::const_assert_eq!(
2648 std::mem::offset_of!(WireComponentRunnerStartRequest<'_>, start_info),
2649 0
2650);
2651
2652static_assertions::const_assert_eq!(
2653 std::mem::offset_of!(WireComponentRunnerStartRequest<'_>, controller),
2654 16
2655);
2656
2657unsafe impl ::fidl_next::Wire for WireComponentRunnerStartRequest<'static> {
2658 type Decoded<'de> = WireComponentRunnerStartRequest<'de>;
2659
2660 #[inline]
2661 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
2662 ::fidl_next::munge! {
2663 let Self {
2664
2665 start_info,
2666 controller,
2667
2668 } = &mut *out_;
2669 }
2670
2671 ::fidl_next::Wire::zero_padding(start_info);
2672
2673 ::fidl_next::Wire::zero_padding(controller);
2674
2675 unsafe {
2676 out_.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
2677 }
2678 }
2679}
2680
2681unsafe impl<___D> ::fidl_next::Decode<___D> for WireComponentRunnerStartRequest<'static>
2682where
2683 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
2684 ___D: ::fidl_next::Decoder,
2685 ___D: ::fidl_next::fuchsia::HandleDecoder,
2686{
2687 fn decode(
2688 slot_: ::fidl_next::Slot<'_, Self>,
2689 decoder_: &mut ___D,
2690 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
2691 ::fidl_next::munge! {
2692 let Self {
2693
2694 mut start_info,
2695 mut controller,
2696
2697 } = slot_;
2698 }
2699
2700 ::fidl_next::Decode::decode(start_info.as_mut(), decoder_)?;
2701
2702 ::fidl_next::Decode::decode(controller.as_mut(), decoder_)?;
2703
2704 Ok(())
2705 }
2706}
2707
2708#[doc = " A protocol used for running components.\n\n This protocol is implemented by components which provide a runtime\n environment for other components.\n\n Note: The component manager is the only intended direct client of this\n interface.\n"]
2710#[derive(PartialEq, Debug)]
2711pub struct ComponentRunner;
2712
2713impl ::fidl_next::Discoverable for ComponentRunner {
2714 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.ComponentRunner";
2715}
2716
2717pub mod component_runner {
2718 pub mod prelude {
2719 pub use crate::{
2720 ComponentRunner, ComponentRunnerClientHandler, ComponentRunnerServerHandler,
2721 component_runner,
2722 };
2723
2724 pub use crate::ComponentRunnerStartRequest;
2725 }
2726
2727 pub struct Start;
2728
2729 impl ::fidl_next::Method for Start {
2730 const ORDINAL: u64 = 780715659970866697;
2731
2732 type Protocol = crate::ComponentRunner;
2733
2734 type Request = crate::WireComponentRunnerStartRequest<'static>;
2735
2736 type Response = ::fidl_next::Never;
2737 }
2738
2739 mod ___detail {
2740
2741 pub struct Start<T0, T1> {
2742 start_info: T0,
2743
2744 controller: T1,
2745 }
2746
2747 impl<T0, T1> ::fidl_next::Encodable for Start<T0, T1>
2748 where
2749 T0: ::fidl_next::Encodable<Encoded = crate::WireComponentStartInfo<'static>>,
2750 T1: ::fidl_next::Encodable<
2751 Encoded = ::fidl_next::ServerEnd<
2752 crate::ComponentController,
2753 ::fidl_next::fuchsia::WireChannel,
2754 >,
2755 >,
2756 {
2757 type Encoded = crate::WireComponentRunnerStartRequest<'static>;
2758 }
2759
2760 unsafe impl<___E, T0, T1> ::fidl_next::Encode<___E> for Start<T0, T1>
2761 where
2762 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2763 ___E: ::fidl_next::Encoder,
2764 ___E: ::fidl_next::fuchsia::HandleEncoder,
2765 T0: ::fidl_next::Encode<___E, Encoded = crate::WireComponentStartInfo<'static>>,
2766 T1: ::fidl_next::Encode<
2767 ___E,
2768 Encoded = ::fidl_next::ServerEnd<
2769 crate::ComponentController,
2770 ::fidl_next::fuchsia::WireChannel,
2771 >,
2772 >,
2773 {
2774 #[inline]
2775 fn encode(
2776 self,
2777 encoder_: &mut ___E,
2778 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2779 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
2780 ::fidl_next::munge! {
2781 let Self::Encoded {
2782 start_info,
2783 controller,
2784
2785 } = out_;
2786 }
2787
2788 ::fidl_next::Encode::encode(self.start_info, encoder_, start_info)?;
2789
2790 ::fidl_next::Encode::encode(self.controller, encoder_, controller)?;
2791
2792 Ok(())
2793 }
2794 }
2795
2796 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::ComponentRunner
2797 where
2798 ___T: ::fidl_next::Transport,
2799 {
2800 type Client = ComponentRunnerClient<___T>;
2801 type Server = ComponentRunnerServer<___T>;
2802 }
2803
2804 #[repr(transparent)]
2806 pub struct ComponentRunnerClient<___T: ::fidl_next::Transport> {
2807 #[allow(dead_code)]
2808 client: ::fidl_next::protocol::Client<___T>,
2809 }
2810
2811 impl<___T> ComponentRunnerClient<___T>
2812 where
2813 ___T: ::fidl_next::Transport,
2814 {
2815 #[doc = " Start running a component instance described by `start_info`.\n\n Component manager binds and uses `controller` to control the\n lifetime of the newly started component instance.\n\n Errors are delivered as epitaphs over the `ComponentController`\n protocol. In the event of an error, the runner must ensure that\n resources are cleaned up.\n"]
2816 pub fn start(
2817 &self,
2818
2819 start_info: impl ::fidl_next::Encode<
2820 <___T as ::fidl_next::Transport>::SendBuffer,
2821 Encoded = crate::WireComponentStartInfo<'static>,
2822 >,
2823
2824 controller: impl ::fidl_next::Encode<
2825 <___T as ::fidl_next::Transport>::SendBuffer,
2826 Encoded = ::fidl_next::ServerEnd<
2827 crate::ComponentController,
2828 ::fidl_next::fuchsia::WireChannel,
2829 >,
2830 >,
2831 ) -> ::fidl_next::SendFuture<'_, ___T>
2832 where
2833 <___T as ::fidl_next::Transport>::SendBuffer:
2834 ::fidl_next::encoder::InternalHandleEncoder,
2835 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::Encoder,
2836 <___T as ::fidl_next::Transport>::SendBuffer: ::fidl_next::fuchsia::HandleEncoder,
2837 {
2838 self.start_with(Start { start_info, controller })
2839 }
2840
2841 #[doc = " Start running a component instance described by `start_info`.\n\n Component manager binds and uses `controller` to control the\n lifetime of the newly started component instance.\n\n Errors are delivered as epitaphs over the `ComponentController`\n protocol. In the event of an error, the runner must ensure that\n resources are cleaned up.\n"]
2842 pub fn start_with<___R>(&self, request: ___R) -> ::fidl_next::SendFuture<'_, ___T>
2843 where
2844 ___R: ::fidl_next::Encode<
2845 <___T as ::fidl_next::Transport>::SendBuffer,
2846 Encoded = crate::WireComponentRunnerStartRequest<'static>,
2847 >,
2848 {
2849 ::fidl_next::SendFuture::from_untyped(
2850 self.client.send_one_way(780715659970866697, request),
2851 )
2852 }
2853 }
2854
2855 #[repr(transparent)]
2857 pub struct ComponentRunnerServer<___T: ::fidl_next::Transport> {
2858 server: ::fidl_next::protocol::Server<___T>,
2859 }
2860
2861 impl<___T> ComponentRunnerServer<___T> where ___T: ::fidl_next::Transport {}
2862 }
2863}
2864
2865pub trait ComponentRunnerClientHandler<
2869 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
2870 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2871>
2872{
2873 fn on_unknown_interaction(
2874 &mut self,
2875 ordinal: u64,
2876 ) -> impl ::core::future::Future<
2877 Output = ::core::result::Result<
2878 (),
2879 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2880 >,
2881 > + ::core::marker::Send {
2882 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
2883 }
2884}
2885
2886impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for ComponentRunner
2887where
2888 ___H: ComponentRunnerClientHandler<___T> + ::core::marker::Send,
2889 ___T: ::fidl_next::Transport,
2890{
2891 async fn on_event(
2892 handler: &mut ___H,
2893 ordinal: u64,
2894 buffer: ___T::RecvBuffer,
2895 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
2896 match ordinal {
2897 ordinal => handler.on_unknown_interaction(ordinal).await,
2898 }
2899 }
2900}
2901
2902pub trait ComponentRunnerServerHandler<
2906 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
2907 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
2908>
2909{
2910 #[doc = " Start running a component instance described by `start_info`.\n\n Component manager binds and uses `controller` to control the\n lifetime of the newly started component instance.\n\n Errors are delivered as epitaphs over the `ComponentController`\n protocol. In the event of an error, the runner must ensure that\n resources are cleaned up.\n"]
2911 fn start(
2912 &mut self,
2913
2914 request: ::fidl_next::Request<component_runner::Start, ___T>,
2915 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
2916
2917 fn on_unknown_interaction(
2918 &mut self,
2919 ordinal: u64,
2920 ) -> impl ::core::future::Future<
2921 Output = ::core::result::Result<
2922 (),
2923 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2924 >,
2925 > + ::core::marker::Send {
2926 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
2927 }
2928}
2929
2930impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for ComponentRunner
2931where
2932 ___H: ComponentRunnerServerHandler<___T> + ::core::marker::Send,
2933 ___T: ::fidl_next::Transport,
2934 <component_runner::Start as ::fidl_next::Method>::Request:
2935 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2936{
2937 async fn on_one_way(
2938 handler: &mut ___H,
2939 ordinal: u64,
2940 buffer: ___T::RecvBuffer,
2941 ) -> ::core::result::Result<
2942 (),
2943 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2944 > {
2945 match ordinal {
2946 780715659970866697 => match ::fidl_next::DecoderExt::decode(buffer) {
2947 Ok(decoded) => {
2948 handler.start(decoded).await;
2949 Ok(())
2950 }
2951 Err(error) => Err(::fidl_next::ProtocolError::InvalidMessage {
2952 ordinal: 780715659970866697,
2953 error,
2954 }),
2955 },
2956
2957 ordinal => handler.on_unknown_interaction(ordinal).await,
2958 }
2959 }
2960
2961 async fn on_two_way(
2962 handler: &mut ___H,
2963 ordinal: u64,
2964 buffer: ___T::RecvBuffer,
2965 responder: ::fidl_next::protocol::Responder<___T>,
2966 ) -> ::core::result::Result<
2967 (),
2968 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
2969 > {
2970 match ordinal {
2971 ordinal => handler.on_unknown_interaction(ordinal).await,
2972 }
2973 }
2974}
2975
2976#[derive(PartialEq, Debug)]
2977#[repr(C)]
2978pub struct TaskProviderGetJobResponse {
2979 pub job: ::fidl_next::fuchsia::zx::Job,
2980}
2981
2982impl ::fidl_next::Encodable for TaskProviderGetJobResponse {
2983 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireTaskProviderGetJobResponse> = unsafe {
2984 ::fidl_next::CopyOptimization::enable_if(
2985 true && <::fidl_next::fuchsia::zx::Job as ::fidl_next::Encodable>::COPY_OPTIMIZATION
2986 .is_enabled(),
2987 )
2988 };
2989
2990 type Encoded = WireTaskProviderGetJobResponse;
2991}
2992
2993unsafe impl<___E> ::fidl_next::Encode<___E> for TaskProviderGetJobResponse
2994where
2995 ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
2996 ___E: ::fidl_next::fuchsia::HandleEncoder,
2997{
2998 #[inline]
2999 fn encode(
3000 self,
3001 encoder_: &mut ___E,
3002 out_: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3003 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3004 ::fidl_next::munge! {
3005 let Self::Encoded {
3006 job,
3007
3008 } = out_;
3009 }
3010
3011 ::fidl_next::Encode::encode(self.job, encoder_, job)?;
3012
3013 Ok(())
3014 }
3015}
3016
3017impl ::fidl_next::EncodableOption for TaskProviderGetJobResponse {
3018 type EncodedOption = ::fidl_next::WireBox<'static, WireTaskProviderGetJobResponse>;
3019}
3020
3021unsafe impl<___E> ::fidl_next::EncodeOption<___E> for TaskProviderGetJobResponse
3022where
3023 ___E: ::fidl_next::Encoder + ?Sized,
3024 TaskProviderGetJobResponse: ::fidl_next::Encode<___E>,
3025{
3026 #[inline]
3027 fn encode_option(
3028 this: ::core::option::Option<Self>,
3029 encoder: &mut ___E,
3030 out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
3031 ) -> ::core::result::Result<(), ::fidl_next::EncodeError> {
3032 if let Some(inner) = this {
3033 ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
3034 ::fidl_next::WireBox::encode_present(out);
3035 } else {
3036 ::fidl_next::WireBox::encode_absent(out);
3037 }
3038
3039 Ok(())
3040 }
3041}
3042
3043impl ::fidl_next::FromWire<WireTaskProviderGetJobResponse> for TaskProviderGetJobResponse {
3044 const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireTaskProviderGetJobResponse, Self> = unsafe {
3045 ::fidl_next::CopyOptimization::enable_if(
3046 true && <::fidl_next::fuchsia::zx::Job as ::fidl_next::FromWire<
3047 ::fidl_next::fuchsia::WireJob,
3048 >>::COPY_OPTIMIZATION
3049 .is_enabled(),
3050 )
3051 };
3052
3053 #[inline]
3054 fn from_wire(wire: WireTaskProviderGetJobResponse) -> Self {
3055 Self { job: ::fidl_next::FromWire::from_wire(wire.job) }
3056 }
3057}
3058
3059impl ::fidl_next::IntoNatural for WireTaskProviderGetJobResponse {
3060 type Natural = TaskProviderGetJobResponse;
3061}
3062
3063#[derive(Debug)]
3065#[repr(C)]
3066pub struct WireTaskProviderGetJobResponse {
3067 pub job: ::fidl_next::fuchsia::WireJob,
3068}
3069static_assertions::const_assert_eq!(std::mem::size_of::<WireTaskProviderGetJobResponse>(), 4);
3070static_assertions::const_assert_eq!(std::mem::align_of::<WireTaskProviderGetJobResponse>(), 4);
3071
3072static_assertions::const_assert_eq!(std::mem::offset_of!(WireTaskProviderGetJobResponse, job), 0);
3073
3074unsafe impl ::fidl_next::Wire for WireTaskProviderGetJobResponse {
3075 type Decoded<'de> = WireTaskProviderGetJobResponse;
3076
3077 #[inline]
3078 fn zero_padding(out_: &mut ::core::mem::MaybeUninit<Self>) {
3079 ::fidl_next::munge! {
3080 let Self {
3081
3082 job,
3083
3084 } = &mut *out_;
3085 }
3086
3087 ::fidl_next::Wire::zero_padding(job);
3088 }
3089}
3090
3091unsafe impl<___D> ::fidl_next::Decode<___D> for WireTaskProviderGetJobResponse
3092where
3093 ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
3094 ___D: ::fidl_next::fuchsia::HandleDecoder,
3095{
3096 fn decode(
3097 slot_: ::fidl_next::Slot<'_, Self>,
3098 decoder_: &mut ___D,
3099 ) -> ::core::result::Result<(), ::fidl_next::DecodeError> {
3100 ::fidl_next::munge! {
3101 let Self {
3102
3103 mut job,
3104
3105 } = slot_;
3106 }
3107
3108 ::fidl_next::Decode::decode(job.as_mut(), decoder_)?;
3109
3110 Ok(())
3111 }
3112}
3113
3114#[doc = " Served by runners that want to make a zircon job available through their runtime directory.\n"]
3116#[derive(PartialEq, Debug)]
3117pub struct TaskProvider;
3118
3119impl ::fidl_next::Discoverable for TaskProvider {
3120 const PROTOCOL_NAME: &'static str = "fuchsia.component.runner.TaskProvider";
3121}
3122
3123pub mod task_provider {
3124 pub mod prelude {
3125 pub use crate::{
3126 TaskProvider, TaskProviderClientHandler, TaskProviderServerHandler, task_provider,
3127 };
3128
3129 pub use crate::TaskProviderGetJobResponse;
3130 }
3131
3132 pub struct GetJob;
3133
3134 impl ::fidl_next::Method for GetJob {
3135 const ORDINAL: u64 = 5520468615388521389;
3136
3137 type Protocol = crate::TaskProvider;
3138
3139 type Request = ();
3140
3141 type Response = ::fidl_next::WireResult<
3142 'static,
3143 crate::WireTaskProviderGetJobResponse,
3144 ::fidl_next::WireI32,
3145 >;
3146 }
3147
3148 mod ___detail {
3149
3150 unsafe impl<___T> ::fidl_next::Protocol<___T> for crate::TaskProvider
3151 where
3152 ___T: ::fidl_next::Transport,
3153 {
3154 type Client = TaskProviderClient<___T>;
3155 type Server = TaskProviderServer<___T>;
3156 }
3157
3158 #[repr(transparent)]
3160 pub struct TaskProviderClient<___T: ::fidl_next::Transport> {
3161 #[allow(dead_code)]
3162 client: ::fidl_next::protocol::Client<___T>,
3163 }
3164
3165 impl<___T> TaskProviderClient<___T>
3166 where
3167 ___T: ::fidl_next::Transport,
3168 {
3169 #[doc = " Returns a job handle for the component requested.\n\n On success, returns a handle with the same rights as the runner\'s.\n"]
3170 pub fn get_job(&self) -> ::fidl_next::TwoWayFuture<'_, super::GetJob, ___T> {
3171 ::fidl_next::TwoWayFuture::from_untyped(
3172 self.client.send_two_way(5520468615388521389, ()),
3173 )
3174 }
3175 }
3176
3177 #[repr(transparent)]
3179 pub struct TaskProviderServer<___T: ::fidl_next::Transport> {
3180 server: ::fidl_next::protocol::Server<___T>,
3181 }
3182
3183 impl<___T> TaskProviderServer<___T> where ___T: ::fidl_next::Transport {}
3184 }
3185}
3186
3187pub trait TaskProviderClientHandler<
3191 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
3192 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3193>
3194{
3195 fn on_unknown_interaction(
3196 &mut self,
3197 ordinal: u64,
3198 ) -> impl ::core::future::Future<
3199 Output = ::core::result::Result<
3200 (),
3201 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3202 >,
3203 > + ::core::marker::Send {
3204 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
3205 }
3206}
3207
3208impl<___H, ___T> ::fidl_next::DispatchClientMessage<___H, ___T> for TaskProvider
3209where
3210 ___H: TaskProviderClientHandler<___T> + ::core::marker::Send,
3211 ___T: ::fidl_next::Transport,
3212 <task_provider::GetJob as ::fidl_next::Method>::Response:
3213 ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
3214{
3215 async fn on_event(
3216 handler: &mut ___H,
3217 ordinal: u64,
3218 buffer: ___T::RecvBuffer,
3219 ) -> ::core::result::Result<(), ::fidl_next::ProtocolError<___T::Error>> {
3220 match ordinal {
3221 ordinal => handler.on_unknown_interaction(ordinal).await,
3222 }
3223 }
3224}
3225
3226pub trait TaskProviderServerHandler<
3230 #[cfg(not(feature = "fuchsia"))] ___T: ::fidl_next::Transport,
3231 #[cfg(feature = "fuchsia")] ___T: ::fidl_next::Transport = ::fidl_next::fuchsia::zx::Channel,
3232>
3233{
3234 #[doc = " Returns a job handle for the component requested.\n\n On success, returns a handle with the same rights as the runner\'s.\n"]
3235 fn get_job(
3236 &mut self,
3237
3238 responder: ::fidl_next::Responder<task_provider::GetJob, ___T>,
3239 ) -> impl ::core::future::Future<Output = ()> + ::core::marker::Send;
3240
3241 fn on_unknown_interaction(
3242 &mut self,
3243 ordinal: u64,
3244 ) -> impl ::core::future::Future<
3245 Output = ::core::result::Result<
3246 (),
3247 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3248 >,
3249 > + ::core::marker::Send {
3250 ::core::future::ready(Err(::fidl_next::ProtocolError::InvalidOrdinal(ordinal)))
3251 }
3252}
3253
3254impl<___H, ___T> ::fidl_next::DispatchServerMessage<___H, ___T> for TaskProvider
3255where
3256 ___H: TaskProviderServerHandler<___T> + ::core::marker::Send,
3257 ___T: ::fidl_next::Transport,
3258{
3259 async fn on_one_way(
3260 handler: &mut ___H,
3261 ordinal: u64,
3262 buffer: ___T::RecvBuffer,
3263 ) -> ::core::result::Result<
3264 (),
3265 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3266 > {
3267 match ordinal {
3268 ordinal => handler.on_unknown_interaction(ordinal).await,
3269 }
3270 }
3271
3272 async fn on_two_way(
3273 handler: &mut ___H,
3274 ordinal: u64,
3275 buffer: ___T::RecvBuffer,
3276 responder: ::fidl_next::protocol::Responder<___T>,
3277 ) -> ::core::result::Result<
3278 (),
3279 ::fidl_next::ProtocolError<<___T as ::fidl_next::Transport>::Error>,
3280 > {
3281 match ordinal {
3282 5520468615388521389 => {
3283 let responder = ::fidl_next::Responder::from_untyped(responder);
3284
3285 handler.get_job(responder).await;
3286 Ok(())
3287 }
3288
3289 ordinal => handler.on_unknown_interaction(ordinal).await,
3290 }
3291 }
3292}
3293
3294pub mod compat {
3296
3297 impl ::fidl_next::CompatFrom<crate::Task> for ::fidl_fuchsia_component_runner::Task {
3298 fn compat_from(value: crate::Task) -> Self {
3299 match value {
3300 crate::Task::Job(value) => Self::Job(::fidl_next::CompatFrom::compat_from(value)),
3301
3302 crate::Task::Process(value) => {
3303 Self::Process(::fidl_next::CompatFrom::compat_from(value))
3304 }
3305
3306 crate::Task::Thread(value) => {
3307 Self::Thread(::fidl_next::CompatFrom::compat_from(value))
3308 }
3309
3310 crate::Task::UnknownOrdinal_(unknown_ordinal) => {
3311 Self::__SourceBreaking { unknown_ordinal }
3312 }
3313 }
3314 }
3315 }
3316
3317 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::Task> for crate::Task {
3318 fn compat_from(value: ::fidl_fuchsia_component_runner::Task) -> Self {
3319 match value {
3320 ::fidl_fuchsia_component_runner::Task::Job(value) => {
3321 Self::Job(::fidl_next::CompatFrom::compat_from(value))
3322 }
3323
3324 ::fidl_fuchsia_component_runner::Task::Process(value) => {
3325 Self::Process(::fidl_next::CompatFrom::compat_from(value))
3326 }
3327
3328 ::fidl_fuchsia_component_runner::Task::Thread(value) => {
3329 Self::Thread(::fidl_next::CompatFrom::compat_from(value))
3330 }
3331
3332 ::fidl_fuchsia_component_runner::Task::__SourceBreaking { unknown_ordinal } => {
3333 Self::UnknownOrdinal_(unknown_ordinal)
3334 }
3335 }
3336 }
3337 }
3338
3339 impl ::fidl_next::CompatFrom<crate::ComponentTasks>
3340 for ::fidl_fuchsia_component_runner::ComponentTasks
3341 {
3342 fn compat_from(value: crate::ComponentTasks) -> Self {
3343 Self {
3344 component_task: ::fidl_next::CompatFrom::compat_from(value.component_task),
3345
3346 parent_task: ::fidl_next::CompatFrom::compat_from(value.parent_task),
3347
3348 __source_breaking: ::fidl::marker::SourceBreaking,
3349 }
3350 }
3351 }
3352
3353 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentTasks>
3354 for crate::ComponentTasks
3355 {
3356 fn compat_from(value: ::fidl_fuchsia_component_runner::ComponentTasks) -> Self {
3357 Self {
3358 component_task: ::fidl_next::CompatFrom::compat_from(value.component_task),
3359
3360 parent_task: ::fidl_next::CompatFrom::compat_from(value.parent_task),
3361 }
3362 }
3363 }
3364
3365 impl ::fidl_next::CompatFrom<crate::ComponentDiagnostics>
3366 for ::fidl_fuchsia_component_runner::ComponentDiagnostics
3367 {
3368 fn compat_from(value: crate::ComponentDiagnostics) -> Self {
3369 Self {
3370 tasks: ::fidl_next::CompatFrom::compat_from(value.tasks),
3371
3372 __source_breaking: ::fidl::marker::SourceBreaking,
3373 }
3374 }
3375 }
3376
3377 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentDiagnostics>
3378 for crate::ComponentDiagnostics
3379 {
3380 fn compat_from(value: ::fidl_fuchsia_component_runner::ComponentDiagnostics) -> Self {
3381 Self { tasks: ::fidl_next::CompatFrom::compat_from(value.tasks) }
3382 }
3383 }
3384
3385 impl ::fidl_next::CompatFrom<crate::ComponentControllerOnPublishDiagnosticsRequest>
3386 for ::fidl_fuchsia_component_runner::ComponentControllerOnPublishDiagnosticsRequest
3387 {
3388 #[inline]
3389 fn compat_from(value: crate::ComponentControllerOnPublishDiagnosticsRequest) -> Self {
3390 Self { payload: ::fidl_next::CompatFrom::compat_from(value.payload) }
3391 }
3392 }
3393
3394 impl
3395 ::fidl_next::CompatFrom<
3396 ::fidl_fuchsia_component_runner::ComponentControllerOnPublishDiagnosticsRequest,
3397 > for crate::ComponentControllerOnPublishDiagnosticsRequest
3398 {
3399 #[inline]
3400 fn compat_from(
3401 value: ::fidl_fuchsia_component_runner::ComponentControllerOnPublishDiagnosticsRequest,
3402 ) -> Self {
3403 Self { payload: ::fidl_next::CompatFrom::compat_from(value.payload) }
3404 }
3405 }
3406
3407 impl ::fidl_next::CompatFrom<crate::ComponentStopInfo>
3408 for ::fidl_fuchsia_component_runner::ComponentStopInfo
3409 {
3410 fn compat_from(value: crate::ComponentStopInfo) -> Self {
3411 Self {
3412 termination_status: ::fidl_next::CompatFrom::compat_from(value.termination_status),
3413
3414 exit_code: ::fidl_next::CompatFrom::compat_from(value.exit_code),
3415
3416 __source_breaking: ::fidl::marker::SourceBreaking,
3417 }
3418 }
3419 }
3420
3421 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentStopInfo>
3422 for crate::ComponentStopInfo
3423 {
3424 fn compat_from(value: ::fidl_fuchsia_component_runner::ComponentStopInfo) -> Self {
3425 Self {
3426 termination_status: ::fidl_next::CompatFrom::compat_from(value.termination_status),
3427
3428 exit_code: ::fidl_next::CompatFrom::compat_from(value.exit_code),
3429 }
3430 }
3431 }
3432
3433 impl ::fidl_next::CompatFrom<crate::ComponentControllerOnEscrowRequest>
3434 for ::fidl_fuchsia_component_runner::ComponentControllerOnEscrowRequest
3435 {
3436 fn compat_from(value: crate::ComponentControllerOnEscrowRequest) -> Self {
3437 Self {
3438 outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
3439
3440 escrowed_dictionary: ::fidl_next::CompatFrom::compat_from(
3441 value.escrowed_dictionary,
3442 ),
3443
3444 __source_breaking: ::fidl::marker::SourceBreaking,
3445 }
3446 }
3447 }
3448
3449 impl
3450 ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentControllerOnEscrowRequest>
3451 for crate::ComponentControllerOnEscrowRequest
3452 {
3453 fn compat_from(
3454 value: ::fidl_fuchsia_component_runner::ComponentControllerOnEscrowRequest,
3455 ) -> Self {
3456 Self {
3457 outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
3458
3459 escrowed_dictionary: ::fidl_next::CompatFrom::compat_from(
3460 value.escrowed_dictionary,
3461 ),
3462 }
3463 }
3464 }
3465
3466 #[cfg(target_os = "fuchsia")]
3467 pub type ComponentControllerProxy = ::fidl_next::Client<crate::ComponentController>;
3470
3471 impl ::fidl_next::CompatFrom<crate::ComponentController>
3472 for ::fidl_fuchsia_component_runner::ComponentControllerMarker
3473 {
3474 fn compat_from(_: crate::ComponentController) -> Self {
3475 Self
3476 }
3477 }
3478
3479 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentControllerMarker>
3480 for crate::ComponentController
3481 {
3482 fn compat_from(_: ::fidl_fuchsia_component_runner::ComponentControllerMarker) -> Self {
3483 Self
3484 }
3485 }
3486
3487 #[cfg(target_os = "fuchsia")]
3488
3489 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_component_runner::ComponentControllerProxy>
3490 for crate::ComponentController
3491 {
3492 fn client_compat_from(
3493 proxy: ::fidl_fuchsia_component_runner::ComponentControllerProxy,
3494 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
3495 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
3496 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
3497 ::fidl_next::ClientDispatcher::new(client_end)
3498 }
3499 }
3500
3501 impl ::fidl_next::CompatFrom<crate::ComponentNamespaceEntry>
3502 for ::fidl_fuchsia_component_runner::ComponentNamespaceEntry
3503 {
3504 fn compat_from(value: crate::ComponentNamespaceEntry) -> Self {
3505 Self {
3506 path: ::fidl_next::CompatFrom::compat_from(value.path),
3507
3508 directory: ::fidl_next::CompatFrom::compat_from(value.directory),
3509
3510 __source_breaking: ::fidl::marker::SourceBreaking,
3511 }
3512 }
3513 }
3514
3515 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentNamespaceEntry>
3516 for crate::ComponentNamespaceEntry
3517 {
3518 fn compat_from(value: ::fidl_fuchsia_component_runner::ComponentNamespaceEntry) -> Self {
3519 Self {
3520 path: ::fidl_next::CompatFrom::compat_from(value.path),
3521
3522 directory: ::fidl_next::CompatFrom::compat_from(value.directory),
3523 }
3524 }
3525 }
3526
3527 impl ::fidl_next::CompatFrom<crate::ComponentStartInfo>
3528 for ::fidl_fuchsia_component_runner::ComponentStartInfo
3529 {
3530 fn compat_from(value: crate::ComponentStartInfo) -> Self {
3531 Self {
3532 resolved_url: ::fidl_next::CompatFrom::compat_from(value.resolved_url),
3533
3534 program: ::fidl_next::CompatFrom::compat_from(value.program),
3535
3536 ns: ::fidl_next::CompatFrom::compat_from(value.ns),
3537
3538 outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
3539
3540 runtime_dir: ::fidl_next::CompatFrom::compat_from(value.runtime_dir),
3541
3542 numbered_handles: ::fidl_next::CompatFrom::compat_from(value.numbered_handles),
3543
3544 encoded_config: ::fidl_next::CompatFrom::compat_from(value.encoded_config),
3545
3546 break_on_start: ::fidl_next::CompatFrom::compat_from(value.break_on_start),
3547
3548 component_instance: ::fidl_next::CompatFrom::compat_from(value.component_instance),
3549
3550 escrowed_dictionary: ::fidl_next::CompatFrom::compat_from(
3551 value.escrowed_dictionary,
3552 ),
3553
3554 __source_breaking: ::fidl::marker::SourceBreaking,
3555 }
3556 }
3557 }
3558
3559 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentStartInfo>
3560 for crate::ComponentStartInfo
3561 {
3562 fn compat_from(value: ::fidl_fuchsia_component_runner::ComponentStartInfo) -> Self {
3563 Self {
3564 resolved_url: ::fidl_next::CompatFrom::compat_from(value.resolved_url),
3565
3566 program: ::fidl_next::CompatFrom::compat_from(value.program),
3567
3568 ns: ::fidl_next::CompatFrom::compat_from(value.ns),
3569
3570 outgoing_dir: ::fidl_next::CompatFrom::compat_from(value.outgoing_dir),
3571
3572 runtime_dir: ::fidl_next::CompatFrom::compat_from(value.runtime_dir),
3573
3574 numbered_handles: ::fidl_next::CompatFrom::compat_from(value.numbered_handles),
3575
3576 encoded_config: ::fidl_next::CompatFrom::compat_from(value.encoded_config),
3577
3578 break_on_start: ::fidl_next::CompatFrom::compat_from(value.break_on_start),
3579
3580 component_instance: ::fidl_next::CompatFrom::compat_from(value.component_instance),
3581
3582 escrowed_dictionary: ::fidl_next::CompatFrom::compat_from(
3583 value.escrowed_dictionary,
3584 ),
3585 }
3586 }
3587 }
3588
3589 impl ::fidl_next::CompatFrom<crate::ComponentRunnerStartRequest>
3590 for ::fidl_fuchsia_component_runner::ComponentRunnerStartRequest
3591 {
3592 #[inline]
3593 fn compat_from(value: crate::ComponentRunnerStartRequest) -> Self {
3594 Self {
3595 start_info: ::fidl_next::CompatFrom::compat_from(value.start_info),
3596
3597 controller: ::fidl_next::CompatFrom::compat_from(value.controller),
3598 }
3599 }
3600 }
3601
3602 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentRunnerStartRequest>
3603 for crate::ComponentRunnerStartRequest
3604 {
3605 #[inline]
3606 fn compat_from(
3607 value: ::fidl_fuchsia_component_runner::ComponentRunnerStartRequest,
3608 ) -> Self {
3609 Self {
3610 start_info: ::fidl_next::CompatFrom::compat_from(value.start_info),
3611
3612 controller: ::fidl_next::CompatFrom::compat_from(value.controller),
3613 }
3614 }
3615 }
3616
3617 #[cfg(target_os = "fuchsia")]
3618 pub type ComponentRunnerProxy = ::fidl_next::Client<crate::ComponentRunner>;
3621
3622 impl ::fidl_next::CompatFrom<crate::ComponentRunner>
3623 for ::fidl_fuchsia_component_runner::ComponentRunnerMarker
3624 {
3625 fn compat_from(_: crate::ComponentRunner) -> Self {
3626 Self
3627 }
3628 }
3629
3630 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::ComponentRunnerMarker>
3631 for crate::ComponentRunner
3632 {
3633 fn compat_from(_: ::fidl_fuchsia_component_runner::ComponentRunnerMarker) -> Self {
3634 Self
3635 }
3636 }
3637
3638 #[cfg(target_os = "fuchsia")]
3639
3640 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_component_runner::ComponentRunnerProxy>
3641 for crate::ComponentRunner
3642 {
3643 fn client_compat_from(
3644 proxy: ::fidl_fuchsia_component_runner::ComponentRunnerProxy,
3645 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
3646 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
3647 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
3648 ::fidl_next::ClientDispatcher::new(client_end)
3649 }
3650 }
3651
3652 impl ::fidl_next::CompatFrom<crate::TaskProviderGetJobResponse>
3653 for ::fidl_fuchsia_component_runner::TaskProviderGetJobResponse
3654 {
3655 #[inline]
3656 fn compat_from(value: crate::TaskProviderGetJobResponse) -> Self {
3657 Self { job: ::fidl_next::CompatFrom::compat_from(value.job) }
3658 }
3659 }
3660
3661 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::TaskProviderGetJobResponse>
3662 for crate::TaskProviderGetJobResponse
3663 {
3664 #[inline]
3665 fn compat_from(value: ::fidl_fuchsia_component_runner::TaskProviderGetJobResponse) -> Self {
3666 Self { job: ::fidl_next::CompatFrom::compat_from(value.job) }
3667 }
3668 }
3669
3670 #[cfg(target_os = "fuchsia")]
3671 pub type TaskProviderProxy = ::fidl_next::Client<crate::TaskProvider>;
3674
3675 impl ::fidl_next::CompatFrom<crate::TaskProvider>
3676 for ::fidl_fuchsia_component_runner::TaskProviderMarker
3677 {
3678 fn compat_from(_: crate::TaskProvider) -> Self {
3679 Self
3680 }
3681 }
3682
3683 impl ::fidl_next::CompatFrom<::fidl_fuchsia_component_runner::TaskProviderMarker>
3684 for crate::TaskProvider
3685 {
3686 fn compat_from(_: ::fidl_fuchsia_component_runner::TaskProviderMarker) -> Self {
3687 Self
3688 }
3689 }
3690
3691 #[cfg(target_os = "fuchsia")]
3692
3693 impl ::fidl_next::ClientCompatFrom<::fidl_fuchsia_component_runner::TaskProviderProxy>
3694 for crate::TaskProvider
3695 {
3696 fn client_compat_from(
3697 proxy: ::fidl_fuchsia_component_runner::TaskProviderProxy,
3698 ) -> ::fidl_next::ClientDispatcher<Self, ::fidl_next::fuchsia::zx::Channel> {
3699 let channel = ::fidl::endpoints::Proxy::into_channel(proxy).unwrap().into_zx_channel();
3700 let client_end = ::fidl_next::ClientEnd::from_untyped(channel);
3701 ::fidl_next::ClientDispatcher::new(client_end)
3702 }
3703 }
3704}