fidl_next_fuchsia_component_runner/
fidl_next_fuchsia_component_runner.rs

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