fidl_next_fuchsia_component/
fidl_next_fuchsia_component.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/// The type corresponding to the Binder protocol.
6#[doc = " A framework-provided protocol that allows components that use it to bind to\n the component that exposes it. The act of connecting to this protocol will\n trigger the bind. Thus, this protocol contains no methods. For more details\n on binding, see\n https://fuchsia.dev/fuchsia-src/concepts/components/v2/lifecycle#binding.\n\n When a component connects to protocol, the component exposing this capability\n will be started if it\'s not already running. Upon a failure to start, the\n component framework will close the server end of the channel with a\n zx.Status epitaph.\n"]
7#[derive(Debug)]
8pub struct Binder;
9
10impl ::fidl_next::Discoverable for Binder {
11    const PROTOCOL_NAME: &'static str = "fuchsia.component.Binder";
12}
13
14pub mod binder {
15    pub mod prelude {
16        pub use crate::{
17            binder, Binder, BinderClientHandler, BinderClientSender, BinderServerHandler,
18            BinderServerSender,
19        };
20    }
21}
22
23/// A helper trait for the `Binder` client sender.
24pub trait BinderClientSender {
25    type Transport: ::fidl_next::Transport;
26}
27
28impl<___T> BinderClientSender for ::fidl_next::ClientSender<___T, Binder>
29where
30    ___T: ::fidl_next::Transport,
31{
32    type Transport = ___T;
33}
34
35/// A client handler for the Binder protocol.
36///
37/// See [`Binder`] for more details.
38pub trait BinderClientHandler<___T: ::fidl_next::Transport> {}
39
40impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Binder
41where
42    ___T: ::fidl_next::Transport,
43    ___H: BinderClientHandler<___T>,
44{
45    fn on_event(
46        handler: &mut ___H,
47        sender: &::fidl_next::ClientSender<___T, Self>,
48        ordinal: u64,
49        buffer: ___T::RecvBuffer,
50    ) {
51        match ordinal {
52            ordinal => {
53                sender.close();
54            }
55        }
56    }
57}
58
59/// A helper trait for the `Binder` server sender.
60pub trait BinderServerSender {
61    type Transport: ::fidl_next::Transport;
62}
63
64impl<___T> BinderServerSender for ::fidl_next::ServerSender<___T, Binder>
65where
66    ___T: ::fidl_next::Transport,
67{
68    type Transport = ___T;
69}
70
71/// A server handler for the Binder protocol.
72///
73/// See [`Binder`] for more details.
74pub trait BinderServerHandler<___T: ::fidl_next::Transport> {}
75
76impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Binder
77where
78    ___T: ::fidl_next::Transport,
79    ___H: BinderServerHandler<___T>,
80{
81    fn on_one_way(
82        handler: &mut ___H,
83        sender: &::fidl_next::ServerSender<___T, Self>,
84        ordinal: u64,
85        buffer: ___T::RecvBuffer,
86    ) {
87        match ordinal {
88            ordinal => {
89                sender.close();
90            }
91        }
92    }
93
94    fn on_two_way(
95        handler: &mut ___H,
96        sender: &::fidl_next::ServerSender<___T, Self>,
97        ordinal: u64,
98        buffer: ___T::RecvBuffer,
99        responder: ::fidl_next::protocol::Responder,
100    ) {
101        match ordinal {
102            ordinal => {
103                sender.close();
104            }
105        }
106    }
107}
108
109pub const MAX_NAME_LENGTH: u64 = 255;
110
111pub type Name = String;
112
113/// The wire type corresponding to [`Name`].
114pub type WireName<'de> = ::fidl_next::WireString<'de>;
115
116#[doc = " Payload for CapabilityRequested events\n"]
117#[derive(Debug, Default)]
118pub struct CapabilityRequestedPayload {
119    pub name: Option<String>,
120
121    pub capability: Option<::fidl_next::fuchsia::zx::Handle>,
122}
123
124impl CapabilityRequestedPayload {
125    fn __max_ordinal(&self) -> usize {
126        if self.capability.is_some() {
127            return 2;
128        }
129
130        if self.name.is_some() {
131            return 1;
132        }
133
134        0
135    }
136}
137
138impl ::fidl_next::Encodable for CapabilityRequestedPayload {
139    type Encoded = WireCapabilityRequestedPayload<'static>;
140}
141
142unsafe impl<___E> ::fidl_next::Encode<___E> for CapabilityRequestedPayload
143where
144    ___E: ::fidl_next::Encoder + ?Sized,
145
146    ___E: ::fidl_next::fuchsia::HandleEncoder,
147{
148    #[inline]
149    fn encode(
150        mut self,
151        encoder: &mut ___E,
152        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
153    ) -> Result<(), ::fidl_next::EncodeError> {
154        ::fidl_next::munge!(let WireCapabilityRequestedPayload { table } = out);
155
156        let max_ord = self.__max_ordinal();
157
158        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
159        ::fidl_next::Wire::zero_padding(&mut out);
160
161        let mut preallocated =
162            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
163
164        for i in 1..=max_ord {
165            match i {
166                2 => {
167                    if let Some(capability) = self.capability.take() {
168                        ::fidl_next::WireEnvelope::encode_value(
169                            capability,
170                            preallocated.encoder,
171                            &mut out,
172                        )?;
173                    } else {
174                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
175                    }
176                }
177
178                1 => {
179                    if let Some(name) = self.name.take() {
180                        ::fidl_next::WireEnvelope::encode_value(
181                            name,
182                            preallocated.encoder,
183                            &mut out,
184                        )?;
185                    } else {
186                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
187                    }
188                }
189
190                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
191            }
192            unsafe {
193                preallocated.write_next(out.assume_init_ref());
194            }
195        }
196
197        ::fidl_next::WireTable::encode_len(table, max_ord);
198
199        Ok(())
200    }
201}
202
203impl<'de> ::fidl_next::FromWire<WireCapabilityRequestedPayload<'de>>
204    for CapabilityRequestedPayload
205{
206    #[inline]
207    fn from_wire(wire: WireCapabilityRequestedPayload<'de>) -> Self {
208        let wire = ::core::mem::ManuallyDrop::new(wire);
209
210        let name = wire.table.get(1);
211
212        let capability = wire.table.get(2);
213
214        Self {
215            name: name.map(|envelope| {
216                ::fidl_next::FromWire::from_wire(unsafe {
217                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
218                })
219            }),
220
221            capability: capability.map(|envelope| {
222                ::fidl_next::FromWire::from_wire(unsafe {
223                    envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
224                })
225            }),
226        }
227    }
228}
229
230/// The wire type corresponding to [`CapabilityRequestedPayload`].
231#[repr(C)]
232pub struct WireCapabilityRequestedPayload<'de> {
233    table: ::fidl_next::WireTable<'de>,
234}
235
236impl<'de> Drop for WireCapabilityRequestedPayload<'de> {
237    fn drop(&mut self) {
238        let _ = self
239            .table
240            .get(1)
241            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
242
243        let _ = self.table.get(2).map(|envelope| unsafe {
244            envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
245        });
246    }
247}
248
249unsafe impl ::fidl_next::Wire for WireCapabilityRequestedPayload<'static> {
250    type Decoded<'de> = WireCapabilityRequestedPayload<'de>;
251
252    #[inline]
253    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
254        ::fidl_next::munge!(let Self { table } = out);
255        ::fidl_next::WireTable::zero_padding(table);
256    }
257}
258
259unsafe impl<___D> ::fidl_next::Decode<___D> for WireCapabilityRequestedPayload<'static>
260where
261    ___D: ::fidl_next::Decoder + ?Sized,
262
263    ___D: ::fidl_next::fuchsia::HandleDecoder,
264{
265    fn decode(
266        slot: ::fidl_next::Slot<'_, Self>,
267        decoder: &mut ___D,
268    ) -> Result<(), ::fidl_next::DecodeError> {
269        ::fidl_next::munge!(let Self { table } = slot);
270
271        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
272            match ordinal {
273                0 => unsafe { ::core::hint::unreachable_unchecked() },
274
275                1 => {
276                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
277                        slot.as_mut(),
278                        decoder,
279                    )?;
280
281                    let name = unsafe {
282                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
283                    };
284
285                    if name.len() > 255 {
286                        return Err(::fidl_next::DecodeError::VectorTooLong {
287                            size: name.len() as u64,
288                            limit: 255,
289                        });
290                    }
291
292                    Ok(())
293                }
294
295                2 => {
296                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
297                        slot.as_mut(),
298                        decoder,
299                    )?;
300
301                    Ok(())
302                }
303
304                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
305            }
306        })
307    }
308}
309
310impl<'de> WireCapabilityRequestedPayload<'de> {
311    pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
312        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
313    }
314
315    pub fn capability(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
316        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
317    }
318}
319
320impl<'de> ::core::fmt::Debug for WireCapabilityRequestedPayload<'de> {
321    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
322        f.debug_struct("CapabilityRequestedPayload")
323            .field("name", &self.name())
324            .field("capability", &self.capability())
325            .finish()
326    }
327}
328
329#[doc = " The maximum number of children that the a call `ChildIterator.Next`\n can return.\n Note, this is not a limit on the number of children that can be added\n to a component. This is merely a limit for a single invocation of the\n `Next` method.\n"]
330pub const MAX_CHILD_COUNT: u32 = 128;
331
332#[derive(Clone, Debug)]
333pub struct ChildIteratorNextResponse {
334    pub children: Vec<::fidl_next_fuchsia_component_decl::ChildRef>,
335}
336
337impl ::fidl_next::Encodable for ChildIteratorNextResponse {
338    type Encoded = WireChildIteratorNextResponse<'static>;
339}
340
341unsafe impl<___E> ::fidl_next::Encode<___E> for ChildIteratorNextResponse
342where
343    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
344
345    ___E: ::fidl_next::Encoder,
346{
347    #[inline]
348    fn encode(
349        self,
350        encoder: &mut ___E,
351        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
352    ) -> Result<(), ::fidl_next::EncodeError> {
353        ::fidl_next::munge! {
354            let Self::Encoded {
355                children,
356
357            } = out;
358        }
359
360        ::fidl_next::Encode::encode(self.children, encoder, children)?;
361
362        Ok(())
363    }
364}
365
366unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ChildIteratorNextResponse
367where
368    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
369
370    ___E: ::fidl_next::Encoder,
371{
372    #[inline]
373    fn encode_ref(
374        &self,
375        encoder: &mut ___E,
376        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
377    ) -> Result<(), ::fidl_next::EncodeError> {
378        ::fidl_next::munge! {
379            let Self::Encoded {
380                children,
381
382            } = out;
383        }
384
385        ::fidl_next::EncodeRef::encode_ref(&self.children, encoder, children)?;
386
387        Ok(())
388    }
389}
390
391impl ::fidl_next::EncodableOption for ChildIteratorNextResponse {
392    type EncodedOption = ::fidl_next::WireBox<'static, WireChildIteratorNextResponse<'static>>;
393}
394
395unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ChildIteratorNextResponse
396where
397    ___E: ::fidl_next::Encoder + ?Sized,
398    ChildIteratorNextResponse: ::fidl_next::Encode<___E>,
399{
400    #[inline]
401    fn encode_option(
402        this: Option<Self>,
403        encoder: &mut ___E,
404        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
405    ) -> Result<(), ::fidl_next::EncodeError> {
406        if let Some(inner) = this {
407            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
408            ::fidl_next::WireBox::encode_present(out);
409        } else {
410            ::fidl_next::WireBox::encode_absent(out);
411        }
412
413        Ok(())
414    }
415}
416
417unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ChildIteratorNextResponse
418where
419    ___E: ::fidl_next::Encoder + ?Sized,
420    ChildIteratorNextResponse: ::fidl_next::EncodeRef<___E>,
421{
422    #[inline]
423    fn encode_option_ref(
424        this: Option<&Self>,
425        encoder: &mut ___E,
426        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
427    ) -> Result<(), ::fidl_next::EncodeError> {
428        if let Some(inner) = this {
429            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
430            ::fidl_next::WireBox::encode_present(out);
431        } else {
432            ::fidl_next::WireBox::encode_absent(out);
433        }
434
435        Ok(())
436    }
437}
438
439impl<'de> ::fidl_next::FromWire<WireChildIteratorNextResponse<'de>> for ChildIteratorNextResponse {
440    #[inline]
441    fn from_wire(wire: WireChildIteratorNextResponse<'de>) -> Self {
442        Self { children: ::fidl_next::FromWire::from_wire(wire.children) }
443    }
444}
445
446impl<'de> ::fidl_next::FromWireRef<WireChildIteratorNextResponse<'de>>
447    for ChildIteratorNextResponse
448{
449    #[inline]
450    fn from_wire_ref(wire: &WireChildIteratorNextResponse<'de>) -> Self {
451        Self { children: ::fidl_next::FromWireRef::from_wire_ref(&wire.children) }
452    }
453}
454
455/// The wire type corresponding to [`ChildIteratorNextResponse`].
456#[derive(Debug)]
457#[repr(C)]
458pub struct WireChildIteratorNextResponse<'de> {
459    pub children:
460        ::fidl_next::WireVector<'de, ::fidl_next_fuchsia_component_decl::WireChildRef<'de>>,
461}
462
463unsafe impl ::fidl_next::Wire for WireChildIteratorNextResponse<'static> {
464    type Decoded<'de> = WireChildIteratorNextResponse<'de>;
465
466    #[inline]
467    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
468}
469
470unsafe impl<___D> ::fidl_next::Decode<___D> for WireChildIteratorNextResponse<'static>
471where
472    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
473
474    ___D: ::fidl_next::Decoder,
475{
476    fn decode(
477        slot: ::fidl_next::Slot<'_, Self>,
478        decoder: &mut ___D,
479    ) -> Result<(), ::fidl_next::DecodeError> {
480        ::fidl_next::munge! {
481            let Self {
482                mut children,
483
484            } = slot;
485        }
486
487        ::fidl_next::Decode::decode(children.as_mut(), decoder)?;
488
489        let children = unsafe { children.deref_unchecked() };
490
491        if children.len() > 128 {
492            return Err(::fidl_next::DecodeError::VectorTooLong {
493                size: children.len() as u64,
494                limit: 128,
495            });
496        }
497
498        Ok(())
499    }
500}
501
502/// The type corresponding to the ChildIterator protocol.
503#[doc = " A protocol to iterate over the list of children in a realm.\n"]
504#[derive(Debug)]
505pub struct ChildIterator;
506
507pub mod child_iterator {
508    pub mod prelude {
509        pub use crate::{
510            child_iterator, ChildIterator, ChildIteratorClientHandler, ChildIteratorClientSender,
511            ChildIteratorServerHandler, ChildIteratorServerSender,
512        };
513
514        pub use crate::ChildIteratorNextResponse;
515    }
516
517    pub struct Next;
518
519    impl ::fidl_next::Method for Next {
520        const ORDINAL: u64 = 4676077302722137352;
521
522        type Protocol = crate::ChildIterator;
523
524        type Request = ();
525
526        type Response = crate::WireChildIteratorNextResponse<'static>;
527    }
528}
529
530/// A helper trait for the `ChildIterator` client sender.
531pub trait ChildIteratorClientSender {
532    type Transport: ::fidl_next::Transport;
533
534    #[doc = " Advance the iterator and return the next batch of children.\n\n Returns a vector of `ChildRef`. Returns an empty vector when there are\n no more children.\n"]
535    fn next(
536        &self,
537    ) -> Result<
538        ::fidl_next::ResponseFuture<'_, Self::Transport, child_iterator::Next>,
539        ::fidl_next::EncodeError,
540    >;
541}
542
543impl<___T> ChildIteratorClientSender for ::fidl_next::ClientSender<___T, ChildIterator>
544where
545    ___T: ::fidl_next::Transport,
546{
547    type Transport = ___T;
548
549    #[doc = " Advance the iterator and return the next batch of children.\n\n Returns a vector of `ChildRef`. Returns an empty vector when there are\n no more children.\n"]
550    fn next(
551        &self,
552    ) -> Result<
553        ::fidl_next::ResponseFuture<'_, Self::Transport, child_iterator::Next>,
554        ::fidl_next::EncodeError,
555    > {
556        self.as_untyped()
557            .send_two_way(4676077302722137352, ())
558            .map(::fidl_next::ResponseFuture::from_untyped)
559    }
560}
561
562/// A client handler for the ChildIterator protocol.
563///
564/// See [`ChildIterator`] for more details.
565pub trait ChildIteratorClientHandler<___T: ::fidl_next::Transport> {}
566
567impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ChildIterator
568where
569    ___T: ::fidl_next::Transport,
570    ___H: ChildIteratorClientHandler<___T>,
571
572    <child_iterator::Next as ::fidl_next::Method>::Response:
573        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
574{
575    fn on_event(
576        handler: &mut ___H,
577        sender: &::fidl_next::ClientSender<___T, Self>,
578        ordinal: u64,
579        buffer: ___T::RecvBuffer,
580    ) {
581        match ordinal {
582            ordinal => {
583                sender.close();
584            }
585        }
586    }
587}
588
589/// A helper trait for the `ChildIterator` server sender.
590pub trait ChildIteratorServerSender {
591    type Transport: ::fidl_next::Transport;
592}
593
594impl<___T> ChildIteratorServerSender for ::fidl_next::ServerSender<___T, ChildIterator>
595where
596    ___T: ::fidl_next::Transport,
597{
598    type Transport = ___T;
599}
600
601/// A server handler for the ChildIterator protocol.
602///
603/// See [`ChildIterator`] for more details.
604pub trait ChildIteratorServerHandler<___T: ::fidl_next::Transport> {
605    #[doc = " Advance the iterator and return the next batch of children.\n\n Returns a vector of `ChildRef`. Returns an empty vector when there are\n no more children.\n"]
606    fn next(
607        &mut self,
608        sender: &::fidl_next::ServerSender<___T, ChildIterator>,
609
610        responder: ::fidl_next::Responder<child_iterator::Next>,
611    );
612}
613
614impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ChildIterator
615where
616    ___T: ::fidl_next::Transport,
617    ___H: ChildIteratorServerHandler<___T>,
618{
619    fn on_one_way(
620        handler: &mut ___H,
621        sender: &::fidl_next::ServerSender<___T, Self>,
622        ordinal: u64,
623        buffer: ___T::RecvBuffer,
624    ) {
625        match ordinal {
626            ordinal => {
627                sender.close();
628            }
629        }
630    }
631
632    fn on_two_way(
633        handler: &mut ___H,
634        sender: &::fidl_next::ServerSender<___T, Self>,
635        ordinal: u64,
636        buffer: ___T::RecvBuffer,
637        responder: ::fidl_next::protocol::Responder,
638    ) {
639        match ordinal {
640            4676077302722137352 => {
641                let responder = ::fidl_next::Responder::from_untyped(responder);
642
643                handler.next(sender, responder);
644            }
645
646            ordinal => {
647                sender.close();
648            }
649        }
650    }
651}
652
653#[doc = " The maximum number of handles that can be passed to a created component.\n"]
654pub const MAX_HANDLE_COUNT: u32 = 128;
655
656pub const MAX_NAMESPACE_COUNT: u32 = 32;
657
658pub type ControllerStartResponse = ();
659
660/// The wire type corresponding to [`ControllerStartResponse`].
661pub type WireControllerStartResponse = ();
662
663#[derive(Debug)]
664#[repr(C)]
665pub struct ControllerIsStartedResponse {
666    pub is_started: bool,
667}
668
669impl ::fidl_next::Encodable for ControllerIsStartedResponse {
670    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<Self, WireControllerIsStartedResponse> = unsafe {
671        ::fidl_next::CopyOptimization::enable_if(
672            true && <bool as ::fidl_next::Encodable>::COPY_OPTIMIZATION.is_enabled(),
673        )
674    };
675
676    type Encoded = WireControllerIsStartedResponse;
677}
678
679unsafe impl<___E> ::fidl_next::Encode<___E> for ControllerIsStartedResponse
680where
681    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
682
683    ___E: ::fidl_next::fuchsia::HandleEncoder,
684{
685    #[inline]
686    fn encode(
687        self,
688        encoder: &mut ___E,
689        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
690    ) -> Result<(), ::fidl_next::EncodeError> {
691        ::fidl_next::munge! {
692            let Self::Encoded {
693                is_started,
694
695            } = out;
696        }
697
698        ::fidl_next::Encode::encode(self.is_started, encoder, is_started)?;
699
700        Ok(())
701    }
702}
703
704impl ::fidl_next::EncodableOption for ControllerIsStartedResponse {
705    type EncodedOption = ::fidl_next::WireBox<'static, WireControllerIsStartedResponse>;
706}
707
708unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ControllerIsStartedResponse
709where
710    ___E: ::fidl_next::Encoder + ?Sized,
711    ControllerIsStartedResponse: ::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 ::fidl_next::FromWire<WireControllerIsStartedResponse> for ControllerIsStartedResponse {
731    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<WireControllerIsStartedResponse, Self> = unsafe {
732        ::fidl_next::CopyOptimization::enable_if(
733            true && <bool as ::fidl_next::FromWire<bool>>::COPY_OPTIMIZATION.is_enabled(),
734        )
735    };
736
737    #[inline]
738    fn from_wire(wire: WireControllerIsStartedResponse) -> Self {
739        Self { is_started: ::fidl_next::FromWire::from_wire(wire.is_started) }
740    }
741}
742
743/// The wire type corresponding to [`ControllerIsStartedResponse`].
744#[derive(Debug)]
745#[repr(C)]
746pub struct WireControllerIsStartedResponse {
747    pub is_started: bool,
748}
749
750unsafe impl ::fidl_next::Wire for WireControllerIsStartedResponse {
751    type Decoded<'de> = WireControllerIsStartedResponse;
752
753    #[inline]
754    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
755}
756
757unsafe impl<___D> ::fidl_next::Decode<___D> for WireControllerIsStartedResponse
758where
759    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
760
761    ___D: ::fidl_next::fuchsia::HandleDecoder,
762{
763    fn decode(
764        slot: ::fidl_next::Slot<'_, Self>,
765        decoder: &mut ___D,
766    ) -> Result<(), ::fidl_next::DecodeError> {
767        ::fidl_next::munge! {
768            let Self {
769                mut is_started,
770
771            } = slot;
772        }
773
774        ::fidl_next::Decode::decode(is_started.as_mut(), decoder)?;
775
776        Ok(())
777    }
778}
779
780pub const MAX_PATH_LENGTH: u64 = 4095;
781
782#[doc = " Standard error codes for component framework protocols.\n"]
783#[derive(Clone, Copy, Debug, PartialEq, Eq)]
784#[repr(u32)]
785pub enum Error {
786    Internal = 1,
787    InvalidArguments = 2,
788    Unsupported = 3,
789    AccessDenied = 4,
790    InstanceNotFound = 5,
791    InstanceAlreadyExists = 6,
792    InstanceCannotStart = 7,
793    InstanceCannotResolve = 8,
794    CollectionNotFound = 9,
795    ResourceUnavailable = 10,
796    InstanceDied = 11,
797    ResourceNotFound = 12,
798    InstanceCannotUnresolve = 13,
799    InstanceAlreadyStarted = 14,
800    UnknownOrdinal_(u32),
801}
802
803impl ::fidl_next::Encodable for Error {
804    type Encoded = WireError;
805}
806impl ::std::convert::From<u32> for Error {
807    fn from(value: u32) -> Self {
808        match value {
809            1 => Self::Internal,
810            2 => Self::InvalidArguments,
811            3 => Self::Unsupported,
812            4 => Self::AccessDenied,
813            5 => Self::InstanceNotFound,
814            6 => Self::InstanceAlreadyExists,
815            7 => Self::InstanceCannotStart,
816            8 => Self::InstanceCannotResolve,
817            9 => Self::CollectionNotFound,
818            10 => Self::ResourceUnavailable,
819            11 => Self::InstanceDied,
820            12 => Self::ResourceNotFound,
821            13 => Self::InstanceCannotUnresolve,
822            14 => Self::InstanceAlreadyStarted,
823
824            _ => Self::UnknownOrdinal_(value),
825        }
826    }
827}
828
829unsafe impl<___E> ::fidl_next::Encode<___E> for Error
830where
831    ___E: ?Sized,
832{
833    #[inline]
834    fn encode(
835        self,
836        encoder: &mut ___E,
837        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
838    ) -> Result<(), ::fidl_next::EncodeError> {
839        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
840    }
841}
842
843unsafe impl<___E> ::fidl_next::EncodeRef<___E> for Error
844where
845    ___E: ?Sized,
846{
847    #[inline]
848    fn encode_ref(
849        &self,
850        encoder: &mut ___E,
851        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
852    ) -> Result<(), ::fidl_next::EncodeError> {
853        ::fidl_next::munge!(let WireError { value } = out);
854        let _ = value.write(::fidl_next::WireU32::from(match *self {
855            Self::Internal => 1,
856
857            Self::InvalidArguments => 2,
858
859            Self::Unsupported => 3,
860
861            Self::AccessDenied => 4,
862
863            Self::InstanceNotFound => 5,
864
865            Self::InstanceAlreadyExists => 6,
866
867            Self::InstanceCannotStart => 7,
868
869            Self::InstanceCannotResolve => 8,
870
871            Self::CollectionNotFound => 9,
872
873            Self::ResourceUnavailable => 10,
874
875            Self::InstanceDied => 11,
876
877            Self::ResourceNotFound => 12,
878
879            Self::InstanceCannotUnresolve => 13,
880
881            Self::InstanceAlreadyStarted => 14,
882
883            Self::UnknownOrdinal_(value) => value,
884        }));
885
886        Ok(())
887    }
888}
889
890impl ::core::convert::From<WireError> for Error {
891    fn from(wire: WireError) -> Self {
892        match u32::from(wire.value) {
893            1 => Self::Internal,
894
895            2 => Self::InvalidArguments,
896
897            3 => Self::Unsupported,
898
899            4 => Self::AccessDenied,
900
901            5 => Self::InstanceNotFound,
902
903            6 => Self::InstanceAlreadyExists,
904
905            7 => Self::InstanceCannotStart,
906
907            8 => Self::InstanceCannotResolve,
908
909            9 => Self::CollectionNotFound,
910
911            10 => Self::ResourceUnavailable,
912
913            11 => Self::InstanceDied,
914
915            12 => Self::ResourceNotFound,
916
917            13 => Self::InstanceCannotUnresolve,
918
919            14 => Self::InstanceAlreadyStarted,
920
921            value => Self::UnknownOrdinal_(value),
922        }
923    }
924}
925
926impl ::fidl_next::FromWire<WireError> for Error {
927    #[inline]
928    fn from_wire(wire: WireError) -> Self {
929        Self::from(wire)
930    }
931}
932
933impl ::fidl_next::FromWireRef<WireError> for Error {
934    #[inline]
935    fn from_wire_ref(wire: &WireError) -> Self {
936        Self::from(*wire)
937    }
938}
939
940/// The wire type corresponding to [`Error`].
941#[derive(Clone, Copy, Debug, PartialEq, Eq)]
942#[repr(transparent)]
943pub struct WireError {
944    value: ::fidl_next::WireU32,
945}
946
947unsafe impl ::fidl_next::Wire for WireError {
948    type Decoded<'de> = Self;
949
950    #[inline]
951    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
952        // Wire enums have no padding
953    }
954}
955
956impl WireError {
957    pub const INTERNAL: WireError = WireError { value: ::fidl_next::WireU32(1) };
958
959    pub const INVALID_ARGUMENTS: WireError = WireError { value: ::fidl_next::WireU32(2) };
960
961    pub const UNSUPPORTED: WireError = WireError { value: ::fidl_next::WireU32(3) };
962
963    pub const ACCESS_DENIED: WireError = WireError { value: ::fidl_next::WireU32(4) };
964
965    pub const INSTANCE_NOT_FOUND: WireError = WireError { value: ::fidl_next::WireU32(5) };
966
967    pub const INSTANCE_ALREADY_EXISTS: WireError = WireError { value: ::fidl_next::WireU32(6) };
968
969    pub const INSTANCE_CANNOT_START: WireError = WireError { value: ::fidl_next::WireU32(7) };
970
971    pub const INSTANCE_CANNOT_RESOLVE: WireError = WireError { value: ::fidl_next::WireU32(8) };
972
973    pub const COLLECTION_NOT_FOUND: WireError = WireError { value: ::fidl_next::WireU32(9) };
974
975    pub const RESOURCE_UNAVAILABLE: WireError = WireError { value: ::fidl_next::WireU32(10) };
976
977    pub const INSTANCE_DIED: WireError = WireError { value: ::fidl_next::WireU32(11) };
978
979    pub const RESOURCE_NOT_FOUND: WireError = WireError { value: ::fidl_next::WireU32(12) };
980
981    pub const INSTANCE_CANNOT_UNRESOLVE: WireError = WireError { value: ::fidl_next::WireU32(13) };
982
983    pub const INSTANCE_ALREADY_STARTED: WireError = WireError { value: ::fidl_next::WireU32(14) };
984}
985
986unsafe impl<___D> ::fidl_next::Decode<___D> for WireError
987where
988    ___D: ?Sized,
989{
990    fn decode(
991        slot: ::fidl_next::Slot<'_, Self>,
992        _: &mut ___D,
993    ) -> Result<(), ::fidl_next::DecodeError> {
994        Ok(())
995    }
996}
997
998impl ::core::convert::From<Error> for WireError {
999    fn from(natural: Error) -> Self {
1000        match natural {
1001            Error::Internal => WireError::INTERNAL,
1002
1003            Error::InvalidArguments => WireError::INVALID_ARGUMENTS,
1004
1005            Error::Unsupported => WireError::UNSUPPORTED,
1006
1007            Error::AccessDenied => WireError::ACCESS_DENIED,
1008
1009            Error::InstanceNotFound => WireError::INSTANCE_NOT_FOUND,
1010
1011            Error::InstanceAlreadyExists => WireError::INSTANCE_ALREADY_EXISTS,
1012
1013            Error::InstanceCannotStart => WireError::INSTANCE_CANNOT_START,
1014
1015            Error::InstanceCannotResolve => WireError::INSTANCE_CANNOT_RESOLVE,
1016
1017            Error::CollectionNotFound => WireError::COLLECTION_NOT_FOUND,
1018
1019            Error::ResourceUnavailable => WireError::RESOURCE_UNAVAILABLE,
1020
1021            Error::InstanceDied => WireError::INSTANCE_DIED,
1022
1023            Error::ResourceNotFound => WireError::RESOURCE_NOT_FOUND,
1024
1025            Error::InstanceCannotUnresolve => WireError::INSTANCE_CANNOT_UNRESOLVE,
1026
1027            Error::InstanceAlreadyStarted => WireError::INSTANCE_ALREADY_STARTED,
1028
1029            Error::UnknownOrdinal_(value) => WireError { value: ::fidl_next::WireU32::from(value) },
1030        }
1031    }
1032}
1033
1034#[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"]
1035#[derive(Debug, Default)]
1036pub struct NamespaceEntry {
1037    pub path: Option<String>,
1038
1039    pub directory: Option<
1040        ::fidl_next::ClientEnd<
1041            ::fidl_next::fuchsia::zx::Channel,
1042            ::fidl_next_fuchsia_io::Directory,
1043        >,
1044    >,
1045}
1046
1047impl NamespaceEntry {
1048    fn __max_ordinal(&self) -> usize {
1049        if self.directory.is_some() {
1050            return 2;
1051        }
1052
1053        if self.path.is_some() {
1054            return 1;
1055        }
1056
1057        0
1058    }
1059}
1060
1061impl ::fidl_next::Encodable for NamespaceEntry {
1062    type Encoded = WireNamespaceEntry<'static>;
1063}
1064
1065unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceEntry
1066where
1067    ___E: ::fidl_next::Encoder + ?Sized,
1068
1069    ___E: ::fidl_next::fuchsia::HandleEncoder,
1070{
1071    #[inline]
1072    fn encode(
1073        mut self,
1074        encoder: &mut ___E,
1075        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1076    ) -> Result<(), ::fidl_next::EncodeError> {
1077        ::fidl_next::munge!(let WireNamespaceEntry { table } = out);
1078
1079        let max_ord = self.__max_ordinal();
1080
1081        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1082        ::fidl_next::Wire::zero_padding(&mut out);
1083
1084        let mut preallocated =
1085            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1086
1087        for i in 1..=max_ord {
1088            match i {
1089                2 => {
1090                    if let Some(directory) = self.directory.take() {
1091                        ::fidl_next::WireEnvelope::encode_value(
1092                            directory,
1093                            preallocated.encoder,
1094                            &mut out,
1095                        )?;
1096                    } else {
1097                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1098                    }
1099                }
1100
1101                1 => {
1102                    if let Some(path) = self.path.take() {
1103                        ::fidl_next::WireEnvelope::encode_value(
1104                            path,
1105                            preallocated.encoder,
1106                            &mut out,
1107                        )?;
1108                    } else {
1109                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1110                    }
1111                }
1112
1113                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1114            }
1115            unsafe {
1116                preallocated.write_next(out.assume_init_ref());
1117            }
1118        }
1119
1120        ::fidl_next::WireTable::encode_len(table, max_ord);
1121
1122        Ok(())
1123    }
1124}
1125
1126impl<'de> ::fidl_next::FromWire<WireNamespaceEntry<'de>> for NamespaceEntry {
1127    #[inline]
1128    fn from_wire(wire: WireNamespaceEntry<'de>) -> Self {
1129        let wire = ::core::mem::ManuallyDrop::new(wire);
1130
1131        let path = wire.table.get(1);
1132
1133        let directory = wire.table.get(2);
1134
1135        Self {
1136            path: path.map(|envelope| {
1137                ::fidl_next::FromWire::from_wire(unsafe {
1138                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
1139                })
1140            }),
1141
1142            directory: directory.map(|envelope| {
1143                ::fidl_next::FromWire::from_wire(unsafe {
1144                    envelope.read_unchecked::<::fidl_next::ClientEnd<
1145                        ::fidl_next::fuchsia::WireChannel,
1146                        ::fidl_next_fuchsia_io::Directory,
1147                    >>()
1148                })
1149            }),
1150        }
1151    }
1152}
1153
1154/// The wire type corresponding to [`NamespaceEntry`].
1155#[repr(C)]
1156pub struct WireNamespaceEntry<'de> {
1157    table: ::fidl_next::WireTable<'de>,
1158}
1159
1160impl<'de> Drop for WireNamespaceEntry<'de> {
1161    fn drop(&mut self) {
1162        let _ = self
1163            .table
1164            .get(1)
1165            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
1166
1167        let _ = self.table.get(2).map(|envelope| unsafe {
1168            envelope.read_unchecked::<::fidl_next::ClientEnd<
1169                ::fidl_next::fuchsia::WireChannel,
1170                ::fidl_next_fuchsia_io::Directory,
1171            >>()
1172        });
1173    }
1174}
1175
1176unsafe impl ::fidl_next::Wire for WireNamespaceEntry<'static> {
1177    type Decoded<'de> = WireNamespaceEntry<'de>;
1178
1179    #[inline]
1180    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1181        ::fidl_next::munge!(let Self { table } = out);
1182        ::fidl_next::WireTable::zero_padding(table);
1183    }
1184}
1185
1186unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceEntry<'static>
1187where
1188    ___D: ::fidl_next::Decoder + ?Sized,
1189
1190    ___D: ::fidl_next::fuchsia::HandleDecoder,
1191{
1192    fn decode(
1193        slot: ::fidl_next::Slot<'_, Self>,
1194        decoder: &mut ___D,
1195    ) -> Result<(), ::fidl_next::DecodeError> {
1196        ::fidl_next::munge!(let Self { table } = slot);
1197
1198        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1199            match ordinal {
1200                0 => unsafe { ::core::hint::unreachable_unchecked() },
1201
1202                1 => {
1203                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
1204                        slot.as_mut(),
1205                        decoder,
1206                    )?;
1207
1208                    let path = unsafe {
1209                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
1210                    };
1211
1212                    if path.len() > 4095 {
1213                        return Err(::fidl_next::DecodeError::VectorTooLong {
1214                            size: path.len() as u64,
1215                            limit: 4095,
1216                        });
1217                    }
1218
1219                    Ok(())
1220                }
1221
1222                2 => {
1223                    ::fidl_next::WireEnvelope::decode_as::<
1224                        ___D,
1225                        ::fidl_next::ClientEnd<
1226                            ::fidl_next::fuchsia::WireChannel,
1227                            ::fidl_next_fuchsia_io::Directory,
1228                        >,
1229                    >(slot.as_mut(), decoder)?;
1230
1231                    Ok(())
1232                }
1233
1234                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1235            }
1236        })
1237    }
1238}
1239
1240impl<'de> WireNamespaceEntry<'de> {
1241    pub fn path(&self) -> Option<&::fidl_next::WireString<'de>> {
1242        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1243    }
1244
1245    pub fn directory(
1246        &self,
1247    ) -> Option<
1248        &::fidl_next::ClientEnd<
1249            ::fidl_next::fuchsia::WireChannel,
1250            ::fidl_next_fuchsia_io::Directory,
1251        >,
1252    > {
1253        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1254    }
1255}
1256
1257impl<'de> ::core::fmt::Debug for WireNamespaceEntry<'de> {
1258    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1259        f.debug_struct("NamespaceEntry")
1260            .field("path", &self.path())
1261            .field("directory", &self.directory())
1262            .finish()
1263    }
1264}
1265
1266#[derive(Debug, Default)]
1267pub struct StartChildArgs {
1268    pub numbered_handles: Option<Vec<::fidl_next_fuchsia_process::HandleInfo>>,
1269
1270    pub namespace_entries: Option<Vec<crate::NamespaceEntry>>,
1271
1272    pub dictionary: Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
1273}
1274
1275impl StartChildArgs {
1276    fn __max_ordinal(&self) -> usize {
1277        if self.dictionary.is_some() {
1278            return 3;
1279        }
1280
1281        if self.namespace_entries.is_some() {
1282            return 2;
1283        }
1284
1285        if self.numbered_handles.is_some() {
1286            return 1;
1287        }
1288
1289        0
1290    }
1291}
1292
1293impl ::fidl_next::Encodable for StartChildArgs {
1294    type Encoded = WireStartChildArgs<'static>;
1295}
1296
1297unsafe impl<___E> ::fidl_next::Encode<___E> for StartChildArgs
1298where
1299    ___E: ::fidl_next::Encoder + ?Sized,
1300
1301    ___E: ::fidl_next::fuchsia::HandleEncoder,
1302{
1303    #[inline]
1304    fn encode(
1305        mut self,
1306        encoder: &mut ___E,
1307        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1308    ) -> Result<(), ::fidl_next::EncodeError> {
1309        ::fidl_next::munge!(let WireStartChildArgs { table } = out);
1310
1311        let max_ord = self.__max_ordinal();
1312
1313        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
1314        ::fidl_next::Wire::zero_padding(&mut out);
1315
1316        let mut preallocated =
1317            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
1318
1319        for i in 1..=max_ord {
1320            match i {
1321                3 => {
1322                    if let Some(dictionary) = self.dictionary.take() {
1323                        ::fidl_next::WireEnvelope::encode_value(
1324                            dictionary,
1325                            preallocated.encoder,
1326                            &mut out,
1327                        )?;
1328                    } else {
1329                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1330                    }
1331                }
1332
1333                2 => {
1334                    if let Some(namespace_entries) = self.namespace_entries.take() {
1335                        ::fidl_next::WireEnvelope::encode_value(
1336                            namespace_entries,
1337                            preallocated.encoder,
1338                            &mut out,
1339                        )?;
1340                    } else {
1341                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1342                    }
1343                }
1344
1345                1 => {
1346                    if let Some(numbered_handles) = self.numbered_handles.take() {
1347                        ::fidl_next::WireEnvelope::encode_value(
1348                            numbered_handles,
1349                            preallocated.encoder,
1350                            &mut out,
1351                        )?;
1352                    } else {
1353                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
1354                    }
1355                }
1356
1357                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
1358            }
1359            unsafe {
1360                preallocated.write_next(out.assume_init_ref());
1361            }
1362        }
1363
1364        ::fidl_next::WireTable::encode_len(table, max_ord);
1365
1366        Ok(())
1367    }
1368}
1369
1370impl<'de> ::fidl_next::FromWire<WireStartChildArgs<'de>> for StartChildArgs {
1371    #[inline]
1372    fn from_wire(wire: WireStartChildArgs<'de>) -> Self {
1373        let wire = ::core::mem::ManuallyDrop::new(wire);
1374
1375        let numbered_handles = wire.table.get(1);
1376
1377        let namespace_entries = wire.table.get(2);
1378
1379        let dictionary = wire.table.get(3);
1380
1381        Self {
1382
1383
1384                numbered_handles: numbered_handles.map(|envelope| ::fidl_next::FromWire::from_wire(
1385                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>>() }
1386                )),
1387
1388
1389                namespace_entries: namespace_entries.map(|envelope| ::fidl_next::FromWire::from_wire(
1390                    unsafe { envelope.read_unchecked::<::fidl_next::WireVector<'de, crate::WireNamespaceEntry<'de>>>() }
1391                )),
1392
1393
1394                dictionary: dictionary.map(|envelope| ::fidl_next::FromWire::from_wire(
1395                    unsafe { envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>() }
1396                )),
1397
1398        }
1399    }
1400}
1401
1402/// The wire type corresponding to [`StartChildArgs`].
1403#[repr(C)]
1404pub struct WireStartChildArgs<'de> {
1405    table: ::fidl_next::WireTable<'de>,
1406}
1407
1408impl<'de> Drop for WireStartChildArgs<'de> {
1409    fn drop(&mut self) {
1410        let _ = self.table.get(1)
1411                .map(|envelope| unsafe {
1412                    envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>>()
1413                });
1414
1415        let _ = self.table.get(2).map(|envelope| unsafe {
1416            envelope
1417                .read_unchecked::<::fidl_next::WireVector<'de, crate::WireNamespaceEntry<'de>>>()
1418        });
1419
1420        let _ = self.table.get(3).map(|envelope| unsafe {
1421            envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>()
1422        });
1423    }
1424}
1425
1426unsafe impl ::fidl_next::Wire for WireStartChildArgs<'static> {
1427    type Decoded<'de> = WireStartChildArgs<'de>;
1428
1429    #[inline]
1430    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1431        ::fidl_next::munge!(let Self { table } = out);
1432        ::fidl_next::WireTable::zero_padding(table);
1433    }
1434}
1435
1436unsafe impl<___D> ::fidl_next::Decode<___D> for WireStartChildArgs<'static>
1437where
1438    ___D: ::fidl_next::Decoder + ?Sized,
1439
1440    ___D: ::fidl_next::fuchsia::HandleDecoder,
1441{
1442    fn decode(
1443        slot: ::fidl_next::Slot<'_, Self>,
1444        decoder: &mut ___D,
1445    ) -> Result<(), ::fidl_next::DecodeError> {
1446        ::fidl_next::munge!(let Self { table } = slot);
1447
1448        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
1449            match ordinal {
1450                0 => unsafe { ::core::hint::unreachable_unchecked() },
1451
1452                1 => {
1453                    ::fidl_next::WireEnvelope::decode_as::<
1454                        ___D,
1455                        ::fidl_next::WireVector<
1456                            'static,
1457                            ::fidl_next_fuchsia_process::WireHandleInfo,
1458                        >,
1459                    >(slot.as_mut(), decoder)?;
1460
1461                    let numbered_handles = unsafe {
1462                        slot
1463                                            .deref_unchecked()
1464                                            .deref_unchecked::<
1465                                                ::fidl_next::WireVector<'_, ::fidl_next_fuchsia_process::WireHandleInfo>
1466                                            >()
1467                    };
1468
1469                    if numbered_handles.len() > 128 {
1470                        return Err(::fidl_next::DecodeError::VectorTooLong {
1471                            size: numbered_handles.len() as u64,
1472                            limit: 128,
1473                        });
1474                    }
1475
1476                    Ok(())
1477                }
1478
1479                2 => {
1480                    ::fidl_next::WireEnvelope::decode_as::<
1481                        ___D,
1482                        ::fidl_next::WireVector<'static, crate::WireNamespaceEntry<'static>>,
1483                    >(slot.as_mut(), decoder)?;
1484
1485                    let namespace_entries = unsafe {
1486                        slot
1487                                            .deref_unchecked()
1488                                            .deref_unchecked::<
1489                                                ::fidl_next::WireVector<'_, crate::WireNamespaceEntry<'_>>
1490                                            >()
1491                    };
1492
1493                    if namespace_entries.len() > 32 {
1494                        return Err(::fidl_next::DecodeError::VectorTooLong {
1495                            size: namespace_entries.len() as u64,
1496                            limit: 32,
1497                        });
1498                    }
1499
1500                    Ok(())
1501                }
1502
1503                3 => {
1504                    ::fidl_next::WireEnvelope::decode_as::<
1505                        ___D,
1506                        ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
1507                    >(slot.as_mut(), decoder)?;
1508
1509                    Ok(())
1510                }
1511
1512                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
1513            }
1514        })
1515    }
1516}
1517
1518impl<'de> WireStartChildArgs<'de> {
1519    pub fn numbered_handles(
1520        &self,
1521    ) -> Option<&::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>> {
1522        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
1523    }
1524
1525    pub fn namespace_entries(
1526        &self,
1527    ) -> Option<&::fidl_next::WireVector<'de, crate::WireNamespaceEntry<'de>>> {
1528        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
1529    }
1530
1531    pub fn dictionary(&self) -> Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
1532        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
1533    }
1534}
1535
1536impl<'de> ::core::fmt::Debug for WireStartChildArgs<'de> {
1537    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
1538        f.debug_struct("StartChildArgs")
1539            .field("numbered_handles", &self.numbered_handles())
1540            .field("namespace_entries", &self.namespace_entries())
1541            .field("dictionary", &self.dictionary())
1542            .finish()
1543    }
1544}
1545
1546#[derive(Debug)]
1547pub struct ControllerStartRequest {
1548    pub args: crate::StartChildArgs,
1549
1550    pub execution_controller:
1551        ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::ExecutionController>,
1552}
1553
1554impl ::fidl_next::Encodable for ControllerStartRequest {
1555    type Encoded = WireControllerStartRequest<'static>;
1556}
1557
1558unsafe impl<___E> ::fidl_next::Encode<___E> for ControllerStartRequest
1559where
1560    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1561
1562    ___E: ::fidl_next::Encoder,
1563
1564    ___E: ::fidl_next::fuchsia::HandleEncoder,
1565{
1566    #[inline]
1567    fn encode(
1568        self,
1569        encoder: &mut ___E,
1570        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1571    ) -> Result<(), ::fidl_next::EncodeError> {
1572        ::fidl_next::munge! {
1573            let Self::Encoded {
1574                args,
1575                execution_controller,
1576
1577            } = out;
1578        }
1579
1580        ::fidl_next::Encode::encode(self.args, encoder, args)?;
1581
1582        ::fidl_next::Encode::encode(self.execution_controller, encoder, execution_controller)?;
1583
1584        Ok(())
1585    }
1586}
1587
1588impl ::fidl_next::EncodableOption for ControllerStartRequest {
1589    type EncodedOption = ::fidl_next::WireBox<'static, WireControllerStartRequest<'static>>;
1590}
1591
1592unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ControllerStartRequest
1593where
1594    ___E: ::fidl_next::Encoder + ?Sized,
1595    ControllerStartRequest: ::fidl_next::Encode<___E>,
1596{
1597    #[inline]
1598    fn encode_option(
1599        this: Option<Self>,
1600        encoder: &mut ___E,
1601        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1602    ) -> Result<(), ::fidl_next::EncodeError> {
1603        if let Some(inner) = this {
1604            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1605            ::fidl_next::WireBox::encode_present(out);
1606        } else {
1607            ::fidl_next::WireBox::encode_absent(out);
1608        }
1609
1610        Ok(())
1611    }
1612}
1613
1614impl<'de> ::fidl_next::FromWire<WireControllerStartRequest<'de>> for ControllerStartRequest {
1615    #[inline]
1616    fn from_wire(wire: WireControllerStartRequest<'de>) -> Self {
1617        Self {
1618            args: ::fidl_next::FromWire::from_wire(wire.args),
1619
1620            execution_controller: ::fidl_next::FromWire::from_wire(wire.execution_controller),
1621        }
1622    }
1623}
1624
1625/// The wire type corresponding to [`ControllerStartRequest`].
1626#[derive(Debug)]
1627#[repr(C)]
1628pub struct WireControllerStartRequest<'de> {
1629    pub args: crate::WireStartChildArgs<'de>,
1630
1631    pub execution_controller:
1632        ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::ExecutionController>,
1633}
1634
1635unsafe impl ::fidl_next::Wire for WireControllerStartRequest<'static> {
1636    type Decoded<'de> = WireControllerStartRequest<'de>;
1637
1638    #[inline]
1639    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
1640        unsafe {
1641            out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
1642        }
1643    }
1644}
1645
1646unsafe impl<___D> ::fidl_next::Decode<___D> for WireControllerStartRequest<'static>
1647where
1648    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1649
1650    ___D: ::fidl_next::Decoder,
1651
1652    ___D: ::fidl_next::fuchsia::HandleDecoder,
1653{
1654    fn decode(
1655        slot: ::fidl_next::Slot<'_, Self>,
1656        decoder: &mut ___D,
1657    ) -> Result<(), ::fidl_next::DecodeError> {
1658        ::fidl_next::munge! {
1659            let Self {
1660                mut args,
1661                mut execution_controller,
1662
1663            } = slot;
1664        }
1665
1666        ::fidl_next::Decode::decode(args.as_mut(), decoder)?;
1667
1668        ::fidl_next::Decode::decode(execution_controller.as_mut(), decoder)?;
1669
1670        Ok(())
1671    }
1672}
1673
1674#[derive(Debug)]
1675#[repr(C)]
1676pub struct ControllerGetExposedDictionaryResponse {
1677    pub dictionary: ::fidl_next_fuchsia_component_sandbox::DictionaryRef,
1678}
1679
1680impl ::fidl_next::Encodable for ControllerGetExposedDictionaryResponse {
1681    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1682        Self,
1683        WireControllerGetExposedDictionaryResponse,
1684    > = unsafe {
1685        ::fidl_next::CopyOptimization::enable_if(
1686            true
1687
1688                && <
1689                    ::fidl_next_fuchsia_component_sandbox::DictionaryRef as ::fidl_next::Encodable
1690                >::COPY_OPTIMIZATION.is_enabled()
1691
1692        )
1693    };
1694
1695    type Encoded = WireControllerGetExposedDictionaryResponse;
1696}
1697
1698unsafe impl<___E> ::fidl_next::Encode<___E> for ControllerGetExposedDictionaryResponse
1699where
1700    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
1701
1702    ___E: ::fidl_next::fuchsia::HandleEncoder,
1703{
1704    #[inline]
1705    fn encode(
1706        self,
1707        encoder: &mut ___E,
1708        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
1709    ) -> Result<(), ::fidl_next::EncodeError> {
1710        ::fidl_next::munge! {
1711            let Self::Encoded {
1712                dictionary,
1713
1714            } = out;
1715        }
1716
1717        ::fidl_next::Encode::encode(self.dictionary, encoder, dictionary)?;
1718
1719        Ok(())
1720    }
1721}
1722
1723impl ::fidl_next::EncodableOption for ControllerGetExposedDictionaryResponse {
1724    type EncodedOption = ::fidl_next::WireBox<'static, WireControllerGetExposedDictionaryResponse>;
1725}
1726
1727unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ControllerGetExposedDictionaryResponse
1728where
1729    ___E: ::fidl_next::Encoder + ?Sized,
1730    ControllerGetExposedDictionaryResponse: ::fidl_next::Encode<___E>,
1731{
1732    #[inline]
1733    fn encode_option(
1734        this: Option<Self>,
1735        encoder: &mut ___E,
1736        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
1737    ) -> Result<(), ::fidl_next::EncodeError> {
1738        if let Some(inner) = this {
1739            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
1740            ::fidl_next::WireBox::encode_present(out);
1741        } else {
1742            ::fidl_next::WireBox::encode_absent(out);
1743        }
1744
1745        Ok(())
1746    }
1747}
1748
1749impl ::fidl_next::FromWire<WireControllerGetExposedDictionaryResponse>
1750    for ControllerGetExposedDictionaryResponse
1751{
1752    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
1753        WireControllerGetExposedDictionaryResponse,
1754        Self,
1755    > = unsafe {
1756        ::fidl_next::CopyOptimization::enable_if(
1757            true
1758
1759                && <
1760                    ::fidl_next_fuchsia_component_sandbox::DictionaryRef as ::fidl_next::FromWire<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>
1761                >::COPY_OPTIMIZATION.is_enabled()
1762
1763        )
1764    };
1765
1766    #[inline]
1767    fn from_wire(wire: WireControllerGetExposedDictionaryResponse) -> Self {
1768        Self { dictionary: ::fidl_next::FromWire::from_wire(wire.dictionary) }
1769    }
1770}
1771
1772/// The wire type corresponding to [`ControllerGetExposedDictionaryResponse`].
1773#[derive(Debug)]
1774#[repr(C)]
1775pub struct WireControllerGetExposedDictionaryResponse {
1776    pub dictionary: ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
1777}
1778
1779unsafe impl ::fidl_next::Wire for WireControllerGetExposedDictionaryResponse {
1780    type Decoded<'de> = WireControllerGetExposedDictionaryResponse;
1781
1782    #[inline]
1783    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
1784}
1785
1786unsafe impl<___D> ::fidl_next::Decode<___D> for WireControllerGetExposedDictionaryResponse
1787where
1788    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
1789
1790    ___D: ::fidl_next::fuchsia::HandleDecoder,
1791{
1792    fn decode(
1793        slot: ::fidl_next::Slot<'_, Self>,
1794        decoder: &mut ___D,
1795    ) -> Result<(), ::fidl_next::DecodeError> {
1796        ::fidl_next::munge! {
1797            let Self {
1798                mut dictionary,
1799
1800            } = slot;
1801        }
1802
1803        ::fidl_next::Decode::decode(dictionary.as_mut(), decoder)?;
1804
1805        Ok(())
1806    }
1807}
1808
1809pub type ControllerDestroyResponse = ();
1810
1811/// The wire type corresponding to [`ControllerDestroyResponse`].
1812pub type WireControllerDestroyResponse = ();
1813
1814/// The type corresponding to the Controller protocol.
1815#[doc = " A protocol used to operate on a component.\n\n One may get access to a `Controller` when creating a component with the\n `Realm.CreateChild` method. You may also obtain a `Controller` for an\n existing child component with the `Realm.OpenController` method.\n"]
1816#[derive(Debug)]
1817pub struct Controller;
1818
1819pub mod controller {
1820    pub mod prelude {
1821        pub use crate::{
1822            controller, Controller, ControllerClientHandler, ControllerClientSender,
1823            ControllerServerHandler, ControllerServerSender,
1824        };
1825
1826        pub use crate::ControllerStartRequest;
1827
1828        pub use crate::ControllerDestroyResponse;
1829
1830        pub use crate::ControllerGetExposedDictionaryResponse;
1831
1832        pub use crate::ControllerIsStartedResponse;
1833
1834        pub use crate::ControllerStartResponse;
1835
1836        pub use crate::Error;
1837    }
1838
1839    pub struct Start;
1840
1841    impl ::fidl_next::Method for Start {
1842        const ORDINAL: u64 = 7532130149195770565;
1843
1844        type Protocol = crate::Controller;
1845
1846        type Request = crate::WireControllerStartRequest<'static>;
1847
1848        type Response = ::fidl_next::WireFlexibleResult<
1849            'static,
1850            crate::WireControllerStartResponse,
1851            crate::WireError,
1852        >;
1853    }
1854
1855    pub struct IsStarted;
1856
1857    impl ::fidl_next::Method for IsStarted {
1858        const ORDINAL: u64 = 2402079833990398915;
1859
1860        type Protocol = crate::Controller;
1861
1862        type Request = ();
1863
1864        type Response = ::fidl_next::WireFlexibleResult<
1865            'static,
1866            crate::WireControllerIsStartedResponse,
1867            crate::WireError,
1868        >;
1869    }
1870
1871    pub struct GetExposedDictionary;
1872
1873    impl ::fidl_next::Method for GetExposedDictionary {
1874        const ORDINAL: u64 = 9099583788120940443;
1875
1876        type Protocol = crate::Controller;
1877
1878        type Request = ();
1879
1880        type Response = ::fidl_next::WireFlexibleResult<
1881            'static,
1882            crate::WireControllerGetExposedDictionaryResponse,
1883            crate::WireError,
1884        >;
1885    }
1886
1887    pub struct Destroy;
1888
1889    impl ::fidl_next::Method for Destroy {
1890        const ORDINAL: u64 = 8381937394141370177;
1891
1892        type Protocol = crate::Controller;
1893
1894        type Request = ();
1895
1896        type Response = ::fidl_next::WireFlexibleResult<
1897            'static,
1898            crate::WireControllerDestroyResponse,
1899            crate::WireError,
1900        >;
1901    }
1902}
1903
1904/// A helper trait for the `Controller` client sender.
1905pub trait ControllerClientSender {
1906    type Transport: ::fidl_next::Transport;
1907
1908    #[doc = " Start the component, optionally providing additional handles to be given\n to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is\n currently running.\n"]
1909    fn start<___R>(
1910        &self,
1911        request: ___R,
1912    ) -> Result<
1913        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Start>,
1914        ::fidl_next::EncodeError,
1915    >
1916    where
1917        ___R: ::fidl_next::Encode<
1918            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1919            Encoded = crate::WireControllerStartRequest<'static>,
1920        >;
1921
1922    #[doc = " Returns true if this instance is currently running.\n"]
1923    fn is_started(
1924        &self,
1925    ) -> Result<
1926        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::IsStarted>,
1927        ::fidl_next::EncodeError,
1928    >;
1929
1930    #[doc = " Returns the dictionary containing the component\'s exposed capabilities.\n"]
1931    fn get_exposed_dictionary(
1932        &self,
1933    ) -> Result<
1934        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::GetExposedDictionary>,
1935        ::fidl_next::EncodeError,
1936    >;
1937
1938    #[doc = " Destroys this component. When this method returns, either:\n\n - Ok was returned, indicating destruction has begun.\n - An error was returned, and destruction will not be attempted.\n\n If Ok was returned, destruction will proceed in the background, but it\n hasn\'t necessarily completed yet. When it completes, the framework will\n close this [Controller] channel.\n\n Errors:\n\n - `ACCESS_DENIED`: Destruction of this component is not allowed.\n Currently, this can happen if the component is a static child of its\n parent.\n"]
1939    fn destroy(
1940        &self,
1941    ) -> Result<
1942        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Destroy>,
1943        ::fidl_next::EncodeError,
1944    >;
1945}
1946
1947impl<___T> ControllerClientSender for ::fidl_next::ClientSender<___T, Controller>
1948where
1949    ___T: ::fidl_next::Transport,
1950{
1951    type Transport = ___T;
1952
1953    #[doc = " Start the component, optionally providing additional handles to be given\n to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is\n currently running.\n"]
1954    fn start<___R>(
1955        &self,
1956        request: ___R,
1957    ) -> Result<
1958        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Start>,
1959        ::fidl_next::EncodeError,
1960    >
1961    where
1962        ___R: ::fidl_next::Encode<
1963            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
1964            Encoded = crate::WireControllerStartRequest<'static>,
1965        >,
1966    {
1967        self.as_untyped()
1968            .send_two_way(7532130149195770565, request)
1969            .map(::fidl_next::ResponseFuture::from_untyped)
1970    }
1971
1972    #[doc = " Returns true if this instance is currently running.\n"]
1973    fn is_started(
1974        &self,
1975    ) -> Result<
1976        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::IsStarted>,
1977        ::fidl_next::EncodeError,
1978    > {
1979        self.as_untyped()
1980            .send_two_way(2402079833990398915, ())
1981            .map(::fidl_next::ResponseFuture::from_untyped)
1982    }
1983
1984    #[doc = " Returns the dictionary containing the component\'s exposed capabilities.\n"]
1985    fn get_exposed_dictionary(
1986        &self,
1987    ) -> Result<
1988        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::GetExposedDictionary>,
1989        ::fidl_next::EncodeError,
1990    > {
1991        self.as_untyped()
1992            .send_two_way(9099583788120940443, ())
1993            .map(::fidl_next::ResponseFuture::from_untyped)
1994    }
1995
1996    #[doc = " Destroys this component. When this method returns, either:\n\n - Ok was returned, indicating destruction has begun.\n - An error was returned, and destruction will not be attempted.\n\n If Ok was returned, destruction will proceed in the background, but it\n hasn\'t necessarily completed yet. When it completes, the framework will\n close this [Controller] channel.\n\n Errors:\n\n - `ACCESS_DENIED`: Destruction of this component is not allowed.\n Currently, this can happen if the component is a static child of its\n parent.\n"]
1997    fn destroy(
1998        &self,
1999    ) -> Result<
2000        ::fidl_next::ResponseFuture<'_, Self::Transport, controller::Destroy>,
2001        ::fidl_next::EncodeError,
2002    > {
2003        self.as_untyped()
2004            .send_two_way(8381937394141370177, ())
2005            .map(::fidl_next::ResponseFuture::from_untyped)
2006    }
2007}
2008
2009/// A client handler for the Controller protocol.
2010///
2011/// See [`Controller`] for more details.
2012pub trait ControllerClientHandler<___T: ::fidl_next::Transport> {
2013    fn on_unknown_interaction(
2014        &mut self,
2015        sender: &::fidl_next::ClientSender<___T, Controller>,
2016        ordinal: u64,
2017    ) {
2018        sender.close();
2019    }
2020}
2021
2022impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Controller
2023where
2024    ___T: ::fidl_next::Transport,
2025    ___H: ControllerClientHandler<___T>,
2026
2027    <controller::Start as ::fidl_next::Method>::Response:
2028        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2029
2030    <controller::IsStarted as ::fidl_next::Method>::Response:
2031        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2032
2033    <controller::GetExposedDictionary as ::fidl_next::Method>::Response:
2034        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2035
2036    <controller::Destroy as ::fidl_next::Method>::Response:
2037        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2038{
2039    fn on_event(
2040        handler: &mut ___H,
2041        sender: &::fidl_next::ClientSender<___T, Self>,
2042        ordinal: u64,
2043        buffer: ___T::RecvBuffer,
2044    ) {
2045        match ordinal {
2046            ordinal => handler.on_unknown_interaction(sender, ordinal),
2047        }
2048    }
2049}
2050
2051/// A helper trait for the `Controller` server sender.
2052pub trait ControllerServerSender {
2053    type Transport: ::fidl_next::Transport;
2054}
2055
2056impl<___T> ControllerServerSender for ::fidl_next::ServerSender<___T, Controller>
2057where
2058    ___T: ::fidl_next::Transport,
2059{
2060    type Transport = ___T;
2061}
2062
2063/// A server handler for the Controller protocol.
2064///
2065/// See [`Controller`] for more details.
2066pub trait ControllerServerHandler<___T: ::fidl_next::Transport> {
2067    #[doc = " Start the component, optionally providing additional handles to be given\n to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is\n currently running.\n"]
2068    fn start(
2069        &mut self,
2070        sender: &::fidl_next::ServerSender<___T, Controller>,
2071
2072        request: ::fidl_next::Request<___T, controller::Start>,
2073
2074        responder: ::fidl_next::Responder<controller::Start>,
2075    );
2076
2077    #[doc = " Returns true if this instance is currently running.\n"]
2078    fn is_started(
2079        &mut self,
2080        sender: &::fidl_next::ServerSender<___T, Controller>,
2081
2082        responder: ::fidl_next::Responder<controller::IsStarted>,
2083    );
2084
2085    #[doc = " Returns the dictionary containing the component\'s exposed capabilities.\n"]
2086    fn get_exposed_dictionary(
2087        &mut self,
2088        sender: &::fidl_next::ServerSender<___T, Controller>,
2089
2090        responder: ::fidl_next::Responder<controller::GetExposedDictionary>,
2091    );
2092
2093    #[doc = " Destroys this component. When this method returns, either:\n\n - Ok was returned, indicating destruction has begun.\n - An error was returned, and destruction will not be attempted.\n\n If Ok was returned, destruction will proceed in the background, but it\n hasn\'t necessarily completed yet. When it completes, the framework will\n close this [Controller] channel.\n\n Errors:\n\n - `ACCESS_DENIED`: Destruction of this component is not allowed.\n Currently, this can happen if the component is a static child of its\n parent.\n"]
2094    fn destroy(
2095        &mut self,
2096        sender: &::fidl_next::ServerSender<___T, Controller>,
2097
2098        responder: ::fidl_next::Responder<controller::Destroy>,
2099    );
2100
2101    fn on_unknown_interaction(
2102        &mut self,
2103        sender: &::fidl_next::ServerSender<___T, Controller>,
2104        ordinal: u64,
2105    ) {
2106        sender.close();
2107    }
2108}
2109
2110impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Controller
2111where
2112    ___T: ::fidl_next::Transport,
2113    ___H: ControllerServerHandler<___T>,
2114
2115    <controller::Start as ::fidl_next::Method>::Request:
2116        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
2117{
2118    fn on_one_way(
2119        handler: &mut ___H,
2120        sender: &::fidl_next::ServerSender<___T, Self>,
2121        ordinal: u64,
2122        buffer: ___T::RecvBuffer,
2123    ) {
2124        match ordinal {
2125            ordinal => handler.on_unknown_interaction(sender, ordinal),
2126        }
2127    }
2128
2129    fn on_two_way(
2130        handler: &mut ___H,
2131        sender: &::fidl_next::ServerSender<___T, Self>,
2132        ordinal: u64,
2133        buffer: ___T::RecvBuffer,
2134        responder: ::fidl_next::protocol::Responder,
2135    ) {
2136        match ordinal {
2137            7532130149195770565 => {
2138                let responder = ::fidl_next::Responder::from_untyped(responder);
2139
2140                match ::fidl_next::DecoderExt::decode(buffer) {
2141                    Ok(decoded) => handler.start(sender, decoded, responder),
2142                    Err(e) => {
2143                        sender.close();
2144                    }
2145                }
2146            }
2147
2148            2402079833990398915 => {
2149                let responder = ::fidl_next::Responder::from_untyped(responder);
2150
2151                handler.is_started(sender, responder);
2152            }
2153
2154            9099583788120940443 => {
2155                let responder = ::fidl_next::Responder::from_untyped(responder);
2156
2157                handler.get_exposed_dictionary(sender, responder);
2158            }
2159
2160            8381937394141370177 => {
2161                let responder = ::fidl_next::Responder::from_untyped(responder);
2162
2163                handler.destroy(sender, responder);
2164            }
2165
2166            ordinal => handler.on_unknown_interaction(sender, ordinal),
2167        }
2168    }
2169}
2170
2171#[doc = " The maximum number of dynamic offers that can target a created component.\n"]
2172pub const MAX_DYNAMIC_OFFER_COUNT: u32 = 128;
2173
2174#[derive(Debug, Default)]
2175pub struct CreateChildArgs {
2176    pub numbered_handles: Option<Vec<::fidl_next_fuchsia_process::HandleInfo>>,
2177
2178    pub dynamic_offers: Option<Vec<::fidl_next_fuchsia_component_decl::Offer>>,
2179
2180    pub controller:
2181        Option<::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Controller>>,
2182
2183    pub dictionary: Option<::fidl_next_fuchsia_component_sandbox::DictionaryRef>,
2184}
2185
2186impl CreateChildArgs {
2187    fn __max_ordinal(&self) -> usize {
2188        if self.dictionary.is_some() {
2189            return 4;
2190        }
2191
2192        if self.controller.is_some() {
2193            return 3;
2194        }
2195
2196        if self.dynamic_offers.is_some() {
2197            return 2;
2198        }
2199
2200        if self.numbered_handles.is_some() {
2201            return 1;
2202        }
2203
2204        0
2205    }
2206}
2207
2208impl ::fidl_next::Encodable for CreateChildArgs {
2209    type Encoded = WireCreateChildArgs<'static>;
2210}
2211
2212unsafe impl<___E> ::fidl_next::Encode<___E> for CreateChildArgs
2213where
2214    ___E: ::fidl_next::Encoder + ?Sized,
2215
2216    ___E: ::fidl_next::fuchsia::HandleEncoder,
2217{
2218    #[inline]
2219    fn encode(
2220        mut self,
2221        encoder: &mut ___E,
2222        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2223    ) -> Result<(), ::fidl_next::EncodeError> {
2224        ::fidl_next::munge!(let WireCreateChildArgs { table } = out);
2225
2226        let max_ord = self.__max_ordinal();
2227
2228        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2229        ::fidl_next::Wire::zero_padding(&mut out);
2230
2231        let mut preallocated =
2232            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2233
2234        for i in 1..=max_ord {
2235            match i {
2236                4 => {
2237                    if let Some(dictionary) = self.dictionary.take() {
2238                        ::fidl_next::WireEnvelope::encode_value(
2239                            dictionary,
2240                            preallocated.encoder,
2241                            &mut out,
2242                        )?;
2243                    } else {
2244                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2245                    }
2246                }
2247
2248                3 => {
2249                    if let Some(controller) = self.controller.take() {
2250                        ::fidl_next::WireEnvelope::encode_value(
2251                            controller,
2252                            preallocated.encoder,
2253                            &mut out,
2254                        )?;
2255                    } else {
2256                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2257                    }
2258                }
2259
2260                2 => {
2261                    if let Some(dynamic_offers) = self.dynamic_offers.take() {
2262                        ::fidl_next::WireEnvelope::encode_value(
2263                            dynamic_offers,
2264                            preallocated.encoder,
2265                            &mut out,
2266                        )?;
2267                    } else {
2268                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2269                    }
2270                }
2271
2272                1 => {
2273                    if let Some(numbered_handles) = self.numbered_handles.take() {
2274                        ::fidl_next::WireEnvelope::encode_value(
2275                            numbered_handles,
2276                            preallocated.encoder,
2277                            &mut out,
2278                        )?;
2279                    } else {
2280                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2281                    }
2282                }
2283
2284                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2285            }
2286            unsafe {
2287                preallocated.write_next(out.assume_init_ref());
2288            }
2289        }
2290
2291        ::fidl_next::WireTable::encode_len(table, max_ord);
2292
2293        Ok(())
2294    }
2295}
2296
2297impl<'de> ::fidl_next::FromWire<WireCreateChildArgs<'de>> for CreateChildArgs {
2298    #[inline]
2299    fn from_wire(wire: WireCreateChildArgs<'de>) -> Self {
2300        let wire = ::core::mem::ManuallyDrop::new(wire);
2301
2302        let numbered_handles = wire.table.get(1);
2303
2304        let dynamic_offers = wire.table.get(2);
2305
2306        let controller = wire.table.get(3);
2307
2308        let dictionary = wire.table.get(4);
2309
2310        Self {
2311            numbered_handles:
2312                numbered_handles.map(|envelope| {
2313                    ::fidl_next::FromWire::from_wire(unsafe {
2314                        envelope.read_unchecked::<::fidl_next::WireVector<
2315                            'de,
2316                            ::fidl_next_fuchsia_process::WireHandleInfo,
2317                        >>()
2318                    })
2319                }),
2320
2321            dynamic_offers: dynamic_offers.map(|envelope| {
2322                ::fidl_next::FromWire::from_wire(unsafe {
2323                    envelope.read_unchecked::<::fidl_next::WireVector<
2324                        'de,
2325                        ::fidl_next_fuchsia_component_decl::WireOffer<'de>,
2326                    >>()
2327                })
2328            }),
2329
2330            controller:
2331                controller.map(|envelope| {
2332                    ::fidl_next::FromWire::from_wire(unsafe {
2333                        envelope.read_unchecked::<::fidl_next::ServerEnd<
2334                            ::fidl_next::fuchsia::WireChannel,
2335                            crate::Controller,
2336                        >>()
2337                    })
2338                }),
2339
2340            dictionary: dictionary.map(|envelope| {
2341                ::fidl_next::FromWire::from_wire(unsafe {
2342                    envelope
2343                        .read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>(
2344                        )
2345                })
2346            }),
2347        }
2348    }
2349}
2350
2351/// The wire type corresponding to [`CreateChildArgs`].
2352#[repr(C)]
2353pub struct WireCreateChildArgs<'de> {
2354    table: ::fidl_next::WireTable<'de>,
2355}
2356
2357impl<'de> Drop for WireCreateChildArgs<'de> {
2358    fn drop(&mut self) {
2359        let _ = self.table.get(1)
2360                .map(|envelope| unsafe {
2361                    envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>>()
2362                });
2363
2364        let _ = self.table.get(2)
2365                .map(|envelope| unsafe {
2366                    envelope.read_unchecked::<::fidl_next::WireVector<'de, ::fidl_next_fuchsia_component_decl::WireOffer<'de>>>()
2367                });
2368
2369        let _ = self.table.get(3)
2370                .map(|envelope| unsafe {
2371                    envelope.read_unchecked::<::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel,crate::Controller,
2372        >>()
2373                });
2374
2375        let _ = self.table.get(4).map(|envelope| unsafe {
2376            envelope.read_unchecked::<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>()
2377        });
2378    }
2379}
2380
2381unsafe impl ::fidl_next::Wire for WireCreateChildArgs<'static> {
2382    type Decoded<'de> = WireCreateChildArgs<'de>;
2383
2384    #[inline]
2385    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2386        ::fidl_next::munge!(let Self { table } = out);
2387        ::fidl_next::WireTable::zero_padding(table);
2388    }
2389}
2390
2391unsafe impl<___D> ::fidl_next::Decode<___D> for WireCreateChildArgs<'static>
2392where
2393    ___D: ::fidl_next::Decoder + ?Sized,
2394
2395    ___D: ::fidl_next::fuchsia::HandleDecoder,
2396{
2397    fn decode(
2398        slot: ::fidl_next::Slot<'_, Self>,
2399        decoder: &mut ___D,
2400    ) -> Result<(), ::fidl_next::DecodeError> {
2401        ::fidl_next::munge!(let Self { table } = slot);
2402
2403        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2404            match ordinal {
2405                0 => unsafe { ::core::hint::unreachable_unchecked() },
2406
2407                1 => {
2408                    ::fidl_next::WireEnvelope::decode_as::<
2409                        ___D,
2410                        ::fidl_next::WireVector<
2411                            'static,
2412                            ::fidl_next_fuchsia_process::WireHandleInfo,
2413                        >,
2414                    >(slot.as_mut(), decoder)?;
2415
2416                    let numbered_handles = unsafe {
2417                        slot
2418                                            .deref_unchecked()
2419                                            .deref_unchecked::<
2420                                                ::fidl_next::WireVector<'_, ::fidl_next_fuchsia_process::WireHandleInfo>
2421                                            >()
2422                    };
2423
2424                    if numbered_handles.len() > 128 {
2425                        return Err(::fidl_next::DecodeError::VectorTooLong {
2426                            size: numbered_handles.len() as u64,
2427                            limit: 128,
2428                        });
2429                    }
2430
2431                    Ok(())
2432                }
2433
2434                2 => {
2435                    ::fidl_next::WireEnvelope::decode_as::<
2436                        ___D,
2437                        ::fidl_next::WireVector<
2438                            'static,
2439                            ::fidl_next_fuchsia_component_decl::WireOffer<'static>,
2440                        >,
2441                    >(slot.as_mut(), decoder)?;
2442
2443                    let dynamic_offers = unsafe {
2444                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireVector<
2445                            '_,
2446                            ::fidl_next_fuchsia_component_decl::WireOffer<'_>,
2447                        >>()
2448                    };
2449
2450                    if dynamic_offers.len() > 128 {
2451                        return Err(::fidl_next::DecodeError::VectorTooLong {
2452                            size: dynamic_offers.len() as u64,
2453                            limit: 128,
2454                        });
2455                    }
2456
2457                    Ok(())
2458                }
2459
2460                3 => {
2461                    ::fidl_next::WireEnvelope::decode_as::<
2462                        ___D,
2463                        ::fidl_next::ServerEnd<
2464                            ::fidl_next::fuchsia::WireChannel,
2465                            crate::Controller,
2466                        >,
2467                    >(slot.as_mut(), decoder)?;
2468
2469                    Ok(())
2470                }
2471
2472                4 => {
2473                    ::fidl_next::WireEnvelope::decode_as::<
2474                        ___D,
2475                        ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
2476                    >(slot.as_mut(), decoder)?;
2477
2478                    Ok(())
2479                }
2480
2481                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2482            }
2483        })
2484    }
2485}
2486
2487impl<'de> WireCreateChildArgs<'de> {
2488    pub fn numbered_handles(
2489        &self,
2490    ) -> Option<&::fidl_next::WireVector<'de, ::fidl_next_fuchsia_process::WireHandleInfo>> {
2491        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2492    }
2493
2494    pub fn dynamic_offers(
2495        &self,
2496    ) -> Option<&::fidl_next::WireVector<'de, ::fidl_next_fuchsia_component_decl::WireOffer<'de>>>
2497    {
2498        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2499    }
2500
2501    pub fn controller(
2502        &self,
2503    ) -> Option<&::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Controller>> {
2504        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
2505    }
2506
2507    pub fn dictionary(&self) -> Option<&::fidl_next_fuchsia_component_sandbox::WireDictionaryRef> {
2508        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
2509    }
2510}
2511
2512impl<'de> ::core::fmt::Debug for WireCreateChildArgs<'de> {
2513    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2514        f.debug_struct("CreateChildArgs")
2515            .field("numbered_handles", &self.numbered_handles())
2516            .field("dynamic_offers", &self.dynamic_offers())
2517            .field("controller", &self.controller())
2518            .field("dictionary", &self.dictionary())
2519            .finish()
2520    }
2521}
2522
2523#[doc = " Payload for DebugStarted events.\n"]
2524#[derive(Debug, Default)]
2525pub struct DebugStartedPayload {
2526    pub runtime_dir: Option<
2527        ::fidl_next::ClientEnd<
2528            ::fidl_next::fuchsia::zx::Channel,
2529            ::fidl_next_fuchsia_io::Directory,
2530        >,
2531    >,
2532
2533    pub break_on_start: Option<::fidl_next::fuchsia::zx::Handle>,
2534}
2535
2536impl DebugStartedPayload {
2537    fn __max_ordinal(&self) -> usize {
2538        if self.break_on_start.is_some() {
2539            return 2;
2540        }
2541
2542        if self.runtime_dir.is_some() {
2543            return 1;
2544        }
2545
2546        0
2547    }
2548}
2549
2550impl ::fidl_next::Encodable for DebugStartedPayload {
2551    type Encoded = WireDebugStartedPayload<'static>;
2552}
2553
2554unsafe impl<___E> ::fidl_next::Encode<___E> for DebugStartedPayload
2555where
2556    ___E: ::fidl_next::Encoder + ?Sized,
2557
2558    ___E: ::fidl_next::fuchsia::HandleEncoder,
2559{
2560    #[inline]
2561    fn encode(
2562        mut self,
2563        encoder: &mut ___E,
2564        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2565    ) -> Result<(), ::fidl_next::EncodeError> {
2566        ::fidl_next::munge!(let WireDebugStartedPayload { table } = out);
2567
2568        let max_ord = self.__max_ordinal();
2569
2570        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2571        ::fidl_next::Wire::zero_padding(&mut out);
2572
2573        let mut preallocated =
2574            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2575
2576        for i in 1..=max_ord {
2577            match i {
2578                2 => {
2579                    if let Some(break_on_start) = self.break_on_start.take() {
2580                        ::fidl_next::WireEnvelope::encode_value(
2581                            break_on_start,
2582                            preallocated.encoder,
2583                            &mut out,
2584                        )?;
2585                    } else {
2586                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2587                    }
2588                }
2589
2590                1 => {
2591                    if let Some(runtime_dir) = self.runtime_dir.take() {
2592                        ::fidl_next::WireEnvelope::encode_value(
2593                            runtime_dir,
2594                            preallocated.encoder,
2595                            &mut out,
2596                        )?;
2597                    } else {
2598                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2599                    }
2600                }
2601
2602                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2603            }
2604            unsafe {
2605                preallocated.write_next(out.assume_init_ref());
2606            }
2607        }
2608
2609        ::fidl_next::WireTable::encode_len(table, max_ord);
2610
2611        Ok(())
2612    }
2613}
2614
2615impl<'de> ::fidl_next::FromWire<WireDebugStartedPayload<'de>> for DebugStartedPayload {
2616    #[inline]
2617    fn from_wire(wire: WireDebugStartedPayload<'de>) -> Self {
2618        let wire = ::core::mem::ManuallyDrop::new(wire);
2619
2620        let runtime_dir = wire.table.get(1);
2621
2622        let break_on_start = wire.table.get(2);
2623
2624        Self {
2625            runtime_dir: runtime_dir.map(|envelope| {
2626                ::fidl_next::FromWire::from_wire(unsafe {
2627                    envelope.read_unchecked::<::fidl_next::ClientEnd<
2628                        ::fidl_next::fuchsia::WireChannel,
2629                        ::fidl_next_fuchsia_io::Directory,
2630                    >>()
2631                })
2632            }),
2633
2634            break_on_start: break_on_start.map(|envelope| {
2635                ::fidl_next::FromWire::from_wire(unsafe {
2636                    envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
2637                })
2638            }),
2639        }
2640    }
2641}
2642
2643/// The wire type corresponding to [`DebugStartedPayload`].
2644#[repr(C)]
2645pub struct WireDebugStartedPayload<'de> {
2646    table: ::fidl_next::WireTable<'de>,
2647}
2648
2649impl<'de> Drop for WireDebugStartedPayload<'de> {
2650    fn drop(&mut self) {
2651        let _ = self.table.get(1).map(|envelope| unsafe {
2652            envelope.read_unchecked::<::fidl_next::ClientEnd<
2653                ::fidl_next::fuchsia::WireChannel,
2654                ::fidl_next_fuchsia_io::Directory,
2655            >>()
2656        });
2657
2658        let _ = self.table.get(2).map(|envelope| unsafe {
2659            envelope.read_unchecked::<::fidl_next::fuchsia::WireHandle>()
2660        });
2661    }
2662}
2663
2664unsafe impl ::fidl_next::Wire for WireDebugStartedPayload<'static> {
2665    type Decoded<'de> = WireDebugStartedPayload<'de>;
2666
2667    #[inline]
2668    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2669        ::fidl_next::munge!(let Self { table } = out);
2670        ::fidl_next::WireTable::zero_padding(table);
2671    }
2672}
2673
2674unsafe impl<___D> ::fidl_next::Decode<___D> for WireDebugStartedPayload<'static>
2675where
2676    ___D: ::fidl_next::Decoder + ?Sized,
2677
2678    ___D: ::fidl_next::fuchsia::HandleDecoder,
2679{
2680    fn decode(
2681        slot: ::fidl_next::Slot<'_, Self>,
2682        decoder: &mut ___D,
2683    ) -> Result<(), ::fidl_next::DecodeError> {
2684        ::fidl_next::munge!(let Self { table } = slot);
2685
2686        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2687            match ordinal {
2688                0 => unsafe { ::core::hint::unreachable_unchecked() },
2689
2690                1 => {
2691                    ::fidl_next::WireEnvelope::decode_as::<
2692                        ___D,
2693                        ::fidl_next::ClientEnd<
2694                            ::fidl_next::fuchsia::WireChannel,
2695                            ::fidl_next_fuchsia_io::Directory,
2696                        >,
2697                    >(slot.as_mut(), decoder)?;
2698
2699                    Ok(())
2700                }
2701
2702                2 => {
2703                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::fuchsia::WireHandle>(
2704                        slot.as_mut(),
2705                        decoder,
2706                    )?;
2707
2708                    Ok(())
2709                }
2710
2711                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2712            }
2713        })
2714    }
2715}
2716
2717impl<'de> WireDebugStartedPayload<'de> {
2718    pub fn runtime_dir(
2719        &self,
2720    ) -> Option<
2721        &::fidl_next::ClientEnd<
2722            ::fidl_next::fuchsia::WireChannel,
2723            ::fidl_next_fuchsia_io::Directory,
2724        >,
2725    > {
2726        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
2727    }
2728
2729    pub fn break_on_start(&self) -> Option<&::fidl_next::fuchsia::WireHandle> {
2730        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
2731    }
2732}
2733
2734impl<'de> ::core::fmt::Debug for WireDebugStartedPayload<'de> {
2735    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2736        f.debug_struct("DebugStartedPayload")
2737            .field("runtime_dir", &self.runtime_dir())
2738            .field("break_on_start", &self.break_on_start())
2739            .finish()
2740    }
2741}
2742
2743#[doc = " Payload for Destroyed events.\n"]
2744#[derive(Clone, Debug, Default)]
2745pub struct DestroyedPayload {}
2746
2747impl DestroyedPayload {
2748    fn __max_ordinal(&self) -> usize {
2749        0
2750    }
2751}
2752
2753impl ::fidl_next::Encodable for DestroyedPayload {
2754    type Encoded = WireDestroyedPayload<'static>;
2755}
2756
2757unsafe impl<___E> ::fidl_next::Encode<___E> for DestroyedPayload
2758where
2759    ___E: ::fidl_next::Encoder + ?Sized,
2760{
2761    #[inline]
2762    fn encode(
2763        mut self,
2764        encoder: &mut ___E,
2765        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2766    ) -> Result<(), ::fidl_next::EncodeError> {
2767        ::fidl_next::munge!(let WireDestroyedPayload { table } = out);
2768
2769        let max_ord = self.__max_ordinal();
2770
2771        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2772        ::fidl_next::Wire::zero_padding(&mut out);
2773
2774        let mut preallocated =
2775            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2776
2777        for i in 1..=max_ord {
2778            match i {
2779                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2780            }
2781            unsafe {
2782                preallocated.write_next(out.assume_init_ref());
2783            }
2784        }
2785
2786        ::fidl_next::WireTable::encode_len(table, max_ord);
2787
2788        Ok(())
2789    }
2790}
2791
2792unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DestroyedPayload
2793where
2794    ___E: ::fidl_next::Encoder + ?Sized,
2795{
2796    #[inline]
2797    fn encode_ref(
2798        &self,
2799        encoder: &mut ___E,
2800        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2801    ) -> Result<(), ::fidl_next::EncodeError> {
2802        ::fidl_next::munge!(let WireDestroyedPayload { table } = out);
2803
2804        let max_ord = self.__max_ordinal();
2805
2806        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2807        ::fidl_next::Wire::zero_padding(&mut out);
2808
2809        let mut preallocated =
2810            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2811
2812        for i in 1..=max_ord {
2813            match i {
2814                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2815            }
2816            unsafe {
2817                preallocated.write_next(out.assume_init_ref());
2818            }
2819        }
2820
2821        ::fidl_next::WireTable::encode_len(table, max_ord);
2822
2823        Ok(())
2824    }
2825}
2826
2827impl<'de> ::fidl_next::FromWire<WireDestroyedPayload<'de>> for DestroyedPayload {
2828    #[inline]
2829    fn from_wire(wire: WireDestroyedPayload<'de>) -> Self {
2830        let wire = ::core::mem::ManuallyDrop::new(wire);
2831
2832        Self {}
2833    }
2834}
2835
2836impl<'de> ::fidl_next::FromWireRef<WireDestroyedPayload<'de>> for DestroyedPayload {
2837    #[inline]
2838    fn from_wire_ref(wire: &WireDestroyedPayload<'de>) -> Self {
2839        Self {}
2840    }
2841}
2842
2843/// The wire type corresponding to [`DestroyedPayload`].
2844#[repr(C)]
2845pub struct WireDestroyedPayload<'de> {
2846    table: ::fidl_next::WireTable<'de>,
2847}
2848
2849impl<'de> Drop for WireDestroyedPayload<'de> {
2850    fn drop(&mut self) {}
2851}
2852
2853unsafe impl ::fidl_next::Wire for WireDestroyedPayload<'static> {
2854    type Decoded<'de> = WireDestroyedPayload<'de>;
2855
2856    #[inline]
2857    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
2858        ::fidl_next::munge!(let Self { table } = out);
2859        ::fidl_next::WireTable::zero_padding(table);
2860    }
2861}
2862
2863unsafe impl<___D> ::fidl_next::Decode<___D> for WireDestroyedPayload<'static>
2864where
2865    ___D: ::fidl_next::Decoder + ?Sized,
2866{
2867    fn decode(
2868        slot: ::fidl_next::Slot<'_, Self>,
2869        decoder: &mut ___D,
2870    ) -> Result<(), ::fidl_next::DecodeError> {
2871        ::fidl_next::munge!(let Self { table } = slot);
2872
2873        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
2874            match ordinal {
2875                0 => unsafe { ::core::hint::unreachable_unchecked() },
2876
2877                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
2878            }
2879        })
2880    }
2881}
2882
2883impl<'de> WireDestroyedPayload<'de> {}
2884
2885impl<'de> ::core::fmt::Debug for WireDestroyedPayload<'de> {
2886    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
2887        f.debug_struct("DestroyedPayload").finish()
2888    }
2889}
2890
2891#[doc = " Payload for DirectoryReady events\n"]
2892#[derive(Debug, Default)]
2893pub struct DirectoryReadyPayload {
2894    pub name: Option<String>,
2895
2896    pub node: Option<
2897        ::fidl_next::ClientEnd<::fidl_next::fuchsia::zx::Channel, ::fidl_next_fuchsia_io::Node>,
2898    >,
2899}
2900
2901impl DirectoryReadyPayload {
2902    fn __max_ordinal(&self) -> usize {
2903        if self.node.is_some() {
2904            return 2;
2905        }
2906
2907        if self.name.is_some() {
2908            return 1;
2909        }
2910
2911        0
2912    }
2913}
2914
2915impl ::fidl_next::Encodable for DirectoryReadyPayload {
2916    type Encoded = WireDirectoryReadyPayload<'static>;
2917}
2918
2919unsafe impl<___E> ::fidl_next::Encode<___E> for DirectoryReadyPayload
2920where
2921    ___E: ::fidl_next::Encoder + ?Sized,
2922
2923    ___E: ::fidl_next::fuchsia::HandleEncoder,
2924{
2925    #[inline]
2926    fn encode(
2927        mut self,
2928        encoder: &mut ___E,
2929        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
2930    ) -> Result<(), ::fidl_next::EncodeError> {
2931        ::fidl_next::munge!(let WireDirectoryReadyPayload { table } = out);
2932
2933        let max_ord = self.__max_ordinal();
2934
2935        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
2936        ::fidl_next::Wire::zero_padding(&mut out);
2937
2938        let mut preallocated =
2939            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
2940
2941        for i in 1..=max_ord {
2942            match i {
2943                2 => {
2944                    if let Some(node) = self.node.take() {
2945                        ::fidl_next::WireEnvelope::encode_value(
2946                            node,
2947                            preallocated.encoder,
2948                            &mut out,
2949                        )?;
2950                    } else {
2951                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2952                    }
2953                }
2954
2955                1 => {
2956                    if let Some(name) = self.name.take() {
2957                        ::fidl_next::WireEnvelope::encode_value(
2958                            name,
2959                            preallocated.encoder,
2960                            &mut out,
2961                        )?;
2962                    } else {
2963                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
2964                    }
2965                }
2966
2967                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
2968            }
2969            unsafe {
2970                preallocated.write_next(out.assume_init_ref());
2971            }
2972        }
2973
2974        ::fidl_next::WireTable::encode_len(table, max_ord);
2975
2976        Ok(())
2977    }
2978}
2979
2980impl<'de> ::fidl_next::FromWire<WireDirectoryReadyPayload<'de>> for DirectoryReadyPayload {
2981    #[inline]
2982    fn from_wire(wire: WireDirectoryReadyPayload<'de>) -> Self {
2983        let wire = ::core::mem::ManuallyDrop::new(wire);
2984
2985        let name = wire.table.get(1);
2986
2987        let node = wire.table.get(2);
2988
2989        Self {
2990            name: name.map(|envelope| {
2991                ::fidl_next::FromWire::from_wire(unsafe {
2992                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
2993                })
2994            }),
2995
2996            node: node.map(|envelope| {
2997                ::fidl_next::FromWire::from_wire(unsafe {
2998                    envelope.read_unchecked::<::fidl_next::ClientEnd<
2999                        ::fidl_next::fuchsia::WireChannel,
3000                        ::fidl_next_fuchsia_io::Node,
3001                    >>()
3002                })
3003            }),
3004        }
3005    }
3006}
3007
3008/// The wire type corresponding to [`DirectoryReadyPayload`].
3009#[repr(C)]
3010pub struct WireDirectoryReadyPayload<'de> {
3011    table: ::fidl_next::WireTable<'de>,
3012}
3013
3014impl<'de> Drop for WireDirectoryReadyPayload<'de> {
3015    fn drop(&mut self) {
3016        let _ = self
3017            .table
3018            .get(1)
3019            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
3020
3021        let _ = self.table.get(2).map(|envelope| unsafe {
3022            envelope.read_unchecked::<::fidl_next::ClientEnd<
3023                ::fidl_next::fuchsia::WireChannel,
3024                ::fidl_next_fuchsia_io::Node,
3025            >>()
3026        });
3027    }
3028}
3029
3030unsafe impl ::fidl_next::Wire for WireDirectoryReadyPayload<'static> {
3031    type Decoded<'de> = WireDirectoryReadyPayload<'de>;
3032
3033    #[inline]
3034    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3035        ::fidl_next::munge!(let Self { table } = out);
3036        ::fidl_next::WireTable::zero_padding(table);
3037    }
3038}
3039
3040unsafe impl<___D> ::fidl_next::Decode<___D> for WireDirectoryReadyPayload<'static>
3041where
3042    ___D: ::fidl_next::Decoder + ?Sized,
3043
3044    ___D: ::fidl_next::fuchsia::HandleDecoder,
3045{
3046    fn decode(
3047        slot: ::fidl_next::Slot<'_, Self>,
3048        decoder: &mut ___D,
3049    ) -> Result<(), ::fidl_next::DecodeError> {
3050        ::fidl_next::munge!(let Self { table } = slot);
3051
3052        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3053            match ordinal {
3054                0 => unsafe { ::core::hint::unreachable_unchecked() },
3055
3056                1 => {
3057                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
3058                        slot.as_mut(),
3059                        decoder,
3060                    )?;
3061
3062                    let name = unsafe {
3063                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
3064                    };
3065
3066                    if name.len() > 255 {
3067                        return Err(::fidl_next::DecodeError::VectorTooLong {
3068                            size: name.len() as u64,
3069                            limit: 255,
3070                        });
3071                    }
3072
3073                    Ok(())
3074                }
3075
3076                2 => {
3077                    ::fidl_next::WireEnvelope::decode_as::<
3078                        ___D,
3079                        ::fidl_next::ClientEnd<
3080                            ::fidl_next::fuchsia::WireChannel,
3081                            ::fidl_next_fuchsia_io::Node,
3082                        >,
3083                    >(slot.as_mut(), decoder)?;
3084
3085                    Ok(())
3086                }
3087
3088                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3089            }
3090        })
3091    }
3092}
3093
3094impl<'de> WireDirectoryReadyPayload<'de> {
3095    pub fn name(&self) -> Option<&::fidl_next::WireString<'de>> {
3096        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
3097    }
3098
3099    pub fn node(
3100        &self,
3101    ) -> Option<
3102        &::fidl_next::ClientEnd<::fidl_next::fuchsia::WireChannel, ::fidl_next_fuchsia_io::Node>,
3103    > {
3104        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
3105    }
3106}
3107
3108impl<'de> ::core::fmt::Debug for WireDirectoryReadyPayload<'de> {
3109    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3110        f.debug_struct("DirectoryReadyPayload")
3111            .field("name", &self.name())
3112            .field("node", &self.node())
3113            .finish()
3114    }
3115}
3116
3117#[doc = " Payload for Discovered events.\n"]
3118#[derive(Clone, Debug, Default)]
3119pub struct DiscoveredPayload {}
3120
3121impl DiscoveredPayload {
3122    fn __max_ordinal(&self) -> usize {
3123        0
3124    }
3125}
3126
3127impl ::fidl_next::Encodable for DiscoveredPayload {
3128    type Encoded = WireDiscoveredPayload<'static>;
3129}
3130
3131unsafe impl<___E> ::fidl_next::Encode<___E> for DiscoveredPayload
3132where
3133    ___E: ::fidl_next::Encoder + ?Sized,
3134{
3135    #[inline]
3136    fn encode(
3137        mut self,
3138        encoder: &mut ___E,
3139        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3140    ) -> Result<(), ::fidl_next::EncodeError> {
3141        ::fidl_next::munge!(let WireDiscoveredPayload { table } = out);
3142
3143        let max_ord = self.__max_ordinal();
3144
3145        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3146        ::fidl_next::Wire::zero_padding(&mut out);
3147
3148        let mut preallocated =
3149            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3150
3151        for i in 1..=max_ord {
3152            match i {
3153                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3154            }
3155            unsafe {
3156                preallocated.write_next(out.assume_init_ref());
3157            }
3158        }
3159
3160        ::fidl_next::WireTable::encode_len(table, max_ord);
3161
3162        Ok(())
3163    }
3164}
3165
3166unsafe impl<___E> ::fidl_next::EncodeRef<___E> for DiscoveredPayload
3167where
3168    ___E: ::fidl_next::Encoder + ?Sized,
3169{
3170    #[inline]
3171    fn encode_ref(
3172        &self,
3173        encoder: &mut ___E,
3174        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3175    ) -> Result<(), ::fidl_next::EncodeError> {
3176        ::fidl_next::munge!(let WireDiscoveredPayload { table } = out);
3177
3178        let max_ord = self.__max_ordinal();
3179
3180        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3181        ::fidl_next::Wire::zero_padding(&mut out);
3182
3183        let mut preallocated =
3184            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3185
3186        for i in 1..=max_ord {
3187            match i {
3188                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3189            }
3190            unsafe {
3191                preallocated.write_next(out.assume_init_ref());
3192            }
3193        }
3194
3195        ::fidl_next::WireTable::encode_len(table, max_ord);
3196
3197        Ok(())
3198    }
3199}
3200
3201impl<'de> ::fidl_next::FromWire<WireDiscoveredPayload<'de>> for DiscoveredPayload {
3202    #[inline]
3203    fn from_wire(wire: WireDiscoveredPayload<'de>) -> Self {
3204        let wire = ::core::mem::ManuallyDrop::new(wire);
3205
3206        Self {}
3207    }
3208}
3209
3210impl<'de> ::fidl_next::FromWireRef<WireDiscoveredPayload<'de>> for DiscoveredPayload {
3211    #[inline]
3212    fn from_wire_ref(wire: &WireDiscoveredPayload<'de>) -> Self {
3213        Self {}
3214    }
3215}
3216
3217/// The wire type corresponding to [`DiscoveredPayload`].
3218#[repr(C)]
3219pub struct WireDiscoveredPayload<'de> {
3220    table: ::fidl_next::WireTable<'de>,
3221}
3222
3223impl<'de> Drop for WireDiscoveredPayload<'de> {
3224    fn drop(&mut self) {}
3225}
3226
3227unsafe impl ::fidl_next::Wire for WireDiscoveredPayload<'static> {
3228    type Decoded<'de> = WireDiscoveredPayload<'de>;
3229
3230    #[inline]
3231    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3232        ::fidl_next::munge!(let Self { table } = out);
3233        ::fidl_next::WireTable::zero_padding(table);
3234    }
3235}
3236
3237unsafe impl<___D> ::fidl_next::Decode<___D> for WireDiscoveredPayload<'static>
3238where
3239    ___D: ::fidl_next::Decoder + ?Sized,
3240{
3241    fn decode(
3242        slot: ::fidl_next::Slot<'_, Self>,
3243        decoder: &mut ___D,
3244    ) -> Result<(), ::fidl_next::DecodeError> {
3245        ::fidl_next::munge!(let Self { table } = slot);
3246
3247        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3248            match ordinal {
3249                0 => unsafe { ::core::hint::unreachable_unchecked() },
3250
3251                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3252            }
3253        })
3254    }
3255}
3256
3257impl<'de> WireDiscoveredPayload<'de> {}
3258
3259impl<'de> ::core::fmt::Debug for WireDiscoveredPayload<'de> {
3260    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3261        f.debug_struct("DiscoveredPayload").finish()
3262    }
3263}
3264
3265pub const MAX_MONIKER_LENGTH: u32 = 4096;
3266
3267#[doc = " Payload for Purged events.\n"]
3268#[derive(Clone, Debug, Default)]
3269pub struct PurgedPayload {}
3270
3271impl PurgedPayload {
3272    fn __max_ordinal(&self) -> usize {
3273        0
3274    }
3275}
3276
3277impl ::fidl_next::Encodable for PurgedPayload {
3278    type Encoded = WirePurgedPayload<'static>;
3279}
3280
3281unsafe impl<___E> ::fidl_next::Encode<___E> for PurgedPayload
3282where
3283    ___E: ::fidl_next::Encoder + ?Sized,
3284{
3285    #[inline]
3286    fn encode(
3287        mut self,
3288        encoder: &mut ___E,
3289        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3290    ) -> Result<(), ::fidl_next::EncodeError> {
3291        ::fidl_next::munge!(let WirePurgedPayload { table } = out);
3292
3293        let max_ord = self.__max_ordinal();
3294
3295        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3296        ::fidl_next::Wire::zero_padding(&mut out);
3297
3298        let mut preallocated =
3299            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3300
3301        for i in 1..=max_ord {
3302            match i {
3303                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3304            }
3305            unsafe {
3306                preallocated.write_next(out.assume_init_ref());
3307            }
3308        }
3309
3310        ::fidl_next::WireTable::encode_len(table, max_ord);
3311
3312        Ok(())
3313    }
3314}
3315
3316unsafe impl<___E> ::fidl_next::EncodeRef<___E> for PurgedPayload
3317where
3318    ___E: ::fidl_next::Encoder + ?Sized,
3319{
3320    #[inline]
3321    fn encode_ref(
3322        &self,
3323        encoder: &mut ___E,
3324        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3325    ) -> Result<(), ::fidl_next::EncodeError> {
3326        ::fidl_next::munge!(let WirePurgedPayload { table } = out);
3327
3328        let max_ord = self.__max_ordinal();
3329
3330        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3331        ::fidl_next::Wire::zero_padding(&mut out);
3332
3333        let mut preallocated =
3334            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3335
3336        for i in 1..=max_ord {
3337            match i {
3338                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3339            }
3340            unsafe {
3341                preallocated.write_next(out.assume_init_ref());
3342            }
3343        }
3344
3345        ::fidl_next::WireTable::encode_len(table, max_ord);
3346
3347        Ok(())
3348    }
3349}
3350
3351impl<'de> ::fidl_next::FromWire<WirePurgedPayload<'de>> for PurgedPayload {
3352    #[inline]
3353    fn from_wire(wire: WirePurgedPayload<'de>) -> Self {
3354        let wire = ::core::mem::ManuallyDrop::new(wire);
3355
3356        Self {}
3357    }
3358}
3359
3360impl<'de> ::fidl_next::FromWireRef<WirePurgedPayload<'de>> for PurgedPayload {
3361    #[inline]
3362    fn from_wire_ref(wire: &WirePurgedPayload<'de>) -> Self {
3363        Self {}
3364    }
3365}
3366
3367/// The wire type corresponding to [`PurgedPayload`].
3368#[repr(C)]
3369pub struct WirePurgedPayload<'de> {
3370    table: ::fidl_next::WireTable<'de>,
3371}
3372
3373impl<'de> Drop for WirePurgedPayload<'de> {
3374    fn drop(&mut self) {}
3375}
3376
3377unsafe impl ::fidl_next::Wire for WirePurgedPayload<'static> {
3378    type Decoded<'de> = WirePurgedPayload<'de>;
3379
3380    #[inline]
3381    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3382        ::fidl_next::munge!(let Self { table } = out);
3383        ::fidl_next::WireTable::zero_padding(table);
3384    }
3385}
3386
3387unsafe impl<___D> ::fidl_next::Decode<___D> for WirePurgedPayload<'static>
3388where
3389    ___D: ::fidl_next::Decoder + ?Sized,
3390{
3391    fn decode(
3392        slot: ::fidl_next::Slot<'_, Self>,
3393        decoder: &mut ___D,
3394    ) -> Result<(), ::fidl_next::DecodeError> {
3395        ::fidl_next::munge!(let Self { table } = slot);
3396
3397        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3398            match ordinal {
3399                0 => unsafe { ::core::hint::unreachable_unchecked() },
3400
3401                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3402            }
3403        })
3404    }
3405}
3406
3407impl<'de> WirePurgedPayload<'de> {}
3408
3409impl<'de> ::core::fmt::Debug for WirePurgedPayload<'de> {
3410    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3411        f.debug_struct("PurgedPayload").finish()
3412    }
3413}
3414
3415#[doc = " Payload for Resolved events.\n"]
3416#[derive(Clone, Debug, Default)]
3417pub struct ResolvedPayload {}
3418
3419impl ResolvedPayload {
3420    fn __max_ordinal(&self) -> usize {
3421        0
3422    }
3423}
3424
3425impl ::fidl_next::Encodable for ResolvedPayload {
3426    type Encoded = WireResolvedPayload<'static>;
3427}
3428
3429unsafe impl<___E> ::fidl_next::Encode<___E> for ResolvedPayload
3430where
3431    ___E: ::fidl_next::Encoder + ?Sized,
3432{
3433    #[inline]
3434    fn encode(
3435        mut self,
3436        encoder: &mut ___E,
3437        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3438    ) -> Result<(), ::fidl_next::EncodeError> {
3439        ::fidl_next::munge!(let WireResolvedPayload { table } = out);
3440
3441        let max_ord = self.__max_ordinal();
3442
3443        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3444        ::fidl_next::Wire::zero_padding(&mut out);
3445
3446        let mut preallocated =
3447            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3448
3449        for i in 1..=max_ord {
3450            match i {
3451                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3452            }
3453            unsafe {
3454                preallocated.write_next(out.assume_init_ref());
3455            }
3456        }
3457
3458        ::fidl_next::WireTable::encode_len(table, max_ord);
3459
3460        Ok(())
3461    }
3462}
3463
3464unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ResolvedPayload
3465where
3466    ___E: ::fidl_next::Encoder + ?Sized,
3467{
3468    #[inline]
3469    fn encode_ref(
3470        &self,
3471        encoder: &mut ___E,
3472        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3473    ) -> Result<(), ::fidl_next::EncodeError> {
3474        ::fidl_next::munge!(let WireResolvedPayload { table } = out);
3475
3476        let max_ord = self.__max_ordinal();
3477
3478        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3479        ::fidl_next::Wire::zero_padding(&mut out);
3480
3481        let mut preallocated =
3482            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3483
3484        for i in 1..=max_ord {
3485            match i {
3486                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3487            }
3488            unsafe {
3489                preallocated.write_next(out.assume_init_ref());
3490            }
3491        }
3492
3493        ::fidl_next::WireTable::encode_len(table, max_ord);
3494
3495        Ok(())
3496    }
3497}
3498
3499impl<'de> ::fidl_next::FromWire<WireResolvedPayload<'de>> for ResolvedPayload {
3500    #[inline]
3501    fn from_wire(wire: WireResolvedPayload<'de>) -> Self {
3502        let wire = ::core::mem::ManuallyDrop::new(wire);
3503
3504        Self {}
3505    }
3506}
3507
3508impl<'de> ::fidl_next::FromWireRef<WireResolvedPayload<'de>> for ResolvedPayload {
3509    #[inline]
3510    fn from_wire_ref(wire: &WireResolvedPayload<'de>) -> Self {
3511        Self {}
3512    }
3513}
3514
3515/// The wire type corresponding to [`ResolvedPayload`].
3516#[repr(C)]
3517pub struct WireResolvedPayload<'de> {
3518    table: ::fidl_next::WireTable<'de>,
3519}
3520
3521impl<'de> Drop for WireResolvedPayload<'de> {
3522    fn drop(&mut self) {}
3523}
3524
3525unsafe impl ::fidl_next::Wire for WireResolvedPayload<'static> {
3526    type Decoded<'de> = WireResolvedPayload<'de>;
3527
3528    #[inline]
3529    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3530        ::fidl_next::munge!(let Self { table } = out);
3531        ::fidl_next::WireTable::zero_padding(table);
3532    }
3533}
3534
3535unsafe impl<___D> ::fidl_next::Decode<___D> for WireResolvedPayload<'static>
3536where
3537    ___D: ::fidl_next::Decoder + ?Sized,
3538{
3539    fn decode(
3540        slot: ::fidl_next::Slot<'_, Self>,
3541        decoder: &mut ___D,
3542    ) -> Result<(), ::fidl_next::DecodeError> {
3543        ::fidl_next::munge!(let Self { table } = slot);
3544
3545        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3546            match ordinal {
3547                0 => unsafe { ::core::hint::unreachable_unchecked() },
3548
3549                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3550            }
3551        })
3552    }
3553}
3554
3555impl<'de> WireResolvedPayload<'de> {}
3556
3557impl<'de> ::core::fmt::Debug for WireResolvedPayload<'de> {
3558    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3559        f.debug_struct("ResolvedPayload").finish()
3560    }
3561}
3562
3563#[doc = " Payload for Started events.\n"]
3564#[derive(Clone, Debug, Default)]
3565pub struct StartedPayload {}
3566
3567impl StartedPayload {
3568    fn __max_ordinal(&self) -> usize {
3569        0
3570    }
3571}
3572
3573impl ::fidl_next::Encodable for StartedPayload {
3574    type Encoded = WireStartedPayload<'static>;
3575}
3576
3577unsafe impl<___E> ::fidl_next::Encode<___E> for StartedPayload
3578where
3579    ___E: ::fidl_next::Encoder + ?Sized,
3580{
3581    #[inline]
3582    fn encode(
3583        mut self,
3584        encoder: &mut ___E,
3585        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3586    ) -> Result<(), ::fidl_next::EncodeError> {
3587        ::fidl_next::munge!(let WireStartedPayload { table } = out);
3588
3589        let max_ord = self.__max_ordinal();
3590
3591        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3592        ::fidl_next::Wire::zero_padding(&mut out);
3593
3594        let mut preallocated =
3595            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3596
3597        for i in 1..=max_ord {
3598            match i {
3599                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3600            }
3601            unsafe {
3602                preallocated.write_next(out.assume_init_ref());
3603            }
3604        }
3605
3606        ::fidl_next::WireTable::encode_len(table, max_ord);
3607
3608        Ok(())
3609    }
3610}
3611
3612unsafe impl<___E> ::fidl_next::EncodeRef<___E> for StartedPayload
3613where
3614    ___E: ::fidl_next::Encoder + ?Sized,
3615{
3616    #[inline]
3617    fn encode_ref(
3618        &self,
3619        encoder: &mut ___E,
3620        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3621    ) -> Result<(), ::fidl_next::EncodeError> {
3622        ::fidl_next::munge!(let WireStartedPayload { table } = out);
3623
3624        let max_ord = self.__max_ordinal();
3625
3626        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3627        ::fidl_next::Wire::zero_padding(&mut out);
3628
3629        let mut preallocated =
3630            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3631
3632        for i in 1..=max_ord {
3633            match i {
3634                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3635            }
3636            unsafe {
3637                preallocated.write_next(out.assume_init_ref());
3638            }
3639        }
3640
3641        ::fidl_next::WireTable::encode_len(table, max_ord);
3642
3643        Ok(())
3644    }
3645}
3646
3647impl<'de> ::fidl_next::FromWire<WireStartedPayload<'de>> for StartedPayload {
3648    #[inline]
3649    fn from_wire(wire: WireStartedPayload<'de>) -> Self {
3650        let wire = ::core::mem::ManuallyDrop::new(wire);
3651
3652        Self {}
3653    }
3654}
3655
3656impl<'de> ::fidl_next::FromWireRef<WireStartedPayload<'de>> for StartedPayload {
3657    #[inline]
3658    fn from_wire_ref(wire: &WireStartedPayload<'de>) -> Self {
3659        Self {}
3660    }
3661}
3662
3663/// The wire type corresponding to [`StartedPayload`].
3664#[repr(C)]
3665pub struct WireStartedPayload<'de> {
3666    table: ::fidl_next::WireTable<'de>,
3667}
3668
3669impl<'de> Drop for WireStartedPayload<'de> {
3670    fn drop(&mut self) {}
3671}
3672
3673unsafe impl ::fidl_next::Wire for WireStartedPayload<'static> {
3674    type Decoded<'de> = WireStartedPayload<'de>;
3675
3676    #[inline]
3677    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3678        ::fidl_next::munge!(let Self { table } = out);
3679        ::fidl_next::WireTable::zero_padding(table);
3680    }
3681}
3682
3683unsafe impl<___D> ::fidl_next::Decode<___D> for WireStartedPayload<'static>
3684where
3685    ___D: ::fidl_next::Decoder + ?Sized,
3686{
3687    fn decode(
3688        slot: ::fidl_next::Slot<'_, Self>,
3689        decoder: &mut ___D,
3690    ) -> Result<(), ::fidl_next::DecodeError> {
3691        ::fidl_next::munge!(let Self { table } = slot);
3692
3693        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3694            match ordinal {
3695                0 => unsafe { ::core::hint::unreachable_unchecked() },
3696
3697                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3698            }
3699        })
3700    }
3701}
3702
3703impl<'de> WireStartedPayload<'de> {}
3704
3705impl<'de> ::core::fmt::Debug for WireStartedPayload<'de> {
3706    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3707        f.debug_struct("StartedPayload").finish()
3708    }
3709}
3710
3711#[doc = " Payload for Unresolved events.\n"]
3712#[derive(Clone, Debug, Default)]
3713pub struct UnresolvedPayload {}
3714
3715impl UnresolvedPayload {
3716    fn __max_ordinal(&self) -> usize {
3717        0
3718    }
3719}
3720
3721impl ::fidl_next::Encodable for UnresolvedPayload {
3722    type Encoded = WireUnresolvedPayload<'static>;
3723}
3724
3725unsafe impl<___E> ::fidl_next::Encode<___E> for UnresolvedPayload
3726where
3727    ___E: ::fidl_next::Encoder + ?Sized,
3728{
3729    #[inline]
3730    fn encode(
3731        mut self,
3732        encoder: &mut ___E,
3733        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3734    ) -> Result<(), ::fidl_next::EncodeError> {
3735        ::fidl_next::munge!(let WireUnresolvedPayload { table } = out);
3736
3737        let max_ord = self.__max_ordinal();
3738
3739        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3740        ::fidl_next::Wire::zero_padding(&mut out);
3741
3742        let mut preallocated =
3743            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3744
3745        for i in 1..=max_ord {
3746            match i {
3747                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3748            }
3749            unsafe {
3750                preallocated.write_next(out.assume_init_ref());
3751            }
3752        }
3753
3754        ::fidl_next::WireTable::encode_len(table, max_ord);
3755
3756        Ok(())
3757    }
3758}
3759
3760unsafe impl<___E> ::fidl_next::EncodeRef<___E> for UnresolvedPayload
3761where
3762    ___E: ::fidl_next::Encoder + ?Sized,
3763{
3764    #[inline]
3765    fn encode_ref(
3766        &self,
3767        encoder: &mut ___E,
3768        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3769    ) -> Result<(), ::fidl_next::EncodeError> {
3770        ::fidl_next::munge!(let WireUnresolvedPayload { table } = out);
3771
3772        let max_ord = self.__max_ordinal();
3773
3774        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3775        ::fidl_next::Wire::zero_padding(&mut out);
3776
3777        let mut preallocated =
3778            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3779
3780        for i in 1..=max_ord {
3781            match i {
3782                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3783            }
3784            unsafe {
3785                preallocated.write_next(out.assume_init_ref());
3786            }
3787        }
3788
3789        ::fidl_next::WireTable::encode_len(table, max_ord);
3790
3791        Ok(())
3792    }
3793}
3794
3795impl<'de> ::fidl_next::FromWire<WireUnresolvedPayload<'de>> for UnresolvedPayload {
3796    #[inline]
3797    fn from_wire(wire: WireUnresolvedPayload<'de>) -> Self {
3798        let wire = ::core::mem::ManuallyDrop::new(wire);
3799
3800        Self {}
3801    }
3802}
3803
3804impl<'de> ::fidl_next::FromWireRef<WireUnresolvedPayload<'de>> for UnresolvedPayload {
3805    #[inline]
3806    fn from_wire_ref(wire: &WireUnresolvedPayload<'de>) -> Self {
3807        Self {}
3808    }
3809}
3810
3811/// The wire type corresponding to [`UnresolvedPayload`].
3812#[repr(C)]
3813pub struct WireUnresolvedPayload<'de> {
3814    table: ::fidl_next::WireTable<'de>,
3815}
3816
3817impl<'de> Drop for WireUnresolvedPayload<'de> {
3818    fn drop(&mut self) {}
3819}
3820
3821unsafe impl ::fidl_next::Wire for WireUnresolvedPayload<'static> {
3822    type Decoded<'de> = WireUnresolvedPayload<'de>;
3823
3824    #[inline]
3825    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
3826        ::fidl_next::munge!(let Self { table } = out);
3827        ::fidl_next::WireTable::zero_padding(table);
3828    }
3829}
3830
3831unsafe impl<___D> ::fidl_next::Decode<___D> for WireUnresolvedPayload<'static>
3832where
3833    ___D: ::fidl_next::Decoder + ?Sized,
3834{
3835    fn decode(
3836        slot: ::fidl_next::Slot<'_, Self>,
3837        decoder: &mut ___D,
3838    ) -> Result<(), ::fidl_next::DecodeError> {
3839        ::fidl_next::munge!(let Self { table } = slot);
3840
3841        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
3842            match ordinal {
3843                0 => unsafe { ::core::hint::unreachable_unchecked() },
3844
3845                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
3846            }
3847        })
3848    }
3849}
3850
3851impl<'de> WireUnresolvedPayload<'de> {}
3852
3853impl<'de> ::core::fmt::Debug for WireUnresolvedPayload<'de> {
3854    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
3855        f.debug_struct("UnresolvedPayload").finish()
3856    }
3857}
3858
3859#[doc = " Payload for Stopped events.\n"]
3860#[derive(Clone, Debug, Default)]
3861pub struct StoppedPayload {
3862    pub status: Option<i32>,
3863
3864    pub exit_code: Option<i64>,
3865}
3866
3867impl StoppedPayload {
3868    fn __max_ordinal(&self) -> usize {
3869        if self.exit_code.is_some() {
3870            return 2;
3871        }
3872
3873        if self.status.is_some() {
3874            return 1;
3875        }
3876
3877        0
3878    }
3879}
3880
3881impl ::fidl_next::Encodable for StoppedPayload {
3882    type Encoded = WireStoppedPayload<'static>;
3883}
3884
3885unsafe impl<___E> ::fidl_next::Encode<___E> for StoppedPayload
3886where
3887    ___E: ::fidl_next::Encoder + ?Sized,
3888{
3889    #[inline]
3890    fn encode(
3891        mut self,
3892        encoder: &mut ___E,
3893        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3894    ) -> Result<(), ::fidl_next::EncodeError> {
3895        ::fidl_next::munge!(let WireStoppedPayload { table } = out);
3896
3897        let max_ord = self.__max_ordinal();
3898
3899        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3900        ::fidl_next::Wire::zero_padding(&mut out);
3901
3902        let mut preallocated =
3903            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3904
3905        for i in 1..=max_ord {
3906            match i {
3907                2 => {
3908                    if let Some(exit_code) = self.exit_code.take() {
3909                        ::fidl_next::WireEnvelope::encode_value(
3910                            exit_code,
3911                            preallocated.encoder,
3912                            &mut out,
3913                        )?;
3914                    } else {
3915                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3916                    }
3917                }
3918
3919                1 => {
3920                    if let Some(status) = self.status.take() {
3921                        ::fidl_next::WireEnvelope::encode_value(
3922                            status,
3923                            preallocated.encoder,
3924                            &mut out,
3925                        )?;
3926                    } else {
3927                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3928                    }
3929                }
3930
3931                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3932            }
3933            unsafe {
3934                preallocated.write_next(out.assume_init_ref());
3935            }
3936        }
3937
3938        ::fidl_next::WireTable::encode_len(table, max_ord);
3939
3940        Ok(())
3941    }
3942}
3943
3944unsafe impl<___E> ::fidl_next::EncodeRef<___E> for StoppedPayload
3945where
3946    ___E: ::fidl_next::Encoder + ?Sized,
3947{
3948    #[inline]
3949    fn encode_ref(
3950        &self,
3951        encoder: &mut ___E,
3952        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
3953    ) -> Result<(), ::fidl_next::EncodeError> {
3954        ::fidl_next::munge!(let WireStoppedPayload { table } = out);
3955
3956        let max_ord = self.__max_ordinal();
3957
3958        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
3959        ::fidl_next::Wire::zero_padding(&mut out);
3960
3961        let mut preallocated =
3962            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
3963
3964        for i in 1..=max_ord {
3965            match i {
3966                2 => {
3967                    if let Some(exit_code) = &self.exit_code {
3968                        ::fidl_next::WireEnvelope::encode_value(
3969                            exit_code,
3970                            preallocated.encoder,
3971                            &mut out,
3972                        )?;
3973                    } else {
3974                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3975                    }
3976                }
3977
3978                1 => {
3979                    if let Some(status) = &self.status {
3980                        ::fidl_next::WireEnvelope::encode_value(
3981                            status,
3982                            preallocated.encoder,
3983                            &mut out,
3984                        )?;
3985                    } else {
3986                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
3987                    }
3988                }
3989
3990                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
3991            }
3992            unsafe {
3993                preallocated.write_next(out.assume_init_ref());
3994            }
3995        }
3996
3997        ::fidl_next::WireTable::encode_len(table, max_ord);
3998
3999        Ok(())
4000    }
4001}
4002
4003impl<'de> ::fidl_next::FromWire<WireStoppedPayload<'de>> for StoppedPayload {
4004    #[inline]
4005    fn from_wire(wire: WireStoppedPayload<'de>) -> Self {
4006        let wire = ::core::mem::ManuallyDrop::new(wire);
4007
4008        let status = wire.table.get(1);
4009
4010        let exit_code = wire.table.get(2);
4011
4012        Self {
4013            status: status.map(|envelope| {
4014                ::fidl_next::FromWire::from_wire(unsafe {
4015                    envelope.read_unchecked::<::fidl_next::WireI32>()
4016                })
4017            }),
4018
4019            exit_code: exit_code.map(|envelope| {
4020                ::fidl_next::FromWire::from_wire(unsafe {
4021                    envelope.read_unchecked::<::fidl_next::WireI64>()
4022                })
4023            }),
4024        }
4025    }
4026}
4027
4028impl<'de> ::fidl_next::FromWireRef<WireStoppedPayload<'de>> for StoppedPayload {
4029    #[inline]
4030    fn from_wire_ref(wire: &WireStoppedPayload<'de>) -> Self {
4031        Self {
4032            status: wire.table.get(1).map(|envelope| {
4033                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4034                    envelope.deref_unchecked::<::fidl_next::WireI32>()
4035                })
4036            }),
4037
4038            exit_code: wire.table.get(2).map(|envelope| {
4039                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4040                    envelope.deref_unchecked::<::fidl_next::WireI64>()
4041                })
4042            }),
4043        }
4044    }
4045}
4046
4047/// The wire type corresponding to [`StoppedPayload`].
4048#[repr(C)]
4049pub struct WireStoppedPayload<'de> {
4050    table: ::fidl_next::WireTable<'de>,
4051}
4052
4053impl<'de> Drop for WireStoppedPayload<'de> {
4054    fn drop(&mut self) {
4055        let _ = self
4056            .table
4057            .get(1)
4058            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireI32>() });
4059
4060        let _ = self
4061            .table
4062            .get(2)
4063            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireI64>() });
4064    }
4065}
4066
4067unsafe impl ::fidl_next::Wire for WireStoppedPayload<'static> {
4068    type Decoded<'de> = WireStoppedPayload<'de>;
4069
4070    #[inline]
4071    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4072        ::fidl_next::munge!(let Self { table } = out);
4073        ::fidl_next::WireTable::zero_padding(table);
4074    }
4075}
4076
4077unsafe impl<___D> ::fidl_next::Decode<___D> for WireStoppedPayload<'static>
4078where
4079    ___D: ::fidl_next::Decoder + ?Sized,
4080{
4081    fn decode(
4082        slot: ::fidl_next::Slot<'_, Self>,
4083        decoder: &mut ___D,
4084    ) -> Result<(), ::fidl_next::DecodeError> {
4085        ::fidl_next::munge!(let Self { table } = slot);
4086
4087        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4088            match ordinal {
4089                0 => unsafe { ::core::hint::unreachable_unchecked() },
4090
4091                1 => {
4092                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI32>(
4093                        slot.as_mut(),
4094                        decoder,
4095                    )?;
4096
4097                    Ok(())
4098                }
4099
4100                2 => {
4101                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI64>(
4102                        slot.as_mut(),
4103                        decoder,
4104                    )?;
4105
4106                    Ok(())
4107                }
4108
4109                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4110            }
4111        })
4112    }
4113}
4114
4115impl<'de> WireStoppedPayload<'de> {
4116    pub fn status(&self) -> Option<&::fidl_next::WireI32> {
4117        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4118    }
4119
4120    pub fn exit_code(&self) -> Option<&::fidl_next::WireI64> {
4121        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4122    }
4123}
4124
4125impl<'de> ::core::fmt::Debug for WireStoppedPayload<'de> {
4126    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4127        f.debug_struct("StoppedPayload")
4128            .field("status", &self.status())
4129            .field("exit_code", &self.exit_code())
4130            .finish()
4131    }
4132}
4133
4134#[doc = " These EventTypes are used for the EventStream protocol.\n They are FIDL versions of the EventType enum in hooks.rs and have\n the same meaning.\n"]
4135#[derive(Clone, Copy, Debug, PartialEq, Eq)]
4136#[repr(u32)]
4137pub enum EventType {
4138    CapabilityRequested = 1,
4139    DirectoryReady = 2,
4140    Discovered = 3,
4141    Destroyed = 4,
4142    Resolved = 5,
4143    Started = 6,
4144    Stopped = 7,
4145    DebugStarted = 8,
4146    Unresolved = 9,
4147}
4148
4149impl ::fidl_next::Encodable for EventType {
4150    type Encoded = WireEventType;
4151}
4152impl ::std::convert::TryFrom<u32> for EventType {
4153    type Error = ::fidl_next::UnknownStrictEnumMemberError;
4154    fn try_from(value: u32) -> Result<Self, Self::Error> {
4155        match value {
4156            1 => Ok(Self::CapabilityRequested),
4157            2 => Ok(Self::DirectoryReady),
4158            3 => Ok(Self::Discovered),
4159            4 => Ok(Self::Destroyed),
4160            5 => Ok(Self::Resolved),
4161            6 => Ok(Self::Started),
4162            7 => Ok(Self::Stopped),
4163            8 => Ok(Self::DebugStarted),
4164            9 => Ok(Self::Unresolved),
4165
4166            _ => Err(Self::Error::new(value.into())),
4167        }
4168    }
4169}
4170
4171unsafe impl<___E> ::fidl_next::Encode<___E> for EventType
4172where
4173    ___E: ?Sized,
4174{
4175    #[inline]
4176    fn encode(
4177        self,
4178        encoder: &mut ___E,
4179        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4180    ) -> Result<(), ::fidl_next::EncodeError> {
4181        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
4182    }
4183}
4184
4185unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EventType
4186where
4187    ___E: ?Sized,
4188{
4189    #[inline]
4190    fn encode_ref(
4191        &self,
4192        encoder: &mut ___E,
4193        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4194    ) -> Result<(), ::fidl_next::EncodeError> {
4195        ::fidl_next::munge!(let WireEventType { value } = out);
4196        let _ = value.write(::fidl_next::WireU32::from(match *self {
4197            Self::CapabilityRequested => 1,
4198
4199            Self::DirectoryReady => 2,
4200
4201            Self::Discovered => 3,
4202
4203            Self::Destroyed => 4,
4204
4205            Self::Resolved => 5,
4206
4207            Self::Started => 6,
4208
4209            Self::Stopped => 7,
4210
4211            Self::DebugStarted => 8,
4212
4213            Self::Unresolved => 9,
4214        }));
4215
4216        Ok(())
4217    }
4218}
4219
4220impl ::core::convert::From<WireEventType> for EventType {
4221    fn from(wire: WireEventType) -> Self {
4222        match u32::from(wire.value) {
4223            1 => Self::CapabilityRequested,
4224
4225            2 => Self::DirectoryReady,
4226
4227            3 => Self::Discovered,
4228
4229            4 => Self::Destroyed,
4230
4231            5 => Self::Resolved,
4232
4233            6 => Self::Started,
4234
4235            7 => Self::Stopped,
4236
4237            8 => Self::DebugStarted,
4238
4239            9 => Self::Unresolved,
4240
4241            _ => unsafe { ::core::hint::unreachable_unchecked() },
4242        }
4243    }
4244}
4245
4246impl ::fidl_next::FromWire<WireEventType> for EventType {
4247    #[inline]
4248    fn from_wire(wire: WireEventType) -> Self {
4249        Self::from(wire)
4250    }
4251}
4252
4253impl ::fidl_next::FromWireRef<WireEventType> for EventType {
4254    #[inline]
4255    fn from_wire_ref(wire: &WireEventType) -> Self {
4256        Self::from(*wire)
4257    }
4258}
4259
4260/// The wire type corresponding to [`EventType`].
4261#[derive(Clone, Copy, Debug, PartialEq, Eq)]
4262#[repr(transparent)]
4263pub struct WireEventType {
4264    value: ::fidl_next::WireU32,
4265}
4266
4267unsafe impl ::fidl_next::Wire for WireEventType {
4268    type Decoded<'de> = Self;
4269
4270    #[inline]
4271    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
4272        // Wire enums have no padding
4273    }
4274}
4275
4276impl WireEventType {
4277    pub const CAPABILITY_REQUESTED: WireEventType =
4278        WireEventType { value: ::fidl_next::WireU32(1) };
4279
4280    pub const DIRECTORY_READY: WireEventType = WireEventType { value: ::fidl_next::WireU32(2) };
4281
4282    pub const DISCOVERED: WireEventType = WireEventType { value: ::fidl_next::WireU32(3) };
4283
4284    pub const DESTROYED: WireEventType = WireEventType { value: ::fidl_next::WireU32(4) };
4285
4286    pub const RESOLVED: WireEventType = WireEventType { value: ::fidl_next::WireU32(5) };
4287
4288    pub const STARTED: WireEventType = WireEventType { value: ::fidl_next::WireU32(6) };
4289
4290    pub const STOPPED: WireEventType = WireEventType { value: ::fidl_next::WireU32(7) };
4291
4292    pub const DEBUG_STARTED: WireEventType = WireEventType { value: ::fidl_next::WireU32(8) };
4293
4294    pub const UNRESOLVED: WireEventType = WireEventType { value: ::fidl_next::WireU32(9) };
4295}
4296
4297unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventType
4298where
4299    ___D: ?Sized,
4300{
4301    fn decode(
4302        slot: ::fidl_next::Slot<'_, Self>,
4303        _: &mut ___D,
4304    ) -> Result<(), ::fidl_next::DecodeError> {
4305        ::fidl_next::munge!(let Self { value } = slot);
4306
4307        match u32::from(*value) {
4308            1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 => (),
4309            unknown => return Err(::fidl_next::DecodeError::InvalidEnumOrdinal(unknown as i128)),
4310        }
4311
4312        Ok(())
4313    }
4314}
4315
4316impl ::core::convert::From<EventType> for WireEventType {
4317    fn from(natural: EventType) -> Self {
4318        match natural {
4319            EventType::CapabilityRequested => WireEventType::CAPABILITY_REQUESTED,
4320
4321            EventType::DirectoryReady => WireEventType::DIRECTORY_READY,
4322
4323            EventType::Discovered => WireEventType::DISCOVERED,
4324
4325            EventType::Destroyed => WireEventType::DESTROYED,
4326
4327            EventType::Resolved => WireEventType::RESOLVED,
4328
4329            EventType::Started => WireEventType::STARTED,
4330
4331            EventType::Stopped => WireEventType::STOPPED,
4332
4333            EventType::DebugStarted => WireEventType::DEBUG_STARTED,
4334
4335            EventType::Unresolved => WireEventType::UNRESOLVED,
4336        }
4337    }
4338}
4339
4340#[doc = " A head providing metadata about a target component instance.\n"]
4341#[derive(Clone, Debug, Default)]
4342pub struct EventHeader {
4343    pub event_type: Option<crate::EventType>,
4344
4345    pub moniker: Option<String>,
4346
4347    pub component_url: Option<String>,
4348
4349    pub timestamp: Option<i64>,
4350}
4351
4352impl EventHeader {
4353    fn __max_ordinal(&self) -> usize {
4354        if self.timestamp.is_some() {
4355            return 4;
4356        }
4357
4358        if self.component_url.is_some() {
4359            return 3;
4360        }
4361
4362        if self.moniker.is_some() {
4363            return 2;
4364        }
4365
4366        if self.event_type.is_some() {
4367            return 1;
4368        }
4369
4370        0
4371    }
4372}
4373
4374impl ::fidl_next::Encodable for EventHeader {
4375    type Encoded = WireEventHeader<'static>;
4376}
4377
4378unsafe impl<___E> ::fidl_next::Encode<___E> for EventHeader
4379where
4380    ___E: ::fidl_next::Encoder + ?Sized,
4381{
4382    #[inline]
4383    fn encode(
4384        mut self,
4385        encoder: &mut ___E,
4386        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4387    ) -> Result<(), ::fidl_next::EncodeError> {
4388        ::fidl_next::munge!(let WireEventHeader { table } = out);
4389
4390        let max_ord = self.__max_ordinal();
4391
4392        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4393        ::fidl_next::Wire::zero_padding(&mut out);
4394
4395        let mut preallocated =
4396            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4397
4398        for i in 1..=max_ord {
4399            match i {
4400                4 => {
4401                    if let Some(timestamp) = self.timestamp.take() {
4402                        ::fidl_next::WireEnvelope::encode_value(
4403                            timestamp,
4404                            preallocated.encoder,
4405                            &mut out,
4406                        )?;
4407                    } else {
4408                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4409                    }
4410                }
4411
4412                3 => {
4413                    if let Some(component_url) = self.component_url.take() {
4414                        ::fidl_next::WireEnvelope::encode_value(
4415                            component_url,
4416                            preallocated.encoder,
4417                            &mut out,
4418                        )?;
4419                    } else {
4420                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4421                    }
4422                }
4423
4424                2 => {
4425                    if let Some(moniker) = self.moniker.take() {
4426                        ::fidl_next::WireEnvelope::encode_value(
4427                            moniker,
4428                            preallocated.encoder,
4429                            &mut out,
4430                        )?;
4431                    } else {
4432                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4433                    }
4434                }
4435
4436                1 => {
4437                    if let Some(event_type) = self.event_type.take() {
4438                        ::fidl_next::WireEnvelope::encode_value(
4439                            event_type,
4440                            preallocated.encoder,
4441                            &mut out,
4442                        )?;
4443                    } else {
4444                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4445                    }
4446                }
4447
4448                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4449            }
4450            unsafe {
4451                preallocated.write_next(out.assume_init_ref());
4452            }
4453        }
4454
4455        ::fidl_next::WireTable::encode_len(table, max_ord);
4456
4457        Ok(())
4458    }
4459}
4460
4461unsafe impl<___E> ::fidl_next::EncodeRef<___E> for EventHeader
4462where
4463    ___E: ::fidl_next::Encoder + ?Sized,
4464{
4465    #[inline]
4466    fn encode_ref(
4467        &self,
4468        encoder: &mut ___E,
4469        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4470    ) -> Result<(), ::fidl_next::EncodeError> {
4471        ::fidl_next::munge!(let WireEventHeader { table } = out);
4472
4473        let max_ord = self.__max_ordinal();
4474
4475        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
4476        ::fidl_next::Wire::zero_padding(&mut out);
4477
4478        let mut preallocated =
4479            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
4480
4481        for i in 1..=max_ord {
4482            match i {
4483                4 => {
4484                    if let Some(timestamp) = &self.timestamp {
4485                        ::fidl_next::WireEnvelope::encode_value(
4486                            timestamp,
4487                            preallocated.encoder,
4488                            &mut out,
4489                        )?;
4490                    } else {
4491                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4492                    }
4493                }
4494
4495                3 => {
4496                    if let Some(component_url) = &self.component_url {
4497                        ::fidl_next::WireEnvelope::encode_value(
4498                            component_url,
4499                            preallocated.encoder,
4500                            &mut out,
4501                        )?;
4502                    } else {
4503                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4504                    }
4505                }
4506
4507                2 => {
4508                    if let Some(moniker) = &self.moniker {
4509                        ::fidl_next::WireEnvelope::encode_value(
4510                            moniker,
4511                            preallocated.encoder,
4512                            &mut out,
4513                        )?;
4514                    } else {
4515                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4516                    }
4517                }
4518
4519                1 => {
4520                    if let Some(event_type) = &self.event_type {
4521                        ::fidl_next::WireEnvelope::encode_value(
4522                            event_type,
4523                            preallocated.encoder,
4524                            &mut out,
4525                        )?;
4526                    } else {
4527                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
4528                    }
4529                }
4530
4531                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
4532            }
4533            unsafe {
4534                preallocated.write_next(out.assume_init_ref());
4535            }
4536        }
4537
4538        ::fidl_next::WireTable::encode_len(table, max_ord);
4539
4540        Ok(())
4541    }
4542}
4543
4544impl<'de> ::fidl_next::FromWire<WireEventHeader<'de>> for EventHeader {
4545    #[inline]
4546    fn from_wire(wire: WireEventHeader<'de>) -> Self {
4547        let wire = ::core::mem::ManuallyDrop::new(wire);
4548
4549        let event_type = wire.table.get(1);
4550
4551        let moniker = wire.table.get(2);
4552
4553        let component_url = wire.table.get(3);
4554
4555        let timestamp = wire.table.get(4);
4556
4557        Self {
4558            event_type: event_type.map(|envelope| {
4559                ::fidl_next::FromWire::from_wire(unsafe {
4560                    envelope.read_unchecked::<crate::WireEventType>()
4561                })
4562            }),
4563
4564            moniker: moniker.map(|envelope| {
4565                ::fidl_next::FromWire::from_wire(unsafe {
4566                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4567                })
4568            }),
4569
4570            component_url: component_url.map(|envelope| {
4571                ::fidl_next::FromWire::from_wire(unsafe {
4572                    envelope.read_unchecked::<::fidl_next::WireString<'de>>()
4573                })
4574            }),
4575
4576            timestamp: timestamp.map(|envelope| {
4577                ::fidl_next::FromWire::from_wire(unsafe {
4578                    envelope.read_unchecked::<::fidl_next::WireI64>()
4579                })
4580            }),
4581        }
4582    }
4583}
4584
4585impl<'de> ::fidl_next::FromWireRef<WireEventHeader<'de>> for EventHeader {
4586    #[inline]
4587    fn from_wire_ref(wire: &WireEventHeader<'de>) -> Self {
4588        Self {
4589            event_type: wire.table.get(1).map(|envelope| {
4590                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4591                    envelope.deref_unchecked::<crate::WireEventType>()
4592                })
4593            }),
4594
4595            moniker: wire.table.get(2).map(|envelope| {
4596                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4597                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4598                })
4599            }),
4600
4601            component_url: wire.table.get(3).map(|envelope| {
4602                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4603                    envelope.deref_unchecked::<::fidl_next::WireString<'de>>()
4604                })
4605            }),
4606
4607            timestamp: wire.table.get(4).map(|envelope| {
4608                ::fidl_next::FromWireRef::from_wire_ref(unsafe {
4609                    envelope.deref_unchecked::<::fidl_next::WireI64>()
4610                })
4611            }),
4612        }
4613    }
4614}
4615
4616/// The wire type corresponding to [`EventHeader`].
4617#[repr(C)]
4618pub struct WireEventHeader<'de> {
4619    table: ::fidl_next::WireTable<'de>,
4620}
4621
4622impl<'de> Drop for WireEventHeader<'de> {
4623    fn drop(&mut self) {
4624        let _ = self
4625            .table
4626            .get(1)
4627            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireEventType>() });
4628
4629        let _ = self
4630            .table
4631            .get(2)
4632            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
4633
4634        let _ = self
4635            .table
4636            .get(3)
4637            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireString<'de>>() });
4638
4639        let _ = self
4640            .table
4641            .get(4)
4642            .map(|envelope| unsafe { envelope.read_unchecked::<::fidl_next::WireI64>() });
4643    }
4644}
4645
4646unsafe impl ::fidl_next::Wire for WireEventHeader<'static> {
4647    type Decoded<'de> = WireEventHeader<'de>;
4648
4649    #[inline]
4650    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
4651        ::fidl_next::munge!(let Self { table } = out);
4652        ::fidl_next::WireTable::zero_padding(table);
4653    }
4654}
4655
4656unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventHeader<'static>
4657where
4658    ___D: ::fidl_next::Decoder + ?Sized,
4659{
4660    fn decode(
4661        slot: ::fidl_next::Slot<'_, Self>,
4662        decoder: &mut ___D,
4663    ) -> Result<(), ::fidl_next::DecodeError> {
4664        ::fidl_next::munge!(let Self { table } = slot);
4665
4666        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
4667            match ordinal {
4668                0 => unsafe { ::core::hint::unreachable_unchecked() },
4669
4670                1 => {
4671                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEventType>(
4672                        slot.as_mut(),
4673                        decoder,
4674                    )?;
4675
4676                    Ok(())
4677                }
4678
4679                2 => {
4680                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
4681                        slot.as_mut(),
4682                        decoder,
4683                    )?;
4684
4685                    let moniker = unsafe {
4686                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
4687                    };
4688
4689                    if moniker.len() > 4096 {
4690                        return Err(::fidl_next::DecodeError::VectorTooLong {
4691                            size: moniker.len() as u64,
4692                            limit: 4096,
4693                        });
4694                    }
4695
4696                    Ok(())
4697                }
4698
4699                3 => {
4700                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireString<'static>>(
4701                        slot.as_mut(),
4702                        decoder,
4703                    )?;
4704
4705                    let component_url = unsafe {
4706                        slot.deref_unchecked().deref_unchecked::<::fidl_next::WireString<'_>>()
4707                    };
4708
4709                    if component_url.len() > 4096 {
4710                        return Err(::fidl_next::DecodeError::VectorTooLong {
4711                            size: component_url.len() as u64,
4712                            limit: 4096,
4713                        });
4714                    }
4715
4716                    Ok(())
4717                }
4718
4719                4 => {
4720                    ::fidl_next::WireEnvelope::decode_as::<___D, ::fidl_next::WireI64>(
4721                        slot.as_mut(),
4722                        decoder,
4723                    )?;
4724
4725                    Ok(())
4726                }
4727
4728                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
4729            }
4730        })
4731    }
4732}
4733
4734impl<'de> WireEventHeader<'de> {
4735    pub fn event_type(&self) -> Option<&crate::WireEventType> {
4736        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
4737    }
4738
4739    pub fn moniker(&self) -> Option<&::fidl_next::WireString<'de>> {
4740        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
4741    }
4742
4743    pub fn component_url(&self) -> Option<&::fidl_next::WireString<'de>> {
4744        unsafe { Some(self.table.get(3)?.deref_unchecked()) }
4745    }
4746
4747    pub fn timestamp(&self) -> Option<&::fidl_next::WireI64> {
4748        unsafe { Some(self.table.get(4)?.deref_unchecked()) }
4749    }
4750}
4751
4752impl<'de> ::core::fmt::Debug for WireEventHeader<'de> {
4753    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
4754        f.debug_struct("EventHeader")
4755            .field("event_type", &self.event_type())
4756            .field("moniker", &self.moniker())
4757            .field("component_url", &self.component_url())
4758            .field("timestamp", &self.timestamp())
4759            .finish()
4760    }
4761}
4762
4763#[doc = " Encapsulates additional data/protocols for some event types.\n"]
4764#[derive(Debug)]
4765pub enum EventPayload {
4766    CapabilityRequested(crate::CapabilityRequestedPayload),
4767
4768    Purged(crate::PurgedPayload),
4769
4770    DirectoryReady(crate::DirectoryReadyPayload),
4771
4772    Discovered(crate::DiscoveredPayload),
4773
4774    Destroyed(crate::DestroyedPayload),
4775
4776    Resolved(crate::ResolvedPayload),
4777
4778    Started(crate::StartedPayload),
4779
4780    Stopped(crate::StoppedPayload),
4781
4782    DebugStarted(crate::DebugStartedPayload),
4783
4784    Unresolved(crate::UnresolvedPayload),
4785
4786    UnknownOrdinal_(u64),
4787}
4788
4789impl ::fidl_next::Encodable for EventPayload {
4790    type Encoded = WireEventPayload<'static>;
4791}
4792
4793unsafe impl<___E> ::fidl_next::Encode<___E> for EventPayload
4794where
4795    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
4796
4797    ___E: ::fidl_next::Encoder,
4798
4799    ___E: ::fidl_next::fuchsia::HandleEncoder,
4800{
4801    #[inline]
4802    fn encode(
4803        self,
4804        encoder: &mut ___E,
4805        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
4806    ) -> Result<(), ::fidl_next::EncodeError> {
4807        ::fidl_next::munge!(let WireEventPayload { raw, _phantom: _ } = out);
4808
4809        match self {
4810            Self::CapabilityRequested(value) => ::fidl_next::RawWireUnion::encode_as::<
4811                ___E,
4812                crate::CapabilityRequestedPayload,
4813            >(value, 1, encoder, raw)?,
4814
4815            Self::Purged(value) => ::fidl_next::RawWireUnion::encode_as::<
4816                ___E,
4817                crate::PurgedPayload,
4818            >(value, 2, encoder, raw)?,
4819
4820            Self::DirectoryReady(value) => ::fidl_next::RawWireUnion::encode_as::<
4821                ___E,
4822                crate::DirectoryReadyPayload,
4823            >(value, 3, encoder, raw)?,
4824
4825            Self::Discovered(value) => ::fidl_next::RawWireUnion::encode_as::<
4826                ___E,
4827                crate::DiscoveredPayload,
4828            >(value, 4, encoder, raw)?,
4829
4830            Self::Destroyed(value) => ::fidl_next::RawWireUnion::encode_as::<
4831                ___E,
4832                crate::DestroyedPayload,
4833            >(value, 5, encoder, raw)?,
4834
4835            Self::Resolved(value) => ::fidl_next::RawWireUnion::encode_as::<
4836                ___E,
4837                crate::ResolvedPayload,
4838            >(value, 6, encoder, raw)?,
4839
4840            Self::Started(value) => ::fidl_next::RawWireUnion::encode_as::<
4841                ___E,
4842                crate::StartedPayload,
4843            >(value, 7, encoder, raw)?,
4844
4845            Self::Stopped(value) => ::fidl_next::RawWireUnion::encode_as::<
4846                ___E,
4847                crate::StoppedPayload,
4848            >(value, 8, encoder, raw)?,
4849
4850            Self::DebugStarted(value) => ::fidl_next::RawWireUnion::encode_as::<
4851                ___E,
4852                crate::DebugStartedPayload,
4853            >(value, 9, encoder, raw)?,
4854
4855            Self::Unresolved(value) => ::fidl_next::RawWireUnion::encode_as::<
4856                ___E,
4857                crate::UnresolvedPayload,
4858            >(value, 10, encoder, raw)?,
4859
4860            Self::UnknownOrdinal_(ordinal) => {
4861                return Err(::fidl_next::EncodeError::UnknownUnionOrdinal(ordinal as usize))
4862            }
4863        }
4864
4865        Ok(())
4866    }
4867}
4868
4869impl ::fidl_next::EncodableOption for EventPayload {
4870    type EncodedOption = WireOptionalEventPayload<'static>;
4871}
4872
4873unsafe impl<___E> ::fidl_next::EncodeOption<___E> for EventPayload
4874where
4875    ___E: ?Sized,
4876    EventPayload: ::fidl_next::Encode<___E>,
4877{
4878    #[inline]
4879    fn encode_option(
4880        this: Option<Self>,
4881        encoder: &mut ___E,
4882        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
4883    ) -> Result<(), ::fidl_next::EncodeError> {
4884        ::fidl_next::munge!(let WireOptionalEventPayload { raw, _phantom: _ } = &mut *out);
4885
4886        if let Some(inner) = this {
4887            let value_out = unsafe { &mut *out.as_mut_ptr().cast() };
4888            ::fidl_next::Encode::encode(inner, encoder, value_out)?;
4889        } else {
4890            ::fidl_next::RawWireUnion::encode_absent(raw);
4891        }
4892
4893        Ok(())
4894    }
4895}
4896
4897impl<'de> ::fidl_next::FromWire<WireEventPayload<'de>> for EventPayload {
4898    #[inline]
4899    fn from_wire(wire: WireEventPayload<'de>) -> Self {
4900        let wire = ::core::mem::ManuallyDrop::new(wire);
4901        match wire.raw.ordinal() {
4902            1 => Self::CapabilityRequested(::fidl_next::FromWire::from_wire(unsafe {
4903                wire.raw.get().read_unchecked::<crate::WireCapabilityRequestedPayload<'de>>()
4904            })),
4905
4906            2 => Self::Purged(::fidl_next::FromWire::from_wire(unsafe {
4907                wire.raw.get().read_unchecked::<crate::WirePurgedPayload<'de>>()
4908            })),
4909
4910            3 => Self::DirectoryReady(::fidl_next::FromWire::from_wire(unsafe {
4911                wire.raw.get().read_unchecked::<crate::WireDirectoryReadyPayload<'de>>()
4912            })),
4913
4914            4 => Self::Discovered(::fidl_next::FromWire::from_wire(unsafe {
4915                wire.raw.get().read_unchecked::<crate::WireDiscoveredPayload<'de>>()
4916            })),
4917
4918            5 => Self::Destroyed(::fidl_next::FromWire::from_wire(unsafe {
4919                wire.raw.get().read_unchecked::<crate::WireDestroyedPayload<'de>>()
4920            })),
4921
4922            6 => Self::Resolved(::fidl_next::FromWire::from_wire(unsafe {
4923                wire.raw.get().read_unchecked::<crate::WireResolvedPayload<'de>>()
4924            })),
4925
4926            7 => Self::Started(::fidl_next::FromWire::from_wire(unsafe {
4927                wire.raw.get().read_unchecked::<crate::WireStartedPayload<'de>>()
4928            })),
4929
4930            8 => Self::Stopped(::fidl_next::FromWire::from_wire(unsafe {
4931                wire.raw.get().read_unchecked::<crate::WireStoppedPayload<'de>>()
4932            })),
4933
4934            9 => Self::DebugStarted(::fidl_next::FromWire::from_wire(unsafe {
4935                wire.raw.get().read_unchecked::<crate::WireDebugStartedPayload<'de>>()
4936            })),
4937
4938            10 => Self::Unresolved(::fidl_next::FromWire::from_wire(unsafe {
4939                wire.raw.get().read_unchecked::<crate::WireUnresolvedPayload<'de>>()
4940            })),
4941
4942            _ => unsafe { ::core::hint::unreachable_unchecked() },
4943        }
4944    }
4945}
4946
4947impl<'de> ::fidl_next::FromWireOption<WireOptionalEventPayload<'de>> for Box<EventPayload> {
4948    #[inline]
4949    fn from_wire_option(wire: WireOptionalEventPayload<'de>) -> Option<Self> {
4950        if let Some(inner) = wire.into_option() {
4951            Some(Box::new(::fidl_next::FromWire::from_wire(inner)))
4952        } else {
4953            None
4954        }
4955    }
4956}
4957
4958/// The wire type corresponding to [`EventPayload`].
4959#[repr(transparent)]
4960pub struct WireEventPayload<'de> {
4961    raw: ::fidl_next::RawWireUnion,
4962    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
4963}
4964
4965impl<'de> Drop for WireEventPayload<'de> {
4966    fn drop(&mut self) {
4967        match self.raw.ordinal() {
4968            1 => {
4969                let _ = unsafe {
4970                    self.raw.get().read_unchecked::<crate::WireCapabilityRequestedPayload<'de>>()
4971                };
4972            }
4973
4974            2 => {
4975                let _ = unsafe { self.raw.get().read_unchecked::<crate::WirePurgedPayload<'de>>() };
4976            }
4977
4978            3 => {
4979                let _ = unsafe {
4980                    self.raw.get().read_unchecked::<crate::WireDirectoryReadyPayload<'de>>()
4981                };
4982            }
4983
4984            4 => {
4985                let _ =
4986                    unsafe { self.raw.get().read_unchecked::<crate::WireDiscoveredPayload<'de>>() };
4987            }
4988
4989            5 => {
4990                let _ =
4991                    unsafe { self.raw.get().read_unchecked::<crate::WireDestroyedPayload<'de>>() };
4992            }
4993
4994            6 => {
4995                let _ =
4996                    unsafe { self.raw.get().read_unchecked::<crate::WireResolvedPayload<'de>>() };
4997            }
4998
4999            7 => {
5000                let _ =
5001                    unsafe { self.raw.get().read_unchecked::<crate::WireStartedPayload<'de>>() };
5002            }
5003
5004            8 => {
5005                let _ =
5006                    unsafe { self.raw.get().read_unchecked::<crate::WireStoppedPayload<'de>>() };
5007            }
5008
5009            9 => {
5010                let _ = unsafe {
5011                    self.raw.get().read_unchecked::<crate::WireDebugStartedPayload<'de>>()
5012                };
5013            }
5014
5015            10 => {
5016                let _ =
5017                    unsafe { self.raw.get().read_unchecked::<crate::WireUnresolvedPayload<'de>>() };
5018            }
5019
5020            _ => (),
5021        }
5022    }
5023}
5024
5025unsafe impl ::fidl_next::Wire for WireEventPayload<'static> {
5026    type Decoded<'de> = WireEventPayload<'de>;
5027
5028    #[inline]
5029    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5030        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5031        ::fidl_next::RawWireUnion::zero_padding(raw);
5032    }
5033}
5034
5035pub mod event_payload {
5036    pub enum Ref<'de> {
5037        CapabilityRequested(&'de crate::WireCapabilityRequestedPayload<'de>),
5038
5039        Purged(&'de crate::WirePurgedPayload<'de>),
5040
5041        DirectoryReady(&'de crate::WireDirectoryReadyPayload<'de>),
5042
5043        Discovered(&'de crate::WireDiscoveredPayload<'de>),
5044
5045        Destroyed(&'de crate::WireDestroyedPayload<'de>),
5046
5047        Resolved(&'de crate::WireResolvedPayload<'de>),
5048
5049        Started(&'de crate::WireStartedPayload<'de>),
5050
5051        Stopped(&'de crate::WireStoppedPayload<'de>),
5052
5053        DebugStarted(&'de crate::WireDebugStartedPayload<'de>),
5054
5055        Unresolved(&'de crate::WireUnresolvedPayload<'de>),
5056
5057        UnknownOrdinal_(u64),
5058    }
5059}
5060
5061impl<'de> WireEventPayload<'de> {
5062    pub fn as_ref(&self) -> crate::event_payload::Ref<'_> {
5063        match self.raw.ordinal() {
5064            1 => crate::event_payload::Ref::CapabilityRequested(unsafe {
5065                self.raw.get().deref_unchecked::<crate::WireCapabilityRequestedPayload<'_>>()
5066            }),
5067
5068            2 => crate::event_payload::Ref::Purged(unsafe {
5069                self.raw.get().deref_unchecked::<crate::WirePurgedPayload<'_>>()
5070            }),
5071
5072            3 => crate::event_payload::Ref::DirectoryReady(unsafe {
5073                self.raw.get().deref_unchecked::<crate::WireDirectoryReadyPayload<'_>>()
5074            }),
5075
5076            4 => crate::event_payload::Ref::Discovered(unsafe {
5077                self.raw.get().deref_unchecked::<crate::WireDiscoveredPayload<'_>>()
5078            }),
5079
5080            5 => crate::event_payload::Ref::Destroyed(unsafe {
5081                self.raw.get().deref_unchecked::<crate::WireDestroyedPayload<'_>>()
5082            }),
5083
5084            6 => crate::event_payload::Ref::Resolved(unsafe {
5085                self.raw.get().deref_unchecked::<crate::WireResolvedPayload<'_>>()
5086            }),
5087
5088            7 => crate::event_payload::Ref::Started(unsafe {
5089                self.raw.get().deref_unchecked::<crate::WireStartedPayload<'_>>()
5090            }),
5091
5092            8 => crate::event_payload::Ref::Stopped(unsafe {
5093                self.raw.get().deref_unchecked::<crate::WireStoppedPayload<'_>>()
5094            }),
5095
5096            9 => crate::event_payload::Ref::DebugStarted(unsafe {
5097                self.raw.get().deref_unchecked::<crate::WireDebugStartedPayload<'_>>()
5098            }),
5099
5100            10 => crate::event_payload::Ref::Unresolved(unsafe {
5101                self.raw.get().deref_unchecked::<crate::WireUnresolvedPayload<'_>>()
5102            }),
5103
5104            unknown => crate::event_payload::Ref::UnknownOrdinal_(unknown),
5105        }
5106    }
5107}
5108
5109unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventPayload<'static>
5110where
5111    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5112
5113    ___D: ::fidl_next::Decoder,
5114
5115    ___D: ::fidl_next::fuchsia::HandleDecoder,
5116{
5117    fn decode(
5118        mut slot: ::fidl_next::Slot<'_, Self>,
5119        decoder: &mut ___D,
5120    ) -> Result<(), ::fidl_next::DecodeError> {
5121        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5122        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5123            1 => ::fidl_next::RawWireUnion::decode_as::<
5124                ___D,
5125                crate::WireCapabilityRequestedPayload<'static>,
5126            >(raw, decoder)?,
5127
5128            2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WirePurgedPayload<'static>>(
5129                raw, decoder,
5130            )?,
5131
5132            3 => ::fidl_next::RawWireUnion::decode_as::<
5133                ___D,
5134                crate::WireDirectoryReadyPayload<'static>,
5135            >(raw, decoder)?,
5136
5137            4 => {
5138                ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDiscoveredPayload<'static>>(
5139                    raw, decoder,
5140                )?
5141            }
5142
5143            5 => {
5144                ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDestroyedPayload<'static>>(
5145                    raw, decoder,
5146                )?
5147            }
5148
5149            6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolvedPayload<'static>>(
5150                raw, decoder,
5151            )?,
5152
5153            7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStartedPayload<'static>>(
5154                raw, decoder,
5155            )?,
5156
5157            8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStoppedPayload<'static>>(
5158                raw, decoder,
5159            )?,
5160
5161            9 => ::fidl_next::RawWireUnion::decode_as::<
5162                ___D,
5163                crate::WireDebugStartedPayload<'static>,
5164            >(raw, decoder)?,
5165
5166            10 => ::fidl_next::RawWireUnion::decode_as::<
5167                ___D,
5168                crate::WireUnresolvedPayload<'static>,
5169            >(raw, decoder)?,
5170
5171            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5172        }
5173
5174        Ok(())
5175    }
5176}
5177
5178impl<'de> ::core::fmt::Debug for WireEventPayload<'de> {
5179    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5180        match self.raw.ordinal() {
5181            1 => unsafe {
5182                self.raw.get().deref_unchecked::<crate::WireCapabilityRequestedPayload<'_>>().fmt(f)
5183            },
5184            2 => unsafe { self.raw.get().deref_unchecked::<crate::WirePurgedPayload<'_>>().fmt(f) },
5185            3 => unsafe {
5186                self.raw.get().deref_unchecked::<crate::WireDirectoryReadyPayload<'_>>().fmt(f)
5187            },
5188            4 => unsafe {
5189                self.raw.get().deref_unchecked::<crate::WireDiscoveredPayload<'_>>().fmt(f)
5190            },
5191            5 => unsafe {
5192                self.raw.get().deref_unchecked::<crate::WireDestroyedPayload<'_>>().fmt(f)
5193            },
5194            6 => unsafe {
5195                self.raw.get().deref_unchecked::<crate::WireResolvedPayload<'_>>().fmt(f)
5196            },
5197            7 => unsafe {
5198                self.raw.get().deref_unchecked::<crate::WireStartedPayload<'_>>().fmt(f)
5199            },
5200            8 => unsafe {
5201                self.raw.get().deref_unchecked::<crate::WireStoppedPayload<'_>>().fmt(f)
5202            },
5203            9 => unsafe {
5204                self.raw.get().deref_unchecked::<crate::WireDebugStartedPayload<'_>>().fmt(f)
5205            },
5206            10 => unsafe {
5207                self.raw.get().deref_unchecked::<crate::WireUnresolvedPayload<'_>>().fmt(f)
5208            },
5209            _ => unsafe { ::core::hint::unreachable_unchecked() },
5210        }
5211    }
5212}
5213
5214#[repr(transparent)]
5215pub struct WireOptionalEventPayload<'de> {
5216    raw: ::fidl_next::RawWireUnion,
5217    _phantom: ::core::marker::PhantomData<&'de mut [::fidl_next::Chunk]>,
5218}
5219
5220unsafe impl ::fidl_next::Wire for WireOptionalEventPayload<'static> {
5221    type Decoded<'de> = WireOptionalEventPayload<'de>;
5222
5223    #[inline]
5224    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5225        ::fidl_next::munge!(let Self { raw, _phantom: _ } = out);
5226        ::fidl_next::RawWireUnion::zero_padding(raw);
5227    }
5228}
5229
5230impl<'de> WireOptionalEventPayload<'de> {
5231    pub fn is_some(&self) -> bool {
5232        self.raw.is_some()
5233    }
5234
5235    pub fn is_none(&self) -> bool {
5236        self.raw.is_none()
5237    }
5238
5239    pub fn as_ref(&self) -> Option<&WireEventPayload<'de>> {
5240        if self.is_some() {
5241            Some(unsafe { &*(self as *const Self).cast() })
5242        } else {
5243            None
5244        }
5245    }
5246
5247    pub fn into_option(self) -> Option<WireEventPayload<'de>> {
5248        if self.is_some() {
5249            Some(WireEventPayload { raw: self.raw, _phantom: ::core::marker::PhantomData })
5250        } else {
5251            None
5252        }
5253    }
5254}
5255
5256unsafe impl<___D> ::fidl_next::Decode<___D> for WireOptionalEventPayload<'static>
5257where
5258    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5259
5260    ___D: ::fidl_next::Decoder,
5261
5262    ___D: ::fidl_next::fuchsia::HandleDecoder,
5263{
5264    fn decode(
5265        mut slot: ::fidl_next::Slot<'_, Self>,
5266        decoder: &mut ___D,
5267    ) -> Result<(), ::fidl_next::DecodeError> {
5268        ::fidl_next::munge!(let Self { mut raw, _phantom: _ } = slot.as_mut());
5269        match ::fidl_next::RawWireUnion::encoded_ordinal(raw.as_mut()) {
5270            1 => ::fidl_next::RawWireUnion::decode_as::<
5271                ___D,
5272                crate::WireCapabilityRequestedPayload<'static>,
5273            >(raw, decoder)?,
5274
5275            2 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WirePurgedPayload<'static>>(
5276                raw, decoder,
5277            )?,
5278
5279            3 => ::fidl_next::RawWireUnion::decode_as::<
5280                ___D,
5281                crate::WireDirectoryReadyPayload<'static>,
5282            >(raw, decoder)?,
5283
5284            4 => {
5285                ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDiscoveredPayload<'static>>(
5286                    raw, decoder,
5287                )?
5288            }
5289
5290            5 => {
5291                ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireDestroyedPayload<'static>>(
5292                    raw, decoder,
5293                )?
5294            }
5295
5296            6 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireResolvedPayload<'static>>(
5297                raw, decoder,
5298            )?,
5299
5300            7 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStartedPayload<'static>>(
5301                raw, decoder,
5302            )?,
5303
5304            8 => ::fidl_next::RawWireUnion::decode_as::<___D, crate::WireStoppedPayload<'static>>(
5305                raw, decoder,
5306            )?,
5307
5308            9 => ::fidl_next::RawWireUnion::decode_as::<
5309                ___D,
5310                crate::WireDebugStartedPayload<'static>,
5311            >(raw, decoder)?,
5312
5313            10 => ::fidl_next::RawWireUnion::decode_as::<
5314                ___D,
5315                crate::WireUnresolvedPayload<'static>,
5316            >(raw, decoder)?,
5317
5318            0 => ::fidl_next::RawWireUnion::decode_absent(raw)?,
5319            _ => ::fidl_next::RawWireUnion::decode_unknown(raw, decoder)?,
5320        }
5321
5322        Ok(())
5323    }
5324}
5325
5326impl<'de> ::core::fmt::Debug for WireOptionalEventPayload<'de> {
5327    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
5328        self.as_ref().fmt(f)
5329    }
5330}
5331
5332#[doc = " Contains all information about a single event\n"]
5333#[derive(Debug, Default)]
5334pub struct Event {
5335    pub header: Option<crate::EventHeader>,
5336
5337    pub payload: Option<crate::EventPayload>,
5338}
5339
5340impl Event {
5341    fn __max_ordinal(&self) -> usize {
5342        if self.payload.is_some() {
5343            return 2;
5344        }
5345
5346        if self.header.is_some() {
5347            return 1;
5348        }
5349
5350        0
5351    }
5352}
5353
5354impl ::fidl_next::Encodable for Event {
5355    type Encoded = WireEvent<'static>;
5356}
5357
5358unsafe impl<___E> ::fidl_next::Encode<___E> for Event
5359where
5360    ___E: ::fidl_next::Encoder + ?Sized,
5361
5362    ___E: ::fidl_next::fuchsia::HandleEncoder,
5363{
5364    #[inline]
5365    fn encode(
5366        mut self,
5367        encoder: &mut ___E,
5368        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5369    ) -> Result<(), ::fidl_next::EncodeError> {
5370        ::fidl_next::munge!(let WireEvent { table } = out);
5371
5372        let max_ord = self.__max_ordinal();
5373
5374        let mut out = ::core::mem::MaybeUninit::<::fidl_next::WireEnvelope>::uninit();
5375        ::fidl_next::Wire::zero_padding(&mut out);
5376
5377        let mut preallocated =
5378            ::fidl_next::EncoderExt::preallocate::<::fidl_next::WireEnvelope>(encoder, max_ord);
5379
5380        for i in 1..=max_ord {
5381            match i {
5382                2 => {
5383                    if let Some(payload) = self.payload.take() {
5384                        ::fidl_next::WireEnvelope::encode_value(
5385                            payload,
5386                            preallocated.encoder,
5387                            &mut out,
5388                        )?;
5389                    } else {
5390                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5391                    }
5392                }
5393
5394                1 => {
5395                    if let Some(header) = self.header.take() {
5396                        ::fidl_next::WireEnvelope::encode_value(
5397                            header,
5398                            preallocated.encoder,
5399                            &mut out,
5400                        )?;
5401                    } else {
5402                        ::fidl_next::WireEnvelope::encode_zero(&mut out)
5403                    }
5404                }
5405
5406                _ => ::fidl_next::WireEnvelope::encode_zero(&mut out),
5407            }
5408            unsafe {
5409                preallocated.write_next(out.assume_init_ref());
5410            }
5411        }
5412
5413        ::fidl_next::WireTable::encode_len(table, max_ord);
5414
5415        Ok(())
5416    }
5417}
5418
5419impl<'de> ::fidl_next::FromWire<WireEvent<'de>> for Event {
5420    #[inline]
5421    fn from_wire(wire: WireEvent<'de>) -> Self {
5422        let wire = ::core::mem::ManuallyDrop::new(wire);
5423
5424        let header = wire.table.get(1);
5425
5426        let payload = wire.table.get(2);
5427
5428        Self {
5429            header: header.map(|envelope| {
5430                ::fidl_next::FromWire::from_wire(unsafe {
5431                    envelope.read_unchecked::<crate::WireEventHeader<'de>>()
5432                })
5433            }),
5434
5435            payload: payload.map(|envelope| {
5436                ::fidl_next::FromWire::from_wire(unsafe {
5437                    envelope.read_unchecked::<crate::WireEventPayload<'de>>()
5438                })
5439            }),
5440        }
5441    }
5442}
5443
5444/// The wire type corresponding to [`Event`].
5445#[repr(C)]
5446pub struct WireEvent<'de> {
5447    table: ::fidl_next::WireTable<'de>,
5448}
5449
5450impl<'de> Drop for WireEvent<'de> {
5451    fn drop(&mut self) {
5452        let _ = self
5453            .table
5454            .get(1)
5455            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireEventHeader<'de>>() });
5456
5457        let _ = self
5458            .table
5459            .get(2)
5460            .map(|envelope| unsafe { envelope.read_unchecked::<crate::WireEventPayload<'de>>() });
5461    }
5462}
5463
5464unsafe impl ::fidl_next::Wire for WireEvent<'static> {
5465    type Decoded<'de> = WireEvent<'de>;
5466
5467    #[inline]
5468    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
5469        ::fidl_next::munge!(let Self { table } = out);
5470        ::fidl_next::WireTable::zero_padding(table);
5471    }
5472}
5473
5474unsafe impl<___D> ::fidl_next::Decode<___D> for WireEvent<'static>
5475where
5476    ___D: ::fidl_next::Decoder + ?Sized,
5477
5478    ___D: ::fidl_next::fuchsia::HandleDecoder,
5479{
5480    fn decode(
5481        slot: ::fidl_next::Slot<'_, Self>,
5482        decoder: &mut ___D,
5483    ) -> Result<(), ::fidl_next::DecodeError> {
5484        ::fidl_next::munge!(let Self { table } = slot);
5485
5486        ::fidl_next::WireTable::decode_with(table, decoder, |ordinal, mut slot, decoder| {
5487            match ordinal {
5488                0 => unsafe { ::core::hint::unreachable_unchecked() },
5489
5490                1 => {
5491                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEventHeader<'static>>(
5492                        slot.as_mut(),
5493                        decoder,
5494                    )?;
5495
5496                    Ok(())
5497                }
5498
5499                2 => {
5500                    ::fidl_next::WireEnvelope::decode_as::<___D, crate::WireEventPayload<'static>>(
5501                        slot.as_mut(),
5502                        decoder,
5503                    )?;
5504
5505                    Ok(())
5506                }
5507
5508                _ => ::fidl_next::WireEnvelope::decode_unknown(slot, decoder),
5509            }
5510        })
5511    }
5512}
5513
5514impl<'de> WireEvent<'de> {
5515    pub fn header(&self) -> Option<&crate::WireEventHeader<'de>> {
5516        unsafe { Some(self.table.get(1)?.deref_unchecked()) }
5517    }
5518
5519    pub fn payload(&self) -> Option<&crate::WireEventPayload<'de>> {
5520        unsafe { Some(self.table.get(2)?.deref_unchecked()) }
5521    }
5522}
5523
5524impl<'de> ::core::fmt::Debug for WireEvent<'de> {
5525    fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> Result<(), ::core::fmt::Error> {
5526        f.debug_struct("Event")
5527            .field("header", &self.header())
5528            .field("payload", &self.payload())
5529            .finish()
5530    }
5531}
5532
5533#[derive(Debug)]
5534pub struct EventStreamGetNextResponse {
5535    pub events: Vec<crate::Event>,
5536}
5537
5538impl ::fidl_next::Encodable for EventStreamGetNextResponse {
5539    type Encoded = WireEventStreamGetNextResponse<'static>;
5540}
5541
5542unsafe impl<___E> ::fidl_next::Encode<___E> for EventStreamGetNextResponse
5543where
5544    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5545
5546    ___E: ::fidl_next::Encoder,
5547
5548    ___E: ::fidl_next::fuchsia::HandleEncoder,
5549{
5550    #[inline]
5551    fn encode(
5552        self,
5553        encoder: &mut ___E,
5554        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5555    ) -> Result<(), ::fidl_next::EncodeError> {
5556        ::fidl_next::munge! {
5557            let Self::Encoded {
5558                events,
5559
5560            } = out;
5561        }
5562
5563        ::fidl_next::Encode::encode(self.events, encoder, events)?;
5564
5565        Ok(())
5566    }
5567}
5568
5569impl ::fidl_next::EncodableOption for EventStreamGetNextResponse {
5570    type EncodedOption = ::fidl_next::WireBox<'static, WireEventStreamGetNextResponse<'static>>;
5571}
5572
5573unsafe impl<___E> ::fidl_next::EncodeOption<___E> for EventStreamGetNextResponse
5574where
5575    ___E: ::fidl_next::Encoder + ?Sized,
5576    EventStreamGetNextResponse: ::fidl_next::Encode<___E>,
5577{
5578    #[inline]
5579    fn encode_option(
5580        this: Option<Self>,
5581        encoder: &mut ___E,
5582        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5583    ) -> Result<(), ::fidl_next::EncodeError> {
5584        if let Some(inner) = this {
5585            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5586            ::fidl_next::WireBox::encode_present(out);
5587        } else {
5588            ::fidl_next::WireBox::encode_absent(out);
5589        }
5590
5591        Ok(())
5592    }
5593}
5594
5595impl<'de> ::fidl_next::FromWire<WireEventStreamGetNextResponse<'de>>
5596    for EventStreamGetNextResponse
5597{
5598    #[inline]
5599    fn from_wire(wire: WireEventStreamGetNextResponse<'de>) -> Self {
5600        Self { events: ::fidl_next::FromWire::from_wire(wire.events) }
5601    }
5602}
5603
5604/// The wire type corresponding to [`EventStreamGetNextResponse`].
5605#[derive(Debug)]
5606#[repr(C)]
5607pub struct WireEventStreamGetNextResponse<'de> {
5608    pub events: ::fidl_next::WireVector<'de, crate::WireEvent<'de>>,
5609}
5610
5611unsafe impl ::fidl_next::Wire for WireEventStreamGetNextResponse<'static> {
5612    type Decoded<'de> = WireEventStreamGetNextResponse<'de>;
5613
5614    #[inline]
5615    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5616}
5617
5618unsafe impl<___D> ::fidl_next::Decode<___D> for WireEventStreamGetNextResponse<'static>
5619where
5620    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5621
5622    ___D: ::fidl_next::Decoder,
5623
5624    ___D: ::fidl_next::fuchsia::HandleDecoder,
5625{
5626    fn decode(
5627        slot: ::fidl_next::Slot<'_, Self>,
5628        decoder: &mut ___D,
5629    ) -> Result<(), ::fidl_next::DecodeError> {
5630        ::fidl_next::munge! {
5631            let Self {
5632                mut events,
5633
5634            } = slot;
5635        }
5636
5637        ::fidl_next::Decode::decode(events.as_mut(), decoder)?;
5638
5639        Ok(())
5640    }
5641}
5642
5643/// The type corresponding to the EventStream protocol.
5644#[doc = " Listener for events on the component hierarchy.\n Can\'t be used outside of the platform.\n"]
5645#[derive(Debug)]
5646pub struct EventStream;
5647
5648impl ::fidl_next::Discoverable for EventStream {
5649    const PROTOCOL_NAME: &'static str = "fuchsia.component.EventStream";
5650}
5651
5652pub mod event_stream {
5653    pub mod prelude {
5654        pub use crate::{
5655            event_stream, EventStream, EventStreamClientHandler, EventStreamClientSender,
5656            EventStreamServerHandler, EventStreamServerSender,
5657        };
5658
5659        pub use crate::EventStreamGetNextResponse;
5660    }
5661
5662    pub struct GetNext;
5663
5664    impl ::fidl_next::Method for GetNext {
5665        const ORDINAL: u64 = 4549982840421936006;
5666
5667        type Protocol = crate::EventStream;
5668
5669        type Request = ();
5670
5671        type Response = crate::WireEventStreamGetNextResponse<'static>;
5672    }
5673
5674    pub struct WaitForReady;
5675
5676    impl ::fidl_next::Method for WaitForReady {
5677        const ORDINAL: u64 = 3545212058508387970;
5678
5679        type Protocol = crate::EventStream;
5680
5681        type Request = ();
5682
5683        type Response = ();
5684    }
5685}
5686
5687/// A helper trait for the `EventStream` client sender.
5688pub trait EventStreamClientSender {
5689    type Transport: ::fidl_next::Transport;
5690
5691    fn get_next(
5692        &self,
5693    ) -> Result<
5694        ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::GetNext>,
5695        ::fidl_next::EncodeError,
5696    >;
5697
5698    #[doc = " Returns immediately. Used to indicate that the FIDL connection\n completed. This is needed for non-static streams to verify\n that subscribe has completed before components are started.\n"]
5699    fn wait_for_ready(
5700        &self,
5701    ) -> Result<
5702        ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::WaitForReady>,
5703        ::fidl_next::EncodeError,
5704    >;
5705}
5706
5707impl<___T> EventStreamClientSender for ::fidl_next::ClientSender<___T, EventStream>
5708where
5709    ___T: ::fidl_next::Transport,
5710{
5711    type Transport = ___T;
5712
5713    fn get_next(
5714        &self,
5715    ) -> Result<
5716        ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::GetNext>,
5717        ::fidl_next::EncodeError,
5718    > {
5719        self.as_untyped()
5720            .send_two_way(4549982840421936006, ())
5721            .map(::fidl_next::ResponseFuture::from_untyped)
5722    }
5723
5724    #[doc = " Returns immediately. Used to indicate that the FIDL connection\n completed. This is needed for non-static streams to verify\n that subscribe has completed before components are started.\n"]
5725    fn wait_for_ready(
5726        &self,
5727    ) -> Result<
5728        ::fidl_next::ResponseFuture<'_, Self::Transport, event_stream::WaitForReady>,
5729        ::fidl_next::EncodeError,
5730    > {
5731        self.as_untyped()
5732            .send_two_way(3545212058508387970, ())
5733            .map(::fidl_next::ResponseFuture::from_untyped)
5734    }
5735}
5736
5737/// A client handler for the EventStream protocol.
5738///
5739/// See [`EventStream`] for more details.
5740pub trait EventStreamClientHandler<___T: ::fidl_next::Transport> {}
5741
5742impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for EventStream
5743where
5744    ___T: ::fidl_next::Transport,
5745    ___H: EventStreamClientHandler<___T>,
5746
5747    <event_stream::GetNext as ::fidl_next::Method>::Response:
5748        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
5749{
5750    fn on_event(
5751        handler: &mut ___H,
5752        sender: &::fidl_next::ClientSender<___T, Self>,
5753        ordinal: u64,
5754        buffer: ___T::RecvBuffer,
5755    ) {
5756        match ordinal {
5757            ordinal => {
5758                sender.close();
5759            }
5760        }
5761    }
5762}
5763
5764/// A helper trait for the `EventStream` server sender.
5765pub trait EventStreamServerSender {
5766    type Transport: ::fidl_next::Transport;
5767}
5768
5769impl<___T> EventStreamServerSender for ::fidl_next::ServerSender<___T, EventStream>
5770where
5771    ___T: ::fidl_next::Transport,
5772{
5773    type Transport = ___T;
5774}
5775
5776/// A server handler for the EventStream protocol.
5777///
5778/// See [`EventStream`] for more details.
5779pub trait EventStreamServerHandler<___T: ::fidl_next::Transport> {
5780    fn get_next(
5781        &mut self,
5782        sender: &::fidl_next::ServerSender<___T, EventStream>,
5783
5784        responder: ::fidl_next::Responder<event_stream::GetNext>,
5785    );
5786
5787    #[doc = " Returns immediately. Used to indicate that the FIDL connection\n completed. This is needed for non-static streams to verify\n that subscribe has completed before components are started.\n"]
5788    fn wait_for_ready(
5789        &mut self,
5790        sender: &::fidl_next::ServerSender<___T, EventStream>,
5791
5792        responder: ::fidl_next::Responder<event_stream::WaitForReady>,
5793    );
5794}
5795
5796impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for EventStream
5797where
5798    ___T: ::fidl_next::Transport,
5799    ___H: EventStreamServerHandler<___T>,
5800{
5801    fn on_one_way(
5802        handler: &mut ___H,
5803        sender: &::fidl_next::ServerSender<___T, Self>,
5804        ordinal: u64,
5805        buffer: ___T::RecvBuffer,
5806    ) {
5807        match ordinal {
5808            ordinal => {
5809                sender.close();
5810            }
5811        }
5812    }
5813
5814    fn on_two_way(
5815        handler: &mut ___H,
5816        sender: &::fidl_next::ServerSender<___T, Self>,
5817        ordinal: u64,
5818        buffer: ___T::RecvBuffer,
5819        responder: ::fidl_next::protocol::Responder,
5820    ) {
5821        match ordinal {
5822            4549982840421936006 => {
5823                let responder = ::fidl_next::Responder::from_untyped(responder);
5824
5825                handler.get_next(sender, responder);
5826            }
5827
5828            3545212058508387970 => {
5829                let responder = ::fidl_next::Responder::from_untyped(responder);
5830
5831                handler.wait_for_ready(sender, responder);
5832            }
5833
5834            ordinal => {
5835                sender.close();
5836            }
5837        }
5838    }
5839}
5840
5841#[derive(Clone, Debug)]
5842pub struct ExecutionControllerOnStopRequest {
5843    pub stopped_payload: crate::StoppedPayload,
5844}
5845
5846impl ::fidl_next::Encodable for ExecutionControllerOnStopRequest {
5847    type Encoded = WireExecutionControllerOnStopRequest<'static>;
5848}
5849
5850unsafe impl<___E> ::fidl_next::Encode<___E> for ExecutionControllerOnStopRequest
5851where
5852    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5853
5854    ___E: ::fidl_next::Encoder,
5855{
5856    #[inline]
5857    fn encode(
5858        self,
5859        encoder: &mut ___E,
5860        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5861    ) -> Result<(), ::fidl_next::EncodeError> {
5862        ::fidl_next::munge! {
5863            let Self::Encoded {
5864                stopped_payload,
5865
5866            } = out;
5867        }
5868
5869        ::fidl_next::Encode::encode(self.stopped_payload, encoder, stopped_payload)?;
5870
5871        Ok(())
5872    }
5873}
5874
5875unsafe impl<___E> ::fidl_next::EncodeRef<___E> for ExecutionControllerOnStopRequest
5876where
5877    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
5878
5879    ___E: ::fidl_next::Encoder,
5880{
5881    #[inline]
5882    fn encode_ref(
5883        &self,
5884        encoder: &mut ___E,
5885        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
5886    ) -> Result<(), ::fidl_next::EncodeError> {
5887        ::fidl_next::munge! {
5888            let Self::Encoded {
5889                stopped_payload,
5890
5891            } = out;
5892        }
5893
5894        ::fidl_next::EncodeRef::encode_ref(&self.stopped_payload, encoder, stopped_payload)?;
5895
5896        Ok(())
5897    }
5898}
5899
5900impl ::fidl_next::EncodableOption for ExecutionControllerOnStopRequest {
5901    type EncodedOption =
5902        ::fidl_next::WireBox<'static, WireExecutionControllerOnStopRequest<'static>>;
5903}
5904
5905unsafe impl<___E> ::fidl_next::EncodeOption<___E> for ExecutionControllerOnStopRequest
5906where
5907    ___E: ::fidl_next::Encoder + ?Sized,
5908    ExecutionControllerOnStopRequest: ::fidl_next::Encode<___E>,
5909{
5910    #[inline]
5911    fn encode_option(
5912        this: Option<Self>,
5913        encoder: &mut ___E,
5914        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5915    ) -> Result<(), ::fidl_next::EncodeError> {
5916        if let Some(inner) = this {
5917            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5918            ::fidl_next::WireBox::encode_present(out);
5919        } else {
5920            ::fidl_next::WireBox::encode_absent(out);
5921        }
5922
5923        Ok(())
5924    }
5925}
5926
5927unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for ExecutionControllerOnStopRequest
5928where
5929    ___E: ::fidl_next::Encoder + ?Sized,
5930    ExecutionControllerOnStopRequest: ::fidl_next::EncodeRef<___E>,
5931{
5932    #[inline]
5933    fn encode_option_ref(
5934        this: Option<&Self>,
5935        encoder: &mut ___E,
5936        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
5937    ) -> Result<(), ::fidl_next::EncodeError> {
5938        if let Some(inner) = this {
5939            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
5940            ::fidl_next::WireBox::encode_present(out);
5941        } else {
5942            ::fidl_next::WireBox::encode_absent(out);
5943        }
5944
5945        Ok(())
5946    }
5947}
5948
5949impl<'de> ::fidl_next::FromWire<WireExecutionControllerOnStopRequest<'de>>
5950    for ExecutionControllerOnStopRequest
5951{
5952    #[inline]
5953    fn from_wire(wire: WireExecutionControllerOnStopRequest<'de>) -> Self {
5954        Self { stopped_payload: ::fidl_next::FromWire::from_wire(wire.stopped_payload) }
5955    }
5956}
5957
5958impl<'de> ::fidl_next::FromWireRef<WireExecutionControllerOnStopRequest<'de>>
5959    for ExecutionControllerOnStopRequest
5960{
5961    #[inline]
5962    fn from_wire_ref(wire: &WireExecutionControllerOnStopRequest<'de>) -> Self {
5963        Self { stopped_payload: ::fidl_next::FromWireRef::from_wire_ref(&wire.stopped_payload) }
5964    }
5965}
5966
5967/// The wire type corresponding to [`ExecutionControllerOnStopRequest`].
5968#[derive(Debug)]
5969#[repr(C)]
5970pub struct WireExecutionControllerOnStopRequest<'de> {
5971    pub stopped_payload: crate::WireStoppedPayload<'de>,
5972}
5973
5974unsafe impl ::fidl_next::Wire for WireExecutionControllerOnStopRequest<'static> {
5975    type Decoded<'de> = WireExecutionControllerOnStopRequest<'de>;
5976
5977    #[inline]
5978    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
5979}
5980
5981unsafe impl<___D> ::fidl_next::Decode<___D> for WireExecutionControllerOnStopRequest<'static>
5982where
5983    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
5984
5985    ___D: ::fidl_next::Decoder,
5986{
5987    fn decode(
5988        slot: ::fidl_next::Slot<'_, Self>,
5989        decoder: &mut ___D,
5990    ) -> Result<(), ::fidl_next::DecodeError> {
5991        ::fidl_next::munge! {
5992            let Self {
5993                mut stopped_payload,
5994
5995            } = slot;
5996        }
5997
5998        ::fidl_next::Decode::decode(stopped_payload.as_mut(), decoder)?;
5999
6000        Ok(())
6001    }
6002}
6003
6004/// The type corresponding to the ExecutionController protocol.
6005#[derive(Debug)]
6006pub struct ExecutionController;
6007
6008pub mod execution_controller {
6009    pub mod prelude {
6010        pub use crate::{
6011            execution_controller, ExecutionController, ExecutionControllerClientHandler,
6012            ExecutionControllerClientSender, ExecutionControllerServerHandler,
6013            ExecutionControllerServerSender,
6014        };
6015
6016        pub use crate::ExecutionControllerOnStopRequest;
6017    }
6018
6019    pub struct Stop;
6020
6021    impl ::fidl_next::Method for Stop {
6022        const ORDINAL: u64 = 6256129817234858263;
6023
6024        type Protocol = crate::ExecutionController;
6025
6026        type Request = ();
6027
6028        type Response = ::fidl_next::Never;
6029    }
6030
6031    pub struct OnStop;
6032
6033    impl ::fidl_next::Method for OnStop {
6034        const ORDINAL: u64 = 7121600095714604415;
6035
6036        type Protocol = crate::ExecutionController;
6037
6038        type Request = ::fidl_next::Never;
6039
6040        type Response = crate::WireExecutionControllerOnStopRequest<'static>;
6041    }
6042}
6043
6044/// A helper trait for the `ExecutionController` client sender.
6045pub trait ExecutionControllerClientSender {
6046    type Transport: ::fidl_next::Transport;
6047
6048    #[doc = " Initiates a stop action on this component. Once complete, OnStop will be\n called with the stopped payload and this channel is closed.\n\n Note that a component may stop running on its own at any time, so it is\n possible for `OnStop` to be received before `Stop` is called.\n"]
6049    fn stop(
6050        &self,
6051    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>;
6052}
6053
6054impl<___T> ExecutionControllerClientSender for ::fidl_next::ClientSender<___T, ExecutionController>
6055where
6056    ___T: ::fidl_next::Transport,
6057{
6058    type Transport = ___T;
6059
6060    #[doc = " Initiates a stop action on this component. Once complete, OnStop will be\n called with the stopped payload and this channel is closed.\n\n Note that a component may stop running on its own at any time, so it is\n possible for `OnStop` to be received before `Stop` is called.\n"]
6061    fn stop(
6062        &self,
6063    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError> {
6064        self.as_untyped().send_one_way(6256129817234858263, ())
6065    }
6066}
6067
6068/// A client handler for the ExecutionController protocol.
6069///
6070/// See [`ExecutionController`] for more details.
6071pub trait ExecutionControllerClientHandler<___T: ::fidl_next::Transport> {
6072    #[doc = " When the child is stopped due to `Stop` being called, the child exiting\n on its own, or for any other reason, `OnStop` is called and then this\n channel is closed.\n"]
6073    fn on_stop(
6074        &mut self,
6075        sender: &::fidl_next::ClientSender<___T, ExecutionController>,
6076
6077        event: ::fidl_next::Response<___T, execution_controller::OnStop>,
6078    );
6079
6080    fn on_unknown_interaction(
6081        &mut self,
6082        sender: &::fidl_next::ClientSender<___T, ExecutionController>,
6083        ordinal: u64,
6084    ) {
6085        sender.close();
6086    }
6087}
6088
6089impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for ExecutionController
6090where
6091    ___T: ::fidl_next::Transport,
6092    ___H: ExecutionControllerClientHandler<___T>,
6093
6094    <execution_controller::OnStop as ::fidl_next::Method>::Response:
6095        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6096{
6097    fn on_event(
6098        handler: &mut ___H,
6099        sender: &::fidl_next::ClientSender<___T, Self>,
6100        ordinal: u64,
6101        buffer: ___T::RecvBuffer,
6102    ) {
6103        match ordinal {
6104            7121600095714604415 => match ::fidl_next::DecoderExt::decode(buffer) {
6105                Ok(decoded) => handler.on_stop(sender, decoded),
6106                Err(e) => {
6107                    sender.close();
6108                }
6109            },
6110
6111            ordinal => handler.on_unknown_interaction(sender, ordinal),
6112        }
6113    }
6114}
6115
6116/// A helper trait for the `ExecutionController` server sender.
6117pub trait ExecutionControllerServerSender {
6118    type Transport: ::fidl_next::Transport;
6119
6120    #[doc = " When the child is stopped due to `Stop` being called, the child exiting\n on its own, or for any other reason, `OnStop` is called and then this\n channel is closed.\n"]
6121
6122    fn on_stop<___R>(
6123        &self,
6124        request: ___R,
6125    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
6126    where
6127        ___R: ::fidl_next::Encode<
6128            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6129            Encoded = <execution_controller::OnStop as ::fidl_next::Method>::Response,
6130        >;
6131}
6132
6133impl<___T> ExecutionControllerServerSender for ::fidl_next::ServerSender<___T, ExecutionController>
6134where
6135    ___T: ::fidl_next::Transport,
6136{
6137    type Transport = ___T;
6138
6139    #[doc = " When the child is stopped due to `Stop` being called, the child exiting\n on its own, or for any other reason, `OnStop` is called and then this\n channel is closed.\n"]
6140
6141    fn on_stop<___R>(
6142        &self,
6143        request: ___R,
6144    ) -> Result<::fidl_next::SendFuture<'_, Self::Transport>, ::fidl_next::EncodeError>
6145    where
6146        ___R: ::fidl_next::Encode<
6147            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6148            Encoded = <execution_controller::OnStop as ::fidl_next::Method>::Response,
6149        >,
6150    {
6151        self.as_untyped().send_event(7121600095714604415, request)
6152    }
6153}
6154
6155/// A server handler for the ExecutionController protocol.
6156///
6157/// See [`ExecutionController`] for more details.
6158pub trait ExecutionControllerServerHandler<___T: ::fidl_next::Transport> {
6159    #[doc = " Initiates a stop action on this component. Once complete, OnStop will be\n called with the stopped payload and this channel is closed.\n\n Note that a component may stop running on its own at any time, so it is\n possible for `OnStop` to be received before `Stop` is called.\n"]
6160    fn stop(&mut self, sender: &::fidl_next::ServerSender<___T, ExecutionController>);
6161
6162    fn on_unknown_interaction(
6163        &mut self,
6164        sender: &::fidl_next::ServerSender<___T, ExecutionController>,
6165        ordinal: u64,
6166    ) {
6167        sender.close();
6168    }
6169}
6170
6171impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for ExecutionController
6172where
6173    ___T: ::fidl_next::Transport,
6174    ___H: ExecutionControllerServerHandler<___T>,
6175{
6176    fn on_one_way(
6177        handler: &mut ___H,
6178        sender: &::fidl_next::ServerSender<___T, Self>,
6179        ordinal: u64,
6180        buffer: ___T::RecvBuffer,
6181    ) {
6182        match ordinal {
6183            6256129817234858263 => {
6184                handler.stop(sender);
6185            }
6186
6187            ordinal => handler.on_unknown_interaction(sender, ordinal),
6188        }
6189    }
6190
6191    fn on_two_way(
6192        handler: &mut ___H,
6193        sender: &::fidl_next::ServerSender<___T, Self>,
6194        ordinal: u64,
6195        buffer: ___T::RecvBuffer,
6196        responder: ::fidl_next::protocol::Responder,
6197    ) {
6198        match ordinal {
6199            ordinal => handler.on_unknown_interaction(sender, ordinal),
6200        }
6201    }
6202}
6203
6204#[derive(Debug)]
6205#[repr(C)]
6206pub struct IntrospectorGetMonikerRequest {
6207    pub component_instance: ::fidl_next::fuchsia::zx::Handle,
6208}
6209
6210impl ::fidl_next::Encodable for IntrospectorGetMonikerRequest {
6211    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6212        Self,
6213        WireIntrospectorGetMonikerRequest,
6214    > = unsafe {
6215        ::fidl_next::CopyOptimization::enable_if(
6216            true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::Encodable>::COPY_OPTIMIZATION
6217                .is_enabled(),
6218        )
6219    };
6220
6221    type Encoded = WireIntrospectorGetMonikerRequest;
6222}
6223
6224unsafe impl<___E> ::fidl_next::Encode<___E> for IntrospectorGetMonikerRequest
6225where
6226    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6227
6228    ___E: ::fidl_next::fuchsia::HandleEncoder,
6229{
6230    #[inline]
6231    fn encode(
6232        self,
6233        encoder: &mut ___E,
6234        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6235    ) -> Result<(), ::fidl_next::EncodeError> {
6236        ::fidl_next::munge! {
6237            let Self::Encoded {
6238                component_instance,
6239
6240            } = out;
6241        }
6242
6243        ::fidl_next::Encode::encode(self.component_instance, encoder, component_instance)?;
6244
6245        Ok(())
6246    }
6247}
6248
6249impl ::fidl_next::EncodableOption for IntrospectorGetMonikerRequest {
6250    type EncodedOption = ::fidl_next::WireBox<'static, WireIntrospectorGetMonikerRequest>;
6251}
6252
6253unsafe impl<___E> ::fidl_next::EncodeOption<___E> for IntrospectorGetMonikerRequest
6254where
6255    ___E: ::fidl_next::Encoder + ?Sized,
6256    IntrospectorGetMonikerRequest: ::fidl_next::Encode<___E>,
6257{
6258    #[inline]
6259    fn encode_option(
6260        this: Option<Self>,
6261        encoder: &mut ___E,
6262        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6263    ) -> Result<(), ::fidl_next::EncodeError> {
6264        if let Some(inner) = this {
6265            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6266            ::fidl_next::WireBox::encode_present(out);
6267        } else {
6268            ::fidl_next::WireBox::encode_absent(out);
6269        }
6270
6271        Ok(())
6272    }
6273}
6274
6275impl ::fidl_next::FromWire<WireIntrospectorGetMonikerRequest> for IntrospectorGetMonikerRequest {
6276    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
6277        WireIntrospectorGetMonikerRequest,
6278        Self,
6279    > = unsafe {
6280        ::fidl_next::CopyOptimization::enable_if(
6281            true && <::fidl_next::fuchsia::zx::Handle as ::fidl_next::FromWire<
6282                ::fidl_next::fuchsia::WireHandle,
6283            >>::COPY_OPTIMIZATION
6284                .is_enabled(),
6285        )
6286    };
6287
6288    #[inline]
6289    fn from_wire(wire: WireIntrospectorGetMonikerRequest) -> Self {
6290        Self { component_instance: ::fidl_next::FromWire::from_wire(wire.component_instance) }
6291    }
6292}
6293
6294/// The wire type corresponding to [`IntrospectorGetMonikerRequest`].
6295#[derive(Debug)]
6296#[repr(C)]
6297pub struct WireIntrospectorGetMonikerRequest {
6298    pub component_instance: ::fidl_next::fuchsia::WireHandle,
6299}
6300
6301unsafe impl ::fidl_next::Wire for WireIntrospectorGetMonikerRequest {
6302    type Decoded<'de> = WireIntrospectorGetMonikerRequest;
6303
6304    #[inline]
6305    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6306}
6307
6308unsafe impl<___D> ::fidl_next::Decode<___D> for WireIntrospectorGetMonikerRequest
6309where
6310    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6311
6312    ___D: ::fidl_next::fuchsia::HandleDecoder,
6313{
6314    fn decode(
6315        slot: ::fidl_next::Slot<'_, Self>,
6316        decoder: &mut ___D,
6317    ) -> Result<(), ::fidl_next::DecodeError> {
6318        ::fidl_next::munge! {
6319            let Self {
6320                mut component_instance,
6321
6322            } = slot;
6323        }
6324
6325        ::fidl_next::Decode::decode(component_instance.as_mut(), decoder)?;
6326
6327        Ok(())
6328    }
6329}
6330
6331#[derive(Clone, Debug)]
6332pub struct IntrospectorGetMonikerResponse {
6333    pub moniker: String,
6334}
6335
6336impl ::fidl_next::Encodable for IntrospectorGetMonikerResponse {
6337    type Encoded = WireIntrospectorGetMonikerResponse<'static>;
6338}
6339
6340unsafe impl<___E> ::fidl_next::Encode<___E> for IntrospectorGetMonikerResponse
6341where
6342    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6343
6344    ___E: ::fidl_next::Encoder,
6345{
6346    #[inline]
6347    fn encode(
6348        self,
6349        encoder: &mut ___E,
6350        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6351    ) -> Result<(), ::fidl_next::EncodeError> {
6352        ::fidl_next::munge! {
6353            let Self::Encoded {
6354                moniker,
6355
6356            } = out;
6357        }
6358
6359        ::fidl_next::Encode::encode(self.moniker, encoder, moniker)?;
6360
6361        Ok(())
6362    }
6363}
6364
6365unsafe impl<___E> ::fidl_next::EncodeRef<___E> for IntrospectorGetMonikerResponse
6366where
6367    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6368
6369    ___E: ::fidl_next::Encoder,
6370{
6371    #[inline]
6372    fn encode_ref(
6373        &self,
6374        encoder: &mut ___E,
6375        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6376    ) -> Result<(), ::fidl_next::EncodeError> {
6377        ::fidl_next::munge! {
6378            let Self::Encoded {
6379                moniker,
6380
6381            } = out;
6382        }
6383
6384        ::fidl_next::EncodeRef::encode_ref(&self.moniker, encoder, moniker)?;
6385
6386        Ok(())
6387    }
6388}
6389
6390impl ::fidl_next::EncodableOption for IntrospectorGetMonikerResponse {
6391    type EncodedOption = ::fidl_next::WireBox<'static, WireIntrospectorGetMonikerResponse<'static>>;
6392}
6393
6394unsafe impl<___E> ::fidl_next::EncodeOption<___E> for IntrospectorGetMonikerResponse
6395where
6396    ___E: ::fidl_next::Encoder + ?Sized,
6397    IntrospectorGetMonikerResponse: ::fidl_next::Encode<___E>,
6398{
6399    #[inline]
6400    fn encode_option(
6401        this: Option<Self>,
6402        encoder: &mut ___E,
6403        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6404    ) -> Result<(), ::fidl_next::EncodeError> {
6405        if let Some(inner) = this {
6406            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6407            ::fidl_next::WireBox::encode_present(out);
6408        } else {
6409            ::fidl_next::WireBox::encode_absent(out);
6410        }
6411
6412        Ok(())
6413    }
6414}
6415
6416unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for IntrospectorGetMonikerResponse
6417where
6418    ___E: ::fidl_next::Encoder + ?Sized,
6419    IntrospectorGetMonikerResponse: ::fidl_next::EncodeRef<___E>,
6420{
6421    #[inline]
6422    fn encode_option_ref(
6423        this: Option<&Self>,
6424        encoder: &mut ___E,
6425        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6426    ) -> Result<(), ::fidl_next::EncodeError> {
6427        if let Some(inner) = this {
6428            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6429            ::fidl_next::WireBox::encode_present(out);
6430        } else {
6431            ::fidl_next::WireBox::encode_absent(out);
6432        }
6433
6434        Ok(())
6435    }
6436}
6437
6438impl<'de> ::fidl_next::FromWire<WireIntrospectorGetMonikerResponse<'de>>
6439    for IntrospectorGetMonikerResponse
6440{
6441    #[inline]
6442    fn from_wire(wire: WireIntrospectorGetMonikerResponse<'de>) -> Self {
6443        Self { moniker: ::fidl_next::FromWire::from_wire(wire.moniker) }
6444    }
6445}
6446
6447impl<'de> ::fidl_next::FromWireRef<WireIntrospectorGetMonikerResponse<'de>>
6448    for IntrospectorGetMonikerResponse
6449{
6450    #[inline]
6451    fn from_wire_ref(wire: &WireIntrospectorGetMonikerResponse<'de>) -> Self {
6452        Self { moniker: ::fidl_next::FromWireRef::from_wire_ref(&wire.moniker) }
6453    }
6454}
6455
6456/// The wire type corresponding to [`IntrospectorGetMonikerResponse`].
6457#[derive(Debug)]
6458#[repr(C)]
6459pub struct WireIntrospectorGetMonikerResponse<'de> {
6460    pub moniker: ::fidl_next::WireString<'de>,
6461}
6462
6463unsafe impl ::fidl_next::Wire for WireIntrospectorGetMonikerResponse<'static> {
6464    type Decoded<'de> = WireIntrospectorGetMonikerResponse<'de>;
6465
6466    #[inline]
6467    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6468}
6469
6470unsafe impl<___D> ::fidl_next::Decode<___D> for WireIntrospectorGetMonikerResponse<'static>
6471where
6472    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6473
6474    ___D: ::fidl_next::Decoder,
6475{
6476    fn decode(
6477        slot: ::fidl_next::Slot<'_, Self>,
6478        decoder: &mut ___D,
6479    ) -> Result<(), ::fidl_next::DecodeError> {
6480        ::fidl_next::munge! {
6481            let Self {
6482                mut moniker,
6483
6484            } = slot;
6485        }
6486
6487        ::fidl_next::Decode::decode(moniker.as_mut(), decoder)?;
6488
6489        let moniker = unsafe { moniker.deref_unchecked() };
6490
6491        if moniker.len() > 4096 {
6492            return Err(::fidl_next::DecodeError::VectorTooLong {
6493                size: moniker.len() as u64,
6494                limit: 4096,
6495            });
6496        }
6497
6498        Ok(())
6499    }
6500}
6501
6502/// The type corresponding to the Introspector protocol.
6503#[doc = " A protocol used by a component instance to obtain information about\n components in its own realm.\n\n This protocol only supports getting the moniker at the moment but could\n expand to other privileged information such as the URL of a component.\n\n The component framework provides this capability to components that use\n `fuchsia.component.Introspector` from framework.\n"]
6504#[derive(Debug)]
6505pub struct Introspector;
6506
6507impl ::fidl_next::Discoverable for Introspector {
6508    const PROTOCOL_NAME: &'static str = "fuchsia.component.Introspector";
6509}
6510
6511pub mod introspector {
6512    pub mod prelude {
6513        pub use crate::{
6514            introspector, Introspector, IntrospectorClientHandler, IntrospectorClientSender,
6515            IntrospectorServerHandler, IntrospectorServerSender,
6516        };
6517
6518        pub use crate::Error;
6519
6520        pub use crate::IntrospectorGetMonikerRequest;
6521
6522        pub use crate::IntrospectorGetMonikerResponse;
6523    }
6524
6525    pub struct GetMoniker;
6526
6527    impl ::fidl_next::Method for GetMoniker {
6528        const ORDINAL: u64 = 214344082539672664;
6529
6530        type Protocol = crate::Introspector;
6531
6532        type Request = crate::WireIntrospectorGetMonikerRequest;
6533
6534        type Response = ::fidl_next::WireFlexibleResult<
6535            'static,
6536            crate::WireIntrospectorGetMonikerResponse<'static>,
6537            crate::WireError,
6538        >;
6539    }
6540}
6541
6542/// A helper trait for the `Introspector` client sender.
6543pub trait IntrospectorClientSender {
6544    type Transport: ::fidl_next::Transport;
6545
6546    #[doc = " Obtains the moniker relative to this realm of the component\n corresponding to the provided token. Runners may obtain the token via\n `fuchsia.component.runner/ComponentStartInfo.component_instance`.\n\n Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or\n does not correspond to a component under this realm.\n"]
6547    fn get_moniker<___R>(
6548        &self,
6549        request: ___R,
6550    ) -> Result<
6551        ::fidl_next::ResponseFuture<'_, Self::Transport, introspector::GetMoniker>,
6552        ::fidl_next::EncodeError,
6553    >
6554    where
6555        ___R: ::fidl_next::Encode<
6556            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6557            Encoded = crate::WireIntrospectorGetMonikerRequest,
6558        >;
6559}
6560
6561impl<___T> IntrospectorClientSender for ::fidl_next::ClientSender<___T, Introspector>
6562where
6563    ___T: ::fidl_next::Transport,
6564{
6565    type Transport = ___T;
6566
6567    #[doc = " Obtains the moniker relative to this realm of the component\n corresponding to the provided token. Runners may obtain the token via\n `fuchsia.component.runner/ComponentStartInfo.component_instance`.\n\n Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or\n does not correspond to a component under this realm.\n"]
6568    fn get_moniker<___R>(
6569        &self,
6570        request: ___R,
6571    ) -> Result<
6572        ::fidl_next::ResponseFuture<'_, Self::Transport, introspector::GetMoniker>,
6573        ::fidl_next::EncodeError,
6574    >
6575    where
6576        ___R: ::fidl_next::Encode<
6577            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
6578            Encoded = crate::WireIntrospectorGetMonikerRequest,
6579        >,
6580    {
6581        self.as_untyped()
6582            .send_two_way(214344082539672664, request)
6583            .map(::fidl_next::ResponseFuture::from_untyped)
6584    }
6585}
6586
6587/// A client handler for the Introspector protocol.
6588///
6589/// See [`Introspector`] for more details.
6590pub trait IntrospectorClientHandler<___T: ::fidl_next::Transport> {
6591    fn on_unknown_interaction(
6592        &mut self,
6593        sender: &::fidl_next::ClientSender<___T, Introspector>,
6594        ordinal: u64,
6595    ) {
6596        sender.close();
6597    }
6598}
6599
6600impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Introspector
6601where
6602    ___T: ::fidl_next::Transport,
6603    ___H: IntrospectorClientHandler<___T>,
6604
6605    <introspector::GetMoniker as ::fidl_next::Method>::Response:
6606        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6607{
6608    fn on_event(
6609        handler: &mut ___H,
6610        sender: &::fidl_next::ClientSender<___T, Self>,
6611        ordinal: u64,
6612        buffer: ___T::RecvBuffer,
6613    ) {
6614        match ordinal {
6615            ordinal => handler.on_unknown_interaction(sender, ordinal),
6616        }
6617    }
6618}
6619
6620/// A helper trait for the `Introspector` server sender.
6621pub trait IntrospectorServerSender {
6622    type Transport: ::fidl_next::Transport;
6623}
6624
6625impl<___T> IntrospectorServerSender for ::fidl_next::ServerSender<___T, Introspector>
6626where
6627    ___T: ::fidl_next::Transport,
6628{
6629    type Transport = ___T;
6630}
6631
6632/// A server handler for the Introspector protocol.
6633///
6634/// See [`Introspector`] for more details.
6635pub trait IntrospectorServerHandler<___T: ::fidl_next::Transport> {
6636    #[doc = " Obtains the moniker relative to this realm of the component\n corresponding to the provided token. Runners may obtain the token via\n `fuchsia.component.runner/ComponentStartInfo.component_instance`.\n\n Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or\n does not correspond to a component under this realm.\n"]
6637    fn get_moniker(
6638        &mut self,
6639        sender: &::fidl_next::ServerSender<___T, Introspector>,
6640
6641        request: ::fidl_next::Request<___T, introspector::GetMoniker>,
6642
6643        responder: ::fidl_next::Responder<introspector::GetMoniker>,
6644    );
6645
6646    fn on_unknown_interaction(
6647        &mut self,
6648        sender: &::fidl_next::ServerSender<___T, Introspector>,
6649        ordinal: u64,
6650    ) {
6651        sender.close();
6652    }
6653}
6654
6655impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Introspector
6656where
6657    ___T: ::fidl_next::Transport,
6658    ___H: IntrospectorServerHandler<___T>,
6659
6660    <introspector::GetMoniker as ::fidl_next::Method>::Request:
6661        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
6662{
6663    fn on_one_way(
6664        handler: &mut ___H,
6665        sender: &::fidl_next::ServerSender<___T, Self>,
6666        ordinal: u64,
6667        buffer: ___T::RecvBuffer,
6668    ) {
6669        match ordinal {
6670            ordinal => handler.on_unknown_interaction(sender, ordinal),
6671        }
6672    }
6673
6674    fn on_two_way(
6675        handler: &mut ___H,
6676        sender: &::fidl_next::ServerSender<___T, Self>,
6677        ordinal: u64,
6678        buffer: ___T::RecvBuffer,
6679        responder: ::fidl_next::protocol::Responder,
6680    ) {
6681        match ordinal {
6682            214344082539672664 => {
6683                let responder = ::fidl_next::Responder::from_untyped(responder);
6684
6685                match ::fidl_next::DecoderExt::decode(buffer) {
6686                    Ok(decoded) => handler.get_moniker(sender, decoded, responder),
6687                    Err(e) => {
6688                        sender.close();
6689                    }
6690                }
6691            }
6692
6693            ordinal => handler.on_unknown_interaction(sender, ordinal),
6694        }
6695    }
6696}
6697
6698#[doc = " The maximum string length of a capability ID.\n This value is currently set arbitrarily.\n"]
6699pub const MAX_CAPABILITY_ID_LENGTH: u64 = 50;
6700
6701pub const MAX_CHILD_NAME_LENGTH: u32 = 1024;
6702
6703#[doc = " The maximum string length of an error description.\n"]
6704pub const MAX_ERROR_DESCRIPTION_LENGTH: u64 = 100;
6705
6706#[doc = " The maximum number of events that a receiver can listen to.\n"]
6707pub const MAX_NUM_EVENTS_RECEIVED: u64 = 100;
6708
6709#[doc = " The maximum number of requests per event subscription.\n"]
6710pub const MAX_SUBSCRIPTION_REQUESTS: u32 = 2;
6711
6712pub const MAX_URL_SCHEME_LENGTH: u64 = 255;
6713
6714#[derive(Debug)]
6715pub struct NamespaceInputEntry {
6716    pub path: String,
6717
6718    pub dictionary: ::fidl_next::ClientEnd<
6719        ::fidl_next::fuchsia::zx::Channel,
6720        ::fidl_next_fuchsia_component_sandbox::Dictionary,
6721    >,
6722}
6723
6724impl ::fidl_next::Encodable for NamespaceInputEntry {
6725    type Encoded = WireNamespaceInputEntry<'static>;
6726}
6727
6728unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceInputEntry
6729where
6730    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6731
6732    ___E: ::fidl_next::Encoder,
6733
6734    ___E: ::fidl_next::fuchsia::HandleEncoder,
6735{
6736    #[inline]
6737    fn encode(
6738        self,
6739        encoder: &mut ___E,
6740        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6741    ) -> Result<(), ::fidl_next::EncodeError> {
6742        ::fidl_next::munge! {
6743            let Self::Encoded {
6744                path,
6745                dictionary,
6746
6747            } = out;
6748        }
6749
6750        ::fidl_next::Encode::encode(self.path, encoder, path)?;
6751
6752        ::fidl_next::Encode::encode(self.dictionary, encoder, dictionary)?;
6753
6754        Ok(())
6755    }
6756}
6757
6758impl ::fidl_next::EncodableOption for NamespaceInputEntry {
6759    type EncodedOption = ::fidl_next::WireBox<'static, WireNamespaceInputEntry<'static>>;
6760}
6761
6762unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NamespaceInputEntry
6763where
6764    ___E: ::fidl_next::Encoder + ?Sized,
6765    NamespaceInputEntry: ::fidl_next::Encode<___E>,
6766{
6767    #[inline]
6768    fn encode_option(
6769        this: Option<Self>,
6770        encoder: &mut ___E,
6771        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6772    ) -> Result<(), ::fidl_next::EncodeError> {
6773        if let Some(inner) = this {
6774            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6775            ::fidl_next::WireBox::encode_present(out);
6776        } else {
6777            ::fidl_next::WireBox::encode_absent(out);
6778        }
6779
6780        Ok(())
6781    }
6782}
6783
6784impl<'de> ::fidl_next::FromWire<WireNamespaceInputEntry<'de>> for NamespaceInputEntry {
6785    #[inline]
6786    fn from_wire(wire: WireNamespaceInputEntry<'de>) -> Self {
6787        Self {
6788            path: ::fidl_next::FromWire::from_wire(wire.path),
6789
6790            dictionary: ::fidl_next::FromWire::from_wire(wire.dictionary),
6791        }
6792    }
6793}
6794
6795/// The wire type corresponding to [`NamespaceInputEntry`].
6796#[derive(Debug)]
6797#[repr(C)]
6798pub struct WireNamespaceInputEntry<'de> {
6799    pub path: ::fidl_next::WireString<'de>,
6800
6801    pub dictionary: ::fidl_next::ClientEnd<
6802        ::fidl_next::fuchsia::WireChannel,
6803        ::fidl_next_fuchsia_component_sandbox::Dictionary,
6804    >,
6805}
6806
6807unsafe impl ::fidl_next::Wire for WireNamespaceInputEntry<'static> {
6808    type Decoded<'de> = WireNamespaceInputEntry<'de>;
6809
6810    #[inline]
6811    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
6812        unsafe {
6813            out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
6814        }
6815    }
6816}
6817
6818unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceInputEntry<'static>
6819where
6820    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6821
6822    ___D: ::fidl_next::Decoder,
6823
6824    ___D: ::fidl_next::fuchsia::HandleDecoder,
6825{
6826    fn decode(
6827        slot: ::fidl_next::Slot<'_, Self>,
6828        decoder: &mut ___D,
6829    ) -> Result<(), ::fidl_next::DecodeError> {
6830        ::fidl_next::munge! {
6831            let Self {
6832                mut path,
6833                mut dictionary,
6834
6835            } = slot;
6836        }
6837
6838        ::fidl_next::Decode::decode(path.as_mut(), decoder)?;
6839
6840        let path = unsafe { path.deref_unchecked() };
6841
6842        if path.len() > 4095 {
6843            return Err(::fidl_next::DecodeError::VectorTooLong {
6844                size: path.len() as u64,
6845                limit: 4095,
6846            });
6847        }
6848
6849        ::fidl_next::Decode::decode(dictionary.as_mut(), decoder)?;
6850
6851        Ok(())
6852    }
6853}
6854
6855#[derive(Debug)]
6856pub struct NamespaceCreateRequest {
6857    pub entries: Vec<crate::NamespaceInputEntry>,
6858}
6859
6860impl ::fidl_next::Encodable for NamespaceCreateRequest {
6861    type Encoded = WireNamespaceCreateRequest<'static>;
6862}
6863
6864unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceCreateRequest
6865where
6866    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
6867
6868    ___E: ::fidl_next::Encoder,
6869
6870    ___E: ::fidl_next::fuchsia::HandleEncoder,
6871{
6872    #[inline]
6873    fn encode(
6874        self,
6875        encoder: &mut ___E,
6876        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
6877    ) -> Result<(), ::fidl_next::EncodeError> {
6878        ::fidl_next::munge! {
6879            let Self::Encoded {
6880                entries,
6881
6882            } = out;
6883        }
6884
6885        ::fidl_next::Encode::encode(self.entries, encoder, entries)?;
6886
6887        Ok(())
6888    }
6889}
6890
6891impl ::fidl_next::EncodableOption for NamespaceCreateRequest {
6892    type EncodedOption = ::fidl_next::WireBox<'static, WireNamespaceCreateRequest<'static>>;
6893}
6894
6895unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NamespaceCreateRequest
6896where
6897    ___E: ::fidl_next::Encoder + ?Sized,
6898    NamespaceCreateRequest: ::fidl_next::Encode<___E>,
6899{
6900    #[inline]
6901    fn encode_option(
6902        this: Option<Self>,
6903        encoder: &mut ___E,
6904        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
6905    ) -> Result<(), ::fidl_next::EncodeError> {
6906        if let Some(inner) = this {
6907            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
6908            ::fidl_next::WireBox::encode_present(out);
6909        } else {
6910            ::fidl_next::WireBox::encode_absent(out);
6911        }
6912
6913        Ok(())
6914    }
6915}
6916
6917impl<'de> ::fidl_next::FromWire<WireNamespaceCreateRequest<'de>> for NamespaceCreateRequest {
6918    #[inline]
6919    fn from_wire(wire: WireNamespaceCreateRequest<'de>) -> Self {
6920        Self { entries: ::fidl_next::FromWire::from_wire(wire.entries) }
6921    }
6922}
6923
6924/// The wire type corresponding to [`NamespaceCreateRequest`].
6925#[derive(Debug)]
6926#[repr(C)]
6927pub struct WireNamespaceCreateRequest<'de> {
6928    pub entries: ::fidl_next::WireVector<'de, crate::WireNamespaceInputEntry<'de>>,
6929}
6930
6931unsafe impl ::fidl_next::Wire for WireNamespaceCreateRequest<'static> {
6932    type Decoded<'de> = WireNamespaceCreateRequest<'de>;
6933
6934    #[inline]
6935    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
6936}
6937
6938unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceCreateRequest<'static>
6939where
6940    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
6941
6942    ___D: ::fidl_next::Decoder,
6943
6944    ___D: ::fidl_next::fuchsia::HandleDecoder,
6945{
6946    fn decode(
6947        slot: ::fidl_next::Slot<'_, Self>,
6948        decoder: &mut ___D,
6949    ) -> Result<(), ::fidl_next::DecodeError> {
6950        ::fidl_next::munge! {
6951            let Self {
6952                mut entries,
6953
6954            } = slot;
6955        }
6956
6957        ::fidl_next::Decode::decode(entries.as_mut(), decoder)?;
6958
6959        Ok(())
6960    }
6961}
6962
6963#[doc = " Error returned from methods in [`Namespace`].\n"]
6964#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6965#[repr(u32)]
6966pub enum NamespaceError {
6967    Shadow = 1,
6968    Duplicate = 2,
6969    Conversion = 3,
6970    BadEntry = 4,
6971    DictionaryRead = 5,
6972    UnknownOrdinal_(u32),
6973}
6974
6975impl ::fidl_next::Encodable for NamespaceError {
6976    type Encoded = WireNamespaceError;
6977}
6978impl ::std::convert::From<u32> for NamespaceError {
6979    fn from(value: u32) -> Self {
6980        match value {
6981            1 => Self::Shadow,
6982            2 => Self::Duplicate,
6983            3 => Self::Conversion,
6984            4 => Self::BadEntry,
6985            5 => Self::DictionaryRead,
6986
6987            _ => Self::UnknownOrdinal_(value),
6988        }
6989    }
6990}
6991
6992unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceError
6993where
6994    ___E: ?Sized,
6995{
6996    #[inline]
6997    fn encode(
6998        self,
6999        encoder: &mut ___E,
7000        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7001    ) -> Result<(), ::fidl_next::EncodeError> {
7002        ::fidl_next::EncodeRef::encode_ref(&self, encoder, out)
7003    }
7004}
7005
7006unsafe impl<___E> ::fidl_next::EncodeRef<___E> for NamespaceError
7007where
7008    ___E: ?Sized,
7009{
7010    #[inline]
7011    fn encode_ref(
7012        &self,
7013        encoder: &mut ___E,
7014        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7015    ) -> Result<(), ::fidl_next::EncodeError> {
7016        ::fidl_next::munge!(let WireNamespaceError { value } = out);
7017        let _ = value.write(::fidl_next::WireU32::from(match *self {
7018            Self::Shadow => 1,
7019
7020            Self::Duplicate => 2,
7021
7022            Self::Conversion => 3,
7023
7024            Self::BadEntry => 4,
7025
7026            Self::DictionaryRead => 5,
7027
7028            Self::UnknownOrdinal_(value) => value,
7029        }));
7030
7031        Ok(())
7032    }
7033}
7034
7035impl ::core::convert::From<WireNamespaceError> for NamespaceError {
7036    fn from(wire: WireNamespaceError) -> Self {
7037        match u32::from(wire.value) {
7038            1 => Self::Shadow,
7039
7040            2 => Self::Duplicate,
7041
7042            3 => Self::Conversion,
7043
7044            4 => Self::BadEntry,
7045
7046            5 => Self::DictionaryRead,
7047
7048            value => Self::UnknownOrdinal_(value),
7049        }
7050    }
7051}
7052
7053impl ::fidl_next::FromWire<WireNamespaceError> for NamespaceError {
7054    #[inline]
7055    fn from_wire(wire: WireNamespaceError) -> Self {
7056        Self::from(wire)
7057    }
7058}
7059
7060impl ::fidl_next::FromWireRef<WireNamespaceError> for NamespaceError {
7061    #[inline]
7062    fn from_wire_ref(wire: &WireNamespaceError) -> Self {
7063        Self::from(*wire)
7064    }
7065}
7066
7067/// The wire type corresponding to [`NamespaceError`].
7068#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7069#[repr(transparent)]
7070pub struct WireNamespaceError {
7071    value: ::fidl_next::WireU32,
7072}
7073
7074unsafe impl ::fidl_next::Wire for WireNamespaceError {
7075    type Decoded<'de> = Self;
7076
7077    #[inline]
7078    fn zero_padding(_: &mut ::core::mem::MaybeUninit<Self>) {
7079        // Wire enums have no padding
7080    }
7081}
7082
7083impl WireNamespaceError {
7084    pub const SHADOW: WireNamespaceError = WireNamespaceError { value: ::fidl_next::WireU32(1) };
7085
7086    pub const DUPLICATE: WireNamespaceError = WireNamespaceError { value: ::fidl_next::WireU32(2) };
7087
7088    pub const CONVERSION: WireNamespaceError =
7089        WireNamespaceError { value: ::fidl_next::WireU32(3) };
7090
7091    pub const BAD_ENTRY: WireNamespaceError = WireNamespaceError { value: ::fidl_next::WireU32(4) };
7092
7093    pub const DICTIONARY_READ: WireNamespaceError =
7094        WireNamespaceError { value: ::fidl_next::WireU32(5) };
7095}
7096
7097unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceError
7098where
7099    ___D: ?Sized,
7100{
7101    fn decode(
7102        slot: ::fidl_next::Slot<'_, Self>,
7103        _: &mut ___D,
7104    ) -> Result<(), ::fidl_next::DecodeError> {
7105        Ok(())
7106    }
7107}
7108
7109impl ::core::convert::From<NamespaceError> for WireNamespaceError {
7110    fn from(natural: NamespaceError) -> Self {
7111        match natural {
7112            NamespaceError::Shadow => WireNamespaceError::SHADOW,
7113
7114            NamespaceError::Duplicate => WireNamespaceError::DUPLICATE,
7115
7116            NamespaceError::Conversion => WireNamespaceError::CONVERSION,
7117
7118            NamespaceError::BadEntry => WireNamespaceError::BAD_ENTRY,
7119
7120            NamespaceError::DictionaryRead => WireNamespaceError::DICTIONARY_READ,
7121
7122            NamespaceError::UnknownOrdinal_(value) => {
7123                WireNamespaceError { value: ::fidl_next::WireU32::from(value) }
7124            }
7125        }
7126    }
7127}
7128
7129#[derive(Debug)]
7130pub struct NamespaceCreateResponse {
7131    pub entries: Vec<crate::NamespaceEntry>,
7132}
7133
7134impl ::fidl_next::Encodable for NamespaceCreateResponse {
7135    type Encoded = WireNamespaceCreateResponse<'static>;
7136}
7137
7138unsafe impl<___E> ::fidl_next::Encode<___E> for NamespaceCreateResponse
7139where
7140    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7141
7142    ___E: ::fidl_next::Encoder,
7143
7144    ___E: ::fidl_next::fuchsia::HandleEncoder,
7145{
7146    #[inline]
7147    fn encode(
7148        self,
7149        encoder: &mut ___E,
7150        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7151    ) -> Result<(), ::fidl_next::EncodeError> {
7152        ::fidl_next::munge! {
7153            let Self::Encoded {
7154                entries,
7155
7156            } = out;
7157        }
7158
7159        ::fidl_next::Encode::encode(self.entries, encoder, entries)?;
7160
7161        Ok(())
7162    }
7163}
7164
7165impl ::fidl_next::EncodableOption for NamespaceCreateResponse {
7166    type EncodedOption = ::fidl_next::WireBox<'static, WireNamespaceCreateResponse<'static>>;
7167}
7168
7169unsafe impl<___E> ::fidl_next::EncodeOption<___E> for NamespaceCreateResponse
7170where
7171    ___E: ::fidl_next::Encoder + ?Sized,
7172    NamespaceCreateResponse: ::fidl_next::Encode<___E>,
7173{
7174    #[inline]
7175    fn encode_option(
7176        this: Option<Self>,
7177        encoder: &mut ___E,
7178        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7179    ) -> Result<(), ::fidl_next::EncodeError> {
7180        if let Some(inner) = this {
7181            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7182            ::fidl_next::WireBox::encode_present(out);
7183        } else {
7184            ::fidl_next::WireBox::encode_absent(out);
7185        }
7186
7187        Ok(())
7188    }
7189}
7190
7191impl<'de> ::fidl_next::FromWire<WireNamespaceCreateResponse<'de>> for NamespaceCreateResponse {
7192    #[inline]
7193    fn from_wire(wire: WireNamespaceCreateResponse<'de>) -> Self {
7194        Self { entries: ::fidl_next::FromWire::from_wire(wire.entries) }
7195    }
7196}
7197
7198/// The wire type corresponding to [`NamespaceCreateResponse`].
7199#[derive(Debug)]
7200#[repr(C)]
7201pub struct WireNamespaceCreateResponse<'de> {
7202    pub entries: ::fidl_next::WireVector<'de, crate::WireNamespaceEntry<'de>>,
7203}
7204
7205unsafe impl ::fidl_next::Wire for WireNamespaceCreateResponse<'static> {
7206    type Decoded<'de> = WireNamespaceCreateResponse<'de>;
7207
7208    #[inline]
7209    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7210}
7211
7212unsafe impl<___D> ::fidl_next::Decode<___D> for WireNamespaceCreateResponse<'static>
7213where
7214    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7215
7216    ___D: ::fidl_next::Decoder,
7217
7218    ___D: ::fidl_next::fuchsia::HandleDecoder,
7219{
7220    fn decode(
7221        slot: ::fidl_next::Slot<'_, Self>,
7222        decoder: &mut ___D,
7223    ) -> Result<(), ::fidl_next::DecodeError> {
7224        ::fidl_next::munge! {
7225            let Self {
7226                mut entries,
7227
7228            } = slot;
7229        }
7230
7231        ::fidl_next::Decode::decode(entries.as_mut(), decoder)?;
7232
7233        Ok(())
7234    }
7235}
7236
7237/// The type corresponding to the Namespace protocol.
7238#[doc = " Protocol for performing namespace operations.\n"]
7239#[derive(Debug)]
7240pub struct Namespace;
7241
7242impl ::fidl_next::Discoverable for Namespace {
7243    const PROTOCOL_NAME: &'static str = "fuchsia.component.Namespace";
7244}
7245
7246pub mod namespace {
7247    pub mod prelude {
7248        pub use crate::{
7249            namespace, Namespace, NamespaceClientHandler, NamespaceClientSender,
7250            NamespaceServerHandler, NamespaceServerSender,
7251        };
7252
7253        pub use crate::NamespaceCreateRequest;
7254
7255        pub use crate::NamespaceError;
7256
7257        pub use crate::NamespaceCreateResponse;
7258    }
7259
7260    pub struct Create;
7261
7262    impl ::fidl_next::Method for Create {
7263        const ORDINAL: u64 = 4839678630846501113;
7264
7265        type Protocol = crate::Namespace;
7266
7267        type Request = crate::WireNamespaceCreateRequest<'static>;
7268
7269        type Response = ::fidl_next::WireFlexibleResult<
7270            'static,
7271            crate::WireNamespaceCreateResponse<'static>,
7272            crate::WireNamespaceError,
7273        >;
7274    }
7275}
7276
7277/// A helper trait for the `Namespace` client sender.
7278pub trait NamespaceClientSender {
7279    type Transport: ::fidl_next::Transport;
7280
7281    fn create<___R>(
7282        &self,
7283        request: ___R,
7284    ) -> Result<
7285        ::fidl_next::ResponseFuture<'_, Self::Transport, namespace::Create>,
7286        ::fidl_next::EncodeError,
7287    >
7288    where
7289        ___R: ::fidl_next::Encode<
7290            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7291            Encoded = crate::WireNamespaceCreateRequest<'static>,
7292        >;
7293}
7294
7295impl<___T> NamespaceClientSender for ::fidl_next::ClientSender<___T, Namespace>
7296where
7297    ___T: ::fidl_next::Transport,
7298{
7299    type Transport = ___T;
7300
7301    fn create<___R>(
7302        &self,
7303        request: ___R,
7304    ) -> Result<
7305        ::fidl_next::ResponseFuture<'_, Self::Transport, namespace::Create>,
7306        ::fidl_next::EncodeError,
7307    >
7308    where
7309        ___R: ::fidl_next::Encode<
7310            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
7311            Encoded = crate::WireNamespaceCreateRequest<'static>,
7312        >,
7313    {
7314        self.as_untyped()
7315            .send_two_way(4839678630846501113, request)
7316            .map(::fidl_next::ResponseFuture::from_untyped)
7317    }
7318}
7319
7320/// A client handler for the Namespace protocol.
7321///
7322/// See [`Namespace`] for more details.
7323pub trait NamespaceClientHandler<___T: ::fidl_next::Transport> {
7324    fn on_unknown_interaction(
7325        &mut self,
7326        sender: &::fidl_next::ClientSender<___T, Namespace>,
7327        ordinal: u64,
7328    ) {
7329        sender.close();
7330    }
7331}
7332
7333impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Namespace
7334where
7335    ___T: ::fidl_next::Transport,
7336    ___H: NamespaceClientHandler<___T>,
7337
7338    <namespace::Create as ::fidl_next::Method>::Response:
7339        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7340{
7341    fn on_event(
7342        handler: &mut ___H,
7343        sender: &::fidl_next::ClientSender<___T, Self>,
7344        ordinal: u64,
7345        buffer: ___T::RecvBuffer,
7346    ) {
7347        match ordinal {
7348            ordinal => handler.on_unknown_interaction(sender, ordinal),
7349        }
7350    }
7351}
7352
7353/// A helper trait for the `Namespace` server sender.
7354pub trait NamespaceServerSender {
7355    type Transport: ::fidl_next::Transport;
7356}
7357
7358impl<___T> NamespaceServerSender for ::fidl_next::ServerSender<___T, Namespace>
7359where
7360    ___T: ::fidl_next::Transport,
7361{
7362    type Transport = ___T;
7363}
7364
7365/// A server handler for the Namespace protocol.
7366///
7367/// See [`Namespace`] for more details.
7368pub trait NamespaceServerHandler<___T: ::fidl_next::Transport> {
7369    fn create(
7370        &mut self,
7371        sender: &::fidl_next::ServerSender<___T, Namespace>,
7372
7373        request: ::fidl_next::Request<___T, namespace::Create>,
7374
7375        responder: ::fidl_next::Responder<namespace::Create>,
7376    );
7377
7378    fn on_unknown_interaction(
7379        &mut self,
7380        sender: &::fidl_next::ServerSender<___T, Namespace>,
7381        ordinal: u64,
7382    ) {
7383        sender.close();
7384    }
7385}
7386
7387impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Namespace
7388where
7389    ___T: ::fidl_next::Transport,
7390    ___H: NamespaceServerHandler<___T>,
7391
7392    <namespace::Create as ::fidl_next::Method>::Request:
7393        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
7394{
7395    fn on_one_way(
7396        handler: &mut ___H,
7397        sender: &::fidl_next::ServerSender<___T, Self>,
7398        ordinal: u64,
7399        buffer: ___T::RecvBuffer,
7400    ) {
7401        match ordinal {
7402            ordinal => handler.on_unknown_interaction(sender, ordinal),
7403        }
7404    }
7405
7406    fn on_two_way(
7407        handler: &mut ___H,
7408        sender: &::fidl_next::ServerSender<___T, Self>,
7409        ordinal: u64,
7410        buffer: ___T::RecvBuffer,
7411        responder: ::fidl_next::protocol::Responder,
7412    ) {
7413        match ordinal {
7414            4839678630846501113 => {
7415                let responder = ::fidl_next::Responder::from_untyped(responder);
7416
7417                match ::fidl_next::DecoderExt::decode(buffer) {
7418                    Ok(decoded) => handler.create(sender, decoded, responder),
7419                    Err(e) => {
7420                        sender.close();
7421                    }
7422                }
7423            }
7424
7425            ordinal => handler.on_unknown_interaction(sender, ordinal),
7426        }
7427    }
7428}
7429
7430pub type RealmOpenExposedDirResponse = ();
7431
7432/// The wire type corresponding to [`RealmOpenExposedDirResponse`].
7433pub type WireRealmOpenExposedDirResponse = ();
7434
7435pub type RealmCreateChildResponse = ();
7436
7437/// The wire type corresponding to [`RealmCreateChildResponse`].
7438pub type WireRealmCreateChildResponse = ();
7439
7440#[derive(Clone, Debug)]
7441pub struct RealmDestroyChildRequest {
7442    pub child: ::fidl_next_fuchsia_component_decl::ChildRef,
7443}
7444
7445impl ::fidl_next::Encodable for RealmDestroyChildRequest {
7446    type Encoded = WireRealmDestroyChildRequest<'static>;
7447}
7448
7449unsafe impl<___E> ::fidl_next::Encode<___E> for RealmDestroyChildRequest
7450where
7451    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7452
7453    ___E: ::fidl_next::Encoder,
7454{
7455    #[inline]
7456    fn encode(
7457        self,
7458        encoder: &mut ___E,
7459        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7460    ) -> Result<(), ::fidl_next::EncodeError> {
7461        ::fidl_next::munge! {
7462            let Self::Encoded {
7463                child,
7464
7465            } = out;
7466        }
7467
7468        ::fidl_next::Encode::encode(self.child, encoder, child)?;
7469
7470        Ok(())
7471    }
7472}
7473
7474unsafe impl<___E> ::fidl_next::EncodeRef<___E> for RealmDestroyChildRequest
7475where
7476    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7477
7478    ___E: ::fidl_next::Encoder,
7479{
7480    #[inline]
7481    fn encode_ref(
7482        &self,
7483        encoder: &mut ___E,
7484        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7485    ) -> Result<(), ::fidl_next::EncodeError> {
7486        ::fidl_next::munge! {
7487            let Self::Encoded {
7488                child,
7489
7490            } = out;
7491        }
7492
7493        ::fidl_next::EncodeRef::encode_ref(&self.child, encoder, child)?;
7494
7495        Ok(())
7496    }
7497}
7498
7499impl ::fidl_next::EncodableOption for RealmDestroyChildRequest {
7500    type EncodedOption = ::fidl_next::WireBox<'static, WireRealmDestroyChildRequest<'static>>;
7501}
7502
7503unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmDestroyChildRequest
7504where
7505    ___E: ::fidl_next::Encoder + ?Sized,
7506    RealmDestroyChildRequest: ::fidl_next::Encode<___E>,
7507{
7508    #[inline]
7509    fn encode_option(
7510        this: Option<Self>,
7511        encoder: &mut ___E,
7512        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7513    ) -> Result<(), ::fidl_next::EncodeError> {
7514        if let Some(inner) = this {
7515            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7516            ::fidl_next::WireBox::encode_present(out);
7517        } else {
7518            ::fidl_next::WireBox::encode_absent(out);
7519        }
7520
7521        Ok(())
7522    }
7523}
7524
7525unsafe impl<___E> ::fidl_next::EncodeOptionRef<___E> for RealmDestroyChildRequest
7526where
7527    ___E: ::fidl_next::Encoder + ?Sized,
7528    RealmDestroyChildRequest: ::fidl_next::EncodeRef<___E>,
7529{
7530    #[inline]
7531    fn encode_option_ref(
7532        this: Option<&Self>,
7533        encoder: &mut ___E,
7534        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7535    ) -> Result<(), ::fidl_next::EncodeError> {
7536        if let Some(inner) = this {
7537            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7538            ::fidl_next::WireBox::encode_present(out);
7539        } else {
7540            ::fidl_next::WireBox::encode_absent(out);
7541        }
7542
7543        Ok(())
7544    }
7545}
7546
7547impl<'de> ::fidl_next::FromWire<WireRealmDestroyChildRequest<'de>> for RealmDestroyChildRequest {
7548    #[inline]
7549    fn from_wire(wire: WireRealmDestroyChildRequest<'de>) -> Self {
7550        Self { child: ::fidl_next::FromWire::from_wire(wire.child) }
7551    }
7552}
7553
7554impl<'de> ::fidl_next::FromWireRef<WireRealmDestroyChildRequest<'de>> for RealmDestroyChildRequest {
7555    #[inline]
7556    fn from_wire_ref(wire: &WireRealmDestroyChildRequest<'de>) -> Self {
7557        Self { child: ::fidl_next::FromWireRef::from_wire_ref(&wire.child) }
7558    }
7559}
7560
7561/// The wire type corresponding to [`RealmDestroyChildRequest`].
7562#[derive(Debug)]
7563#[repr(C)]
7564pub struct WireRealmDestroyChildRequest<'de> {
7565    pub child: ::fidl_next_fuchsia_component_decl::WireChildRef<'de>,
7566}
7567
7568unsafe impl ::fidl_next::Wire for WireRealmDestroyChildRequest<'static> {
7569    type Decoded<'de> = WireRealmDestroyChildRequest<'de>;
7570
7571    #[inline]
7572    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
7573}
7574
7575unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmDestroyChildRequest<'static>
7576where
7577    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7578
7579    ___D: ::fidl_next::Decoder,
7580{
7581    fn decode(
7582        slot: ::fidl_next::Slot<'_, Self>,
7583        decoder: &mut ___D,
7584    ) -> Result<(), ::fidl_next::DecodeError> {
7585        ::fidl_next::munge! {
7586            let Self {
7587                mut child,
7588
7589            } = slot;
7590        }
7591
7592        ::fidl_next::Decode::decode(child.as_mut(), decoder)?;
7593
7594        Ok(())
7595    }
7596}
7597
7598pub type RealmDestroyChildResponse = ();
7599
7600/// The wire type corresponding to [`RealmDestroyChildResponse`].
7601pub type WireRealmDestroyChildResponse = ();
7602
7603#[derive(Debug)]
7604pub struct RealmListChildrenRequest {
7605    pub collection: ::fidl_next_fuchsia_component_decl::CollectionRef,
7606
7607    pub iter: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::ChildIterator>,
7608}
7609
7610impl ::fidl_next::Encodable for RealmListChildrenRequest {
7611    type Encoded = WireRealmListChildrenRequest<'static>;
7612}
7613
7614unsafe impl<___E> ::fidl_next::Encode<___E> for RealmListChildrenRequest
7615where
7616    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7617
7618    ___E: ::fidl_next::Encoder,
7619
7620    ___E: ::fidl_next::fuchsia::HandleEncoder,
7621{
7622    #[inline]
7623    fn encode(
7624        self,
7625        encoder: &mut ___E,
7626        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7627    ) -> Result<(), ::fidl_next::EncodeError> {
7628        ::fidl_next::munge! {
7629            let Self::Encoded {
7630                collection,
7631                iter,
7632
7633            } = out;
7634        }
7635
7636        ::fidl_next::Encode::encode(self.collection, encoder, collection)?;
7637
7638        ::fidl_next::Encode::encode(self.iter, encoder, iter)?;
7639
7640        Ok(())
7641    }
7642}
7643
7644impl ::fidl_next::EncodableOption for RealmListChildrenRequest {
7645    type EncodedOption = ::fidl_next::WireBox<'static, WireRealmListChildrenRequest<'static>>;
7646}
7647
7648unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmListChildrenRequest
7649where
7650    ___E: ::fidl_next::Encoder + ?Sized,
7651    RealmListChildrenRequest: ::fidl_next::Encode<___E>,
7652{
7653    #[inline]
7654    fn encode_option(
7655        this: Option<Self>,
7656        encoder: &mut ___E,
7657        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7658    ) -> Result<(), ::fidl_next::EncodeError> {
7659        if let Some(inner) = this {
7660            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7661            ::fidl_next::WireBox::encode_present(out);
7662        } else {
7663            ::fidl_next::WireBox::encode_absent(out);
7664        }
7665
7666        Ok(())
7667    }
7668}
7669
7670impl<'de> ::fidl_next::FromWire<WireRealmListChildrenRequest<'de>> for RealmListChildrenRequest {
7671    #[inline]
7672    fn from_wire(wire: WireRealmListChildrenRequest<'de>) -> Self {
7673        Self {
7674            collection: ::fidl_next::FromWire::from_wire(wire.collection),
7675
7676            iter: ::fidl_next::FromWire::from_wire(wire.iter),
7677        }
7678    }
7679}
7680
7681/// The wire type corresponding to [`RealmListChildrenRequest`].
7682#[derive(Debug)]
7683#[repr(C)]
7684pub struct WireRealmListChildrenRequest<'de> {
7685    pub collection: ::fidl_next_fuchsia_component_decl::WireCollectionRef<'de>,
7686
7687    pub iter: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::ChildIterator>,
7688}
7689
7690unsafe impl ::fidl_next::Wire for WireRealmListChildrenRequest<'static> {
7691    type Decoded<'de> = WireRealmListChildrenRequest<'de>;
7692
7693    #[inline]
7694    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7695        unsafe {
7696            out.as_mut_ptr().cast::<u8>().add(20).write_bytes(0, 4);
7697        }
7698    }
7699}
7700
7701unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmListChildrenRequest<'static>
7702where
7703    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7704
7705    ___D: ::fidl_next::Decoder,
7706
7707    ___D: ::fidl_next::fuchsia::HandleDecoder,
7708{
7709    fn decode(
7710        slot: ::fidl_next::Slot<'_, Self>,
7711        decoder: &mut ___D,
7712    ) -> Result<(), ::fidl_next::DecodeError> {
7713        ::fidl_next::munge! {
7714            let Self {
7715                mut collection,
7716                mut iter,
7717
7718            } = slot;
7719        }
7720
7721        ::fidl_next::Decode::decode(collection.as_mut(), decoder)?;
7722
7723        ::fidl_next::Decode::decode(iter.as_mut(), decoder)?;
7724
7725        Ok(())
7726    }
7727}
7728
7729pub type RealmListChildrenResponse = ();
7730
7731/// The wire type corresponding to [`RealmListChildrenResponse`].
7732pub type WireRealmListChildrenResponse = ();
7733
7734#[derive(Debug)]
7735pub struct RealmOpenControllerRequest {
7736    pub child: ::fidl_next_fuchsia_component_decl::ChildRef,
7737
7738    pub controller: ::fidl_next::ServerEnd<::fidl_next::fuchsia::zx::Channel, crate::Controller>,
7739}
7740
7741impl ::fidl_next::Encodable for RealmOpenControllerRequest {
7742    type Encoded = WireRealmOpenControllerRequest<'static>;
7743}
7744
7745unsafe impl<___E> ::fidl_next::Encode<___E> for RealmOpenControllerRequest
7746where
7747    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7748
7749    ___E: ::fidl_next::Encoder,
7750
7751    ___E: ::fidl_next::fuchsia::HandleEncoder,
7752{
7753    #[inline]
7754    fn encode(
7755        self,
7756        encoder: &mut ___E,
7757        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7758    ) -> Result<(), ::fidl_next::EncodeError> {
7759        ::fidl_next::munge! {
7760            let Self::Encoded {
7761                child,
7762                controller,
7763
7764            } = out;
7765        }
7766
7767        ::fidl_next::Encode::encode(self.child, encoder, child)?;
7768
7769        ::fidl_next::Encode::encode(self.controller, encoder, controller)?;
7770
7771        Ok(())
7772    }
7773}
7774
7775impl ::fidl_next::EncodableOption for RealmOpenControllerRequest {
7776    type EncodedOption = ::fidl_next::WireBox<'static, WireRealmOpenControllerRequest<'static>>;
7777}
7778
7779unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmOpenControllerRequest
7780where
7781    ___E: ::fidl_next::Encoder + ?Sized,
7782    RealmOpenControllerRequest: ::fidl_next::Encode<___E>,
7783{
7784    #[inline]
7785    fn encode_option(
7786        this: Option<Self>,
7787        encoder: &mut ___E,
7788        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7789    ) -> Result<(), ::fidl_next::EncodeError> {
7790        if let Some(inner) = this {
7791            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7792            ::fidl_next::WireBox::encode_present(out);
7793        } else {
7794            ::fidl_next::WireBox::encode_absent(out);
7795        }
7796
7797        Ok(())
7798    }
7799}
7800
7801impl<'de> ::fidl_next::FromWire<WireRealmOpenControllerRequest<'de>>
7802    for RealmOpenControllerRequest
7803{
7804    #[inline]
7805    fn from_wire(wire: WireRealmOpenControllerRequest<'de>) -> Self {
7806        Self {
7807            child: ::fidl_next::FromWire::from_wire(wire.child),
7808
7809            controller: ::fidl_next::FromWire::from_wire(wire.controller),
7810        }
7811    }
7812}
7813
7814/// The wire type corresponding to [`RealmOpenControllerRequest`].
7815#[derive(Debug)]
7816#[repr(C)]
7817pub struct WireRealmOpenControllerRequest<'de> {
7818    pub child: ::fidl_next_fuchsia_component_decl::WireChildRef<'de>,
7819
7820    pub controller: ::fidl_next::ServerEnd<::fidl_next::fuchsia::WireChannel, crate::Controller>,
7821}
7822
7823unsafe impl ::fidl_next::Wire for WireRealmOpenControllerRequest<'static> {
7824    type Decoded<'de> = WireRealmOpenControllerRequest<'de>;
7825
7826    #[inline]
7827    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7828        unsafe {
7829            out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
7830        }
7831    }
7832}
7833
7834unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmOpenControllerRequest<'static>
7835where
7836    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7837
7838    ___D: ::fidl_next::Decoder,
7839
7840    ___D: ::fidl_next::fuchsia::HandleDecoder,
7841{
7842    fn decode(
7843        slot: ::fidl_next::Slot<'_, Self>,
7844        decoder: &mut ___D,
7845    ) -> Result<(), ::fidl_next::DecodeError> {
7846        ::fidl_next::munge! {
7847            let Self {
7848                mut child,
7849                mut controller,
7850
7851            } = slot;
7852        }
7853
7854        ::fidl_next::Decode::decode(child.as_mut(), decoder)?;
7855
7856        ::fidl_next::Decode::decode(controller.as_mut(), decoder)?;
7857
7858        Ok(())
7859    }
7860}
7861
7862pub type RealmOpenControllerResponse = ();
7863
7864/// The wire type corresponding to [`RealmOpenControllerResponse`].
7865pub type WireRealmOpenControllerResponse = ();
7866
7867#[derive(Debug)]
7868pub struct RealmOpenExposedDirRequest {
7869    pub child: ::fidl_next_fuchsia_component_decl::ChildRef,
7870
7871    pub exposed_dir: ::fidl_next::ServerEnd<
7872        ::fidl_next::fuchsia::zx::Channel,
7873        ::fidl_next_fuchsia_io::Directory,
7874    >,
7875}
7876
7877impl ::fidl_next::Encodable for RealmOpenExposedDirRequest {
7878    type Encoded = WireRealmOpenExposedDirRequest<'static>;
7879}
7880
7881unsafe impl<___E> ::fidl_next::Encode<___E> for RealmOpenExposedDirRequest
7882where
7883    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
7884
7885    ___E: ::fidl_next::Encoder,
7886
7887    ___E: ::fidl_next::fuchsia::HandleEncoder,
7888{
7889    #[inline]
7890    fn encode(
7891        self,
7892        encoder: &mut ___E,
7893        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
7894    ) -> Result<(), ::fidl_next::EncodeError> {
7895        ::fidl_next::munge! {
7896            let Self::Encoded {
7897                child,
7898                exposed_dir,
7899
7900            } = out;
7901        }
7902
7903        ::fidl_next::Encode::encode(self.child, encoder, child)?;
7904
7905        ::fidl_next::Encode::encode(self.exposed_dir, encoder, exposed_dir)?;
7906
7907        Ok(())
7908    }
7909}
7910
7911impl ::fidl_next::EncodableOption for RealmOpenExposedDirRequest {
7912    type EncodedOption = ::fidl_next::WireBox<'static, WireRealmOpenExposedDirRequest<'static>>;
7913}
7914
7915unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmOpenExposedDirRequest
7916where
7917    ___E: ::fidl_next::Encoder + ?Sized,
7918    RealmOpenExposedDirRequest: ::fidl_next::Encode<___E>,
7919{
7920    #[inline]
7921    fn encode_option(
7922        this: Option<Self>,
7923        encoder: &mut ___E,
7924        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
7925    ) -> Result<(), ::fidl_next::EncodeError> {
7926        if let Some(inner) = this {
7927            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
7928            ::fidl_next::WireBox::encode_present(out);
7929        } else {
7930            ::fidl_next::WireBox::encode_absent(out);
7931        }
7932
7933        Ok(())
7934    }
7935}
7936
7937impl<'de> ::fidl_next::FromWire<WireRealmOpenExposedDirRequest<'de>>
7938    for RealmOpenExposedDirRequest
7939{
7940    #[inline]
7941    fn from_wire(wire: WireRealmOpenExposedDirRequest<'de>) -> Self {
7942        Self {
7943            child: ::fidl_next::FromWire::from_wire(wire.child),
7944
7945            exposed_dir: ::fidl_next::FromWire::from_wire(wire.exposed_dir),
7946        }
7947    }
7948}
7949
7950/// The wire type corresponding to [`RealmOpenExposedDirRequest`].
7951#[derive(Debug)]
7952#[repr(C)]
7953pub struct WireRealmOpenExposedDirRequest<'de> {
7954    pub child: ::fidl_next_fuchsia_component_decl::WireChildRef<'de>,
7955
7956    pub exposed_dir: ::fidl_next::ServerEnd<
7957        ::fidl_next::fuchsia::WireChannel,
7958        ::fidl_next_fuchsia_io::Directory,
7959    >,
7960}
7961
7962unsafe impl ::fidl_next::Wire for WireRealmOpenExposedDirRequest<'static> {
7963    type Decoded<'de> = WireRealmOpenExposedDirRequest<'de>;
7964
7965    #[inline]
7966    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {
7967        unsafe {
7968            out.as_mut_ptr().cast::<u8>().add(36).write_bytes(0, 4);
7969        }
7970    }
7971}
7972
7973unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmOpenExposedDirRequest<'static>
7974where
7975    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
7976
7977    ___D: ::fidl_next::Decoder,
7978
7979    ___D: ::fidl_next::fuchsia::HandleDecoder,
7980{
7981    fn decode(
7982        slot: ::fidl_next::Slot<'_, Self>,
7983        decoder: &mut ___D,
7984    ) -> Result<(), ::fidl_next::DecodeError> {
7985        ::fidl_next::munge! {
7986            let Self {
7987                mut child,
7988                mut exposed_dir,
7989
7990            } = slot;
7991        }
7992
7993        ::fidl_next::Decode::decode(child.as_mut(), decoder)?;
7994
7995        ::fidl_next::Decode::decode(exposed_dir.as_mut(), decoder)?;
7996
7997        Ok(())
7998    }
7999}
8000
8001#[derive(Debug)]
8002pub struct RealmCreateChildRequest {
8003    pub collection: ::fidl_next_fuchsia_component_decl::CollectionRef,
8004
8005    pub decl: ::fidl_next_fuchsia_component_decl::Child,
8006
8007    pub args: crate::CreateChildArgs,
8008}
8009
8010impl ::fidl_next::Encodable for RealmCreateChildRequest {
8011    type Encoded = WireRealmCreateChildRequest<'static>;
8012}
8013
8014unsafe impl<___E> ::fidl_next::Encode<___E> for RealmCreateChildRequest
8015where
8016    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8017
8018    ___E: ::fidl_next::Encoder,
8019
8020    ___E: ::fidl_next::fuchsia::HandleEncoder,
8021{
8022    #[inline]
8023    fn encode(
8024        self,
8025        encoder: &mut ___E,
8026        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8027    ) -> Result<(), ::fidl_next::EncodeError> {
8028        ::fidl_next::munge! {
8029            let Self::Encoded {
8030                collection,
8031                decl,
8032                args,
8033
8034            } = out;
8035        }
8036
8037        ::fidl_next::Encode::encode(self.collection, encoder, collection)?;
8038
8039        ::fidl_next::Encode::encode(self.decl, encoder, decl)?;
8040
8041        ::fidl_next::Encode::encode(self.args, encoder, args)?;
8042
8043        Ok(())
8044    }
8045}
8046
8047impl ::fidl_next::EncodableOption for RealmCreateChildRequest {
8048    type EncodedOption = ::fidl_next::WireBox<'static, WireRealmCreateChildRequest<'static>>;
8049}
8050
8051unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmCreateChildRequest
8052where
8053    ___E: ::fidl_next::Encoder + ?Sized,
8054    RealmCreateChildRequest: ::fidl_next::Encode<___E>,
8055{
8056    #[inline]
8057    fn encode_option(
8058        this: Option<Self>,
8059        encoder: &mut ___E,
8060        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8061    ) -> Result<(), ::fidl_next::EncodeError> {
8062        if let Some(inner) = this {
8063            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8064            ::fidl_next::WireBox::encode_present(out);
8065        } else {
8066            ::fidl_next::WireBox::encode_absent(out);
8067        }
8068
8069        Ok(())
8070    }
8071}
8072
8073impl<'de> ::fidl_next::FromWire<WireRealmCreateChildRequest<'de>> for RealmCreateChildRequest {
8074    #[inline]
8075    fn from_wire(wire: WireRealmCreateChildRequest<'de>) -> Self {
8076        Self {
8077            collection: ::fidl_next::FromWire::from_wire(wire.collection),
8078
8079            decl: ::fidl_next::FromWire::from_wire(wire.decl),
8080
8081            args: ::fidl_next::FromWire::from_wire(wire.args),
8082        }
8083    }
8084}
8085
8086/// The wire type corresponding to [`RealmCreateChildRequest`].
8087#[derive(Debug)]
8088#[repr(C)]
8089pub struct WireRealmCreateChildRequest<'de> {
8090    pub collection: ::fidl_next_fuchsia_component_decl::WireCollectionRef<'de>,
8091
8092    pub decl: ::fidl_next_fuchsia_component_decl::WireChild<'de>,
8093
8094    pub args: crate::WireCreateChildArgs<'de>,
8095}
8096
8097unsafe impl ::fidl_next::Wire for WireRealmCreateChildRequest<'static> {
8098    type Decoded<'de> = WireRealmCreateChildRequest<'de>;
8099
8100    #[inline]
8101    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
8102}
8103
8104unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmCreateChildRequest<'static>
8105where
8106    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8107
8108    ___D: ::fidl_next::Decoder,
8109
8110    ___D: ::fidl_next::fuchsia::HandleDecoder,
8111{
8112    fn decode(
8113        slot: ::fidl_next::Slot<'_, Self>,
8114        decoder: &mut ___D,
8115    ) -> Result<(), ::fidl_next::DecodeError> {
8116        ::fidl_next::munge! {
8117            let Self {
8118                mut collection,
8119                mut decl,
8120                mut args,
8121
8122            } = slot;
8123        }
8124
8125        ::fidl_next::Decode::decode(collection.as_mut(), decoder)?;
8126
8127        ::fidl_next::Decode::decode(decl.as_mut(), decoder)?;
8128
8129        ::fidl_next::Decode::decode(args.as_mut(), decoder)?;
8130
8131        Ok(())
8132    }
8133}
8134
8135#[derive(Debug)]
8136pub struct RealmGetResolvedInfoResponse {
8137    pub resolved_info: ::fidl_next_fuchsia_component_resolution::Component,
8138}
8139
8140impl ::fidl_next::Encodable for RealmGetResolvedInfoResponse {
8141    type Encoded = WireRealmGetResolvedInfoResponse<'static>;
8142}
8143
8144unsafe impl<___E> ::fidl_next::Encode<___E> for RealmGetResolvedInfoResponse
8145where
8146    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8147
8148    ___E: ::fidl_next::Encoder,
8149
8150    ___E: ::fidl_next::fuchsia::HandleEncoder,
8151{
8152    #[inline]
8153    fn encode(
8154        self,
8155        encoder: &mut ___E,
8156        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8157    ) -> Result<(), ::fidl_next::EncodeError> {
8158        ::fidl_next::munge! {
8159            let Self::Encoded {
8160                resolved_info,
8161
8162            } = out;
8163        }
8164
8165        ::fidl_next::Encode::encode(self.resolved_info, encoder, resolved_info)?;
8166
8167        Ok(())
8168    }
8169}
8170
8171impl ::fidl_next::EncodableOption for RealmGetResolvedInfoResponse {
8172    type EncodedOption = ::fidl_next::WireBox<'static, WireRealmGetResolvedInfoResponse<'static>>;
8173}
8174
8175unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmGetResolvedInfoResponse
8176where
8177    ___E: ::fidl_next::Encoder + ?Sized,
8178    RealmGetResolvedInfoResponse: ::fidl_next::Encode<___E>,
8179{
8180    #[inline]
8181    fn encode_option(
8182        this: Option<Self>,
8183        encoder: &mut ___E,
8184        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8185    ) -> Result<(), ::fidl_next::EncodeError> {
8186        if let Some(inner) = this {
8187            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8188            ::fidl_next::WireBox::encode_present(out);
8189        } else {
8190            ::fidl_next::WireBox::encode_absent(out);
8191        }
8192
8193        Ok(())
8194    }
8195}
8196
8197impl<'de> ::fidl_next::FromWire<WireRealmGetResolvedInfoResponse<'de>>
8198    for RealmGetResolvedInfoResponse
8199{
8200    #[inline]
8201    fn from_wire(wire: WireRealmGetResolvedInfoResponse<'de>) -> Self {
8202        Self { resolved_info: ::fidl_next::FromWire::from_wire(wire.resolved_info) }
8203    }
8204}
8205
8206/// The wire type corresponding to [`RealmGetResolvedInfoResponse`].
8207#[derive(Debug)]
8208#[repr(C)]
8209pub struct WireRealmGetResolvedInfoResponse<'de> {
8210    pub resolved_info: ::fidl_next_fuchsia_component_resolution::WireComponent<'de>,
8211}
8212
8213unsafe impl ::fidl_next::Wire for WireRealmGetResolvedInfoResponse<'static> {
8214    type Decoded<'de> = WireRealmGetResolvedInfoResponse<'de>;
8215
8216    #[inline]
8217    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
8218}
8219
8220unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmGetResolvedInfoResponse<'static>
8221where
8222    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8223
8224    ___D: ::fidl_next::Decoder,
8225
8226    ___D: ::fidl_next::fuchsia::HandleDecoder,
8227{
8228    fn decode(
8229        slot: ::fidl_next::Slot<'_, Self>,
8230        decoder: &mut ___D,
8231    ) -> Result<(), ::fidl_next::DecodeError> {
8232        ::fidl_next::munge! {
8233            let Self {
8234                mut resolved_info,
8235
8236            } = slot;
8237        }
8238
8239        ::fidl_next::Decode::decode(resolved_info.as_mut(), decoder)?;
8240
8241        Ok(())
8242    }
8243}
8244
8245#[derive(Debug)]
8246pub struct RealmGetChildOutputDictionaryRequest {
8247    pub child: ::fidl_next_fuchsia_component_decl::ChildRef,
8248}
8249
8250impl ::fidl_next::Encodable for RealmGetChildOutputDictionaryRequest {
8251    type Encoded = WireRealmGetChildOutputDictionaryRequest<'static>;
8252}
8253
8254unsafe impl<___E> ::fidl_next::Encode<___E> for RealmGetChildOutputDictionaryRequest
8255where
8256    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8257
8258    ___E: ::fidl_next::Encoder,
8259
8260    ___E: ::fidl_next::fuchsia::HandleEncoder,
8261{
8262    #[inline]
8263    fn encode(
8264        self,
8265        encoder: &mut ___E,
8266        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8267    ) -> Result<(), ::fidl_next::EncodeError> {
8268        ::fidl_next::munge! {
8269            let Self::Encoded {
8270                child,
8271
8272            } = out;
8273        }
8274
8275        ::fidl_next::Encode::encode(self.child, encoder, child)?;
8276
8277        Ok(())
8278    }
8279}
8280
8281impl ::fidl_next::EncodableOption for RealmGetChildOutputDictionaryRequest {
8282    type EncodedOption =
8283        ::fidl_next::WireBox<'static, WireRealmGetChildOutputDictionaryRequest<'static>>;
8284}
8285
8286unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmGetChildOutputDictionaryRequest
8287where
8288    ___E: ::fidl_next::Encoder + ?Sized,
8289    RealmGetChildOutputDictionaryRequest: ::fidl_next::Encode<___E>,
8290{
8291    #[inline]
8292    fn encode_option(
8293        this: Option<Self>,
8294        encoder: &mut ___E,
8295        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8296    ) -> Result<(), ::fidl_next::EncodeError> {
8297        if let Some(inner) = this {
8298            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8299            ::fidl_next::WireBox::encode_present(out);
8300        } else {
8301            ::fidl_next::WireBox::encode_absent(out);
8302        }
8303
8304        Ok(())
8305    }
8306}
8307
8308impl<'de> ::fidl_next::FromWire<WireRealmGetChildOutputDictionaryRequest<'de>>
8309    for RealmGetChildOutputDictionaryRequest
8310{
8311    #[inline]
8312    fn from_wire(wire: WireRealmGetChildOutputDictionaryRequest<'de>) -> Self {
8313        Self { child: ::fidl_next::FromWire::from_wire(wire.child) }
8314    }
8315}
8316
8317/// The wire type corresponding to [`RealmGetChildOutputDictionaryRequest`].
8318#[derive(Debug)]
8319#[repr(C)]
8320pub struct WireRealmGetChildOutputDictionaryRequest<'de> {
8321    pub child: ::fidl_next_fuchsia_component_decl::WireChildRef<'de>,
8322}
8323
8324unsafe impl ::fidl_next::Wire for WireRealmGetChildOutputDictionaryRequest<'static> {
8325    type Decoded<'de> = WireRealmGetChildOutputDictionaryRequest<'de>;
8326
8327    #[inline]
8328    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
8329}
8330
8331unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmGetChildOutputDictionaryRequest<'static>
8332where
8333    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8334
8335    ___D: ::fidl_next::Decoder,
8336
8337    ___D: ::fidl_next::fuchsia::HandleDecoder,
8338{
8339    fn decode(
8340        slot: ::fidl_next::Slot<'_, Self>,
8341        decoder: &mut ___D,
8342    ) -> Result<(), ::fidl_next::DecodeError> {
8343        ::fidl_next::munge! {
8344            let Self {
8345                mut child,
8346
8347            } = slot;
8348        }
8349
8350        ::fidl_next::Decode::decode(child.as_mut(), decoder)?;
8351
8352        Ok(())
8353    }
8354}
8355
8356#[derive(Debug)]
8357#[repr(C)]
8358pub struct RealmGetChildOutputDictionaryResponse {
8359    pub dictionary: ::fidl_next_fuchsia_component_sandbox::DictionaryRef,
8360}
8361
8362impl ::fidl_next::Encodable for RealmGetChildOutputDictionaryResponse {
8363    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8364        Self,
8365        WireRealmGetChildOutputDictionaryResponse,
8366    > = unsafe {
8367        ::fidl_next::CopyOptimization::enable_if(
8368            true
8369
8370                && <
8371                    ::fidl_next_fuchsia_component_sandbox::DictionaryRef as ::fidl_next::Encodable
8372                >::COPY_OPTIMIZATION.is_enabled()
8373
8374        )
8375    };
8376
8377    type Encoded = WireRealmGetChildOutputDictionaryResponse;
8378}
8379
8380unsafe impl<___E> ::fidl_next::Encode<___E> for RealmGetChildOutputDictionaryResponse
8381where
8382    ___E: ::fidl_next::encoder::InternalHandleEncoder + ?Sized,
8383
8384    ___E: ::fidl_next::fuchsia::HandleEncoder,
8385{
8386    #[inline]
8387    fn encode(
8388        self,
8389        encoder: &mut ___E,
8390        out: &mut ::core::mem::MaybeUninit<Self::Encoded>,
8391    ) -> Result<(), ::fidl_next::EncodeError> {
8392        ::fidl_next::munge! {
8393            let Self::Encoded {
8394                dictionary,
8395
8396            } = out;
8397        }
8398
8399        ::fidl_next::Encode::encode(self.dictionary, encoder, dictionary)?;
8400
8401        Ok(())
8402    }
8403}
8404
8405impl ::fidl_next::EncodableOption for RealmGetChildOutputDictionaryResponse {
8406    type EncodedOption = ::fidl_next::WireBox<'static, WireRealmGetChildOutputDictionaryResponse>;
8407}
8408
8409unsafe impl<___E> ::fidl_next::EncodeOption<___E> for RealmGetChildOutputDictionaryResponse
8410where
8411    ___E: ::fidl_next::Encoder + ?Sized,
8412    RealmGetChildOutputDictionaryResponse: ::fidl_next::Encode<___E>,
8413{
8414    #[inline]
8415    fn encode_option(
8416        this: Option<Self>,
8417        encoder: &mut ___E,
8418        out: &mut ::core::mem::MaybeUninit<Self::EncodedOption>,
8419    ) -> Result<(), ::fidl_next::EncodeError> {
8420        if let Some(inner) = this {
8421            ::fidl_next::EncoderExt::encode_next(encoder, inner)?;
8422            ::fidl_next::WireBox::encode_present(out);
8423        } else {
8424            ::fidl_next::WireBox::encode_absent(out);
8425        }
8426
8427        Ok(())
8428    }
8429}
8430
8431impl ::fidl_next::FromWire<WireRealmGetChildOutputDictionaryResponse>
8432    for RealmGetChildOutputDictionaryResponse
8433{
8434    const COPY_OPTIMIZATION: ::fidl_next::CopyOptimization<
8435        WireRealmGetChildOutputDictionaryResponse,
8436        Self,
8437    > = unsafe {
8438        ::fidl_next::CopyOptimization::enable_if(
8439            true
8440
8441                && <
8442                    ::fidl_next_fuchsia_component_sandbox::DictionaryRef as ::fidl_next::FromWire<::fidl_next_fuchsia_component_sandbox::WireDictionaryRef>
8443                >::COPY_OPTIMIZATION.is_enabled()
8444
8445        )
8446    };
8447
8448    #[inline]
8449    fn from_wire(wire: WireRealmGetChildOutputDictionaryResponse) -> Self {
8450        Self { dictionary: ::fidl_next::FromWire::from_wire(wire.dictionary) }
8451    }
8452}
8453
8454/// The wire type corresponding to [`RealmGetChildOutputDictionaryResponse`].
8455#[derive(Debug)]
8456#[repr(C)]
8457pub struct WireRealmGetChildOutputDictionaryResponse {
8458    pub dictionary: ::fidl_next_fuchsia_component_sandbox::WireDictionaryRef,
8459}
8460
8461unsafe impl ::fidl_next::Wire for WireRealmGetChildOutputDictionaryResponse {
8462    type Decoded<'de> = WireRealmGetChildOutputDictionaryResponse;
8463
8464    #[inline]
8465    fn zero_padding(out: &mut ::core::mem::MaybeUninit<Self>) {}
8466}
8467
8468unsafe impl<___D> ::fidl_next::Decode<___D> for WireRealmGetChildOutputDictionaryResponse
8469where
8470    ___D: ::fidl_next::decoder::InternalHandleDecoder + ?Sized,
8471
8472    ___D: ::fidl_next::fuchsia::HandleDecoder,
8473{
8474    fn decode(
8475        slot: ::fidl_next::Slot<'_, Self>,
8476        decoder: &mut ___D,
8477    ) -> Result<(), ::fidl_next::DecodeError> {
8478        ::fidl_next::munge! {
8479            let Self {
8480                mut dictionary,
8481
8482            } = slot;
8483        }
8484
8485        ::fidl_next::Decode::decode(dictionary.as_mut(), decoder)?;
8486
8487        Ok(())
8488    }
8489}
8490
8491/// The type corresponding to the Realm protocol.
8492#[doc = " A protocol used by a component instance to manage its own realm, such as for\n binding to its children.\n\n Requests to this protocol are processed in the order they are received.\n Clients that wish to send requests in parallel should open multiple\n connections.\n\n The component framework provides this service to components that use\n `fuchsia.component.Realm`.\n"]
8493#[derive(Debug)]
8494pub struct Realm;
8495
8496impl ::fidl_next::Discoverable for Realm {
8497    const PROTOCOL_NAME: &'static str = "fuchsia.component.Realm";
8498}
8499
8500pub mod realm {
8501    pub mod prelude {
8502        pub use crate::{
8503            realm, Realm, RealmClientHandler, RealmClientSender, RealmServerHandler,
8504            RealmServerSender,
8505        };
8506
8507        pub use crate::Error;
8508
8509        pub use crate::RealmCreateChildRequest;
8510
8511        pub use crate::RealmDestroyChildRequest;
8512
8513        pub use crate::RealmGetChildOutputDictionaryRequest;
8514
8515        pub use crate::RealmListChildrenRequest;
8516
8517        pub use crate::RealmOpenControllerRequest;
8518
8519        pub use crate::RealmOpenExposedDirRequest;
8520
8521        pub use crate::RealmCreateChildResponse;
8522
8523        pub use crate::RealmDestroyChildResponse;
8524
8525        pub use crate::RealmGetChildOutputDictionaryResponse;
8526
8527        pub use crate::RealmGetResolvedInfoResponse;
8528
8529        pub use crate::RealmListChildrenResponse;
8530
8531        pub use crate::RealmOpenControllerResponse;
8532
8533        pub use crate::RealmOpenExposedDirResponse;
8534    }
8535
8536    pub struct OpenController;
8537
8538    impl ::fidl_next::Method for OpenController {
8539        const ORDINAL: u64 = 8165227925828473216;
8540
8541        type Protocol = crate::Realm;
8542
8543        type Request = crate::WireRealmOpenControllerRequest<'static>;
8544
8545        type Response = ::fidl_next::WireResult<
8546            'static,
8547            crate::WireRealmOpenControllerResponse,
8548            crate::WireError,
8549        >;
8550    }
8551
8552    pub struct OpenExposedDir;
8553
8554    impl ::fidl_next::Method for OpenExposedDir {
8555        const ORDINAL: u64 = 9194435320863127852;
8556
8557        type Protocol = crate::Realm;
8558
8559        type Request = crate::WireRealmOpenExposedDirRequest<'static>;
8560
8561        type Response = ::fidl_next::WireResult<
8562            'static,
8563            crate::WireRealmOpenExposedDirResponse,
8564            crate::WireError,
8565        >;
8566    }
8567
8568    pub struct CreateChild;
8569
8570    impl ::fidl_next::Method for CreateChild {
8571        const ORDINAL: u64 = 4892190024503489888;
8572
8573        type Protocol = crate::Realm;
8574
8575        type Request = crate::WireRealmCreateChildRequest<'static>;
8576
8577        type Response =
8578            ::fidl_next::WireResult<'static, crate::WireRealmCreateChildResponse, crate::WireError>;
8579    }
8580
8581    pub struct DestroyChild;
8582
8583    impl ::fidl_next::Method for DestroyChild {
8584        const ORDINAL: u64 = 8203529889988252194;
8585
8586        type Protocol = crate::Realm;
8587
8588        type Request = crate::WireRealmDestroyChildRequest<'static>;
8589
8590        type Response = ::fidl_next::WireResult<
8591            'static,
8592            crate::WireRealmDestroyChildResponse,
8593            crate::WireError,
8594        >;
8595    }
8596
8597    pub struct ListChildren;
8598
8599    impl ::fidl_next::Method for ListChildren {
8600        const ORDINAL: u64 = 7532454435519185057;
8601
8602        type Protocol = crate::Realm;
8603
8604        type Request = crate::WireRealmListChildrenRequest<'static>;
8605
8606        type Response = ::fidl_next::WireResult<
8607            'static,
8608            crate::WireRealmListChildrenResponse,
8609            crate::WireError,
8610        >;
8611    }
8612
8613    pub struct GetResolvedInfo;
8614
8615    impl ::fidl_next::Method for GetResolvedInfo {
8616        const ORDINAL: u64 = 8308987710372188322;
8617
8618        type Protocol = crate::Realm;
8619
8620        type Request = ();
8621
8622        type Response = ::fidl_next::WireResult<
8623            'static,
8624            crate::WireRealmGetResolvedInfoResponse<'static>,
8625            crate::WireError,
8626        >;
8627    }
8628
8629    pub struct GetChildOutputDictionary;
8630
8631    impl ::fidl_next::Method for GetChildOutputDictionary {
8632        const ORDINAL: u64 = 4781081784078915088;
8633
8634        type Protocol = crate::Realm;
8635
8636        type Request = crate::WireRealmGetChildOutputDictionaryRequest<'static>;
8637
8638        type Response = ::fidl_next::WireResult<
8639            'static,
8640            crate::WireRealmGetChildOutputDictionaryResponse,
8641            crate::WireError,
8642        >;
8643    }
8644}
8645
8646/// A helper trait for the `Realm` client sender.
8647pub trait RealmClientSender {
8648    type Transport: ::fidl_next::Transport;
8649
8650    #[doc = " Operate on a child component. See documentation for [`Controller`].\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8651    fn open_controller<___R>(
8652        &self,
8653        request: ___R,
8654    ) -> Result<
8655        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenController>,
8656        ::fidl_next::EncodeError,
8657    >
8658    where
8659        ___R: ::fidl_next::Encode<
8660            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8661            Encoded = crate::WireRealmOpenControllerRequest<'static>,
8662        >;
8663
8664    #[doc = " Opens the exposed directory of a child component instance. When this\n function successfully returns, `exposed_dir` is bound to a directory\n that contains the capabilities which the child exposed to its realm\n via `ComponentDecl.exposes` (specified via \"expose\" declarations in\n the component\'s manifest). The child component will not start as a\n result of this call. Instead, starting will occur iff the parent binds\n to one of the capabilities contained within `exposed_dir`.\n\n `exposed_dir` is open as long as `child` exists.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8665    fn open_exposed_dir<___R>(
8666        &self,
8667        request: ___R,
8668    ) -> Result<
8669        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenExposedDir>,
8670        ::fidl_next::EncodeError,
8671    >
8672    where
8673        ___R: ::fidl_next::Encode<
8674            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8675            Encoded = crate::WireRealmOpenExposedDirRequest<'static>,
8676        >;
8677
8678    #[doc = " Creates a child component instance dynamically. When this function\n returns successfully, the instance exists, but it may not be running.\n\n The environment of the child instance is determined by the environment\n of the collection. `decl` must not set `environment`.\n\n If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,\n [CreateChild] will start the component and return once the component is\n started. Otherwise, [CreateChild] will return immediately after creating\n the component and will not start or resolve it.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`\n   is not a valid declaration.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve\n   in a `SingleRun` collection.\n - `NO_SPACE`: Could not allocate storage for the new instance.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8679    fn create_child<___R>(
8680        &self,
8681        request: ___R,
8682    ) -> Result<
8683        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::CreateChild>,
8684        ::fidl_next::EncodeError,
8685    >
8686    where
8687        ___R: ::fidl_next::Encode<
8688            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8689            Encoded = crate::WireRealmCreateChildRequest<'static>,
8690        >;
8691
8692    #[doc = " Destroys a dynamically-created component instance. When this function\n returns, the instance is destroyed and has stopped running.  However,\n cleanup of the component\'s resources (such as its isolated storage) may\n happen in the background after this function returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer\n   to a dynamic instance.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8693    fn destroy_child<___R>(
8694        &self,
8695        request: ___R,
8696    ) -> Result<
8697        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::DestroyChild>,
8698        ::fidl_next::EncodeError,
8699    >
8700    where
8701        ___R: ::fidl_next::Encode<
8702            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8703            Encoded = crate::WireRealmDestroyChildRequest<'static>,
8704        >;
8705
8706    #[doc = " Returns an iterator that lists all instances in a collection.\n\n NOTE: The results are not guaranteed to be consistent. Instances may be\n created or destroyed while the iterator is live, but those changes\n won\'t be observed by the iterator after this method returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`\n does not have `ZX_RIGHT_WAIT`.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n - If `iter` does not have standard channel rights, this function may\n   return `ACCESS_DENIED` or component manager may close `iter`.\n"]
8707    fn list_children<___R>(
8708        &self,
8709        request: ___R,
8710    ) -> Result<
8711        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::ListChildren>,
8712        ::fidl_next::EncodeError,
8713    >
8714    where
8715        ___R: ::fidl_next::Encode<
8716            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8717            Encoded = crate::WireRealmListChildrenRequest<'static>,
8718        >;
8719
8720    #[doc = " Returns the set of information that was given to the component framework\n by this component\'s resolver.\n"]
8721    fn get_resolved_info(
8722        &self,
8723    ) -> Result<
8724        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::GetResolvedInfo>,
8725        ::fidl_next::EncodeError,
8726    >;
8727
8728    fn get_child_output_dictionary<___R>(
8729        &self,
8730        request: ___R,
8731    ) -> Result<
8732        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::GetChildOutputDictionary>,
8733        ::fidl_next::EncodeError,
8734    >
8735    where
8736        ___R: ::fidl_next::Encode<
8737            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8738            Encoded = crate::WireRealmGetChildOutputDictionaryRequest<'static>,
8739        >;
8740}
8741
8742impl<___T> RealmClientSender for ::fidl_next::ClientSender<___T, Realm>
8743where
8744    ___T: ::fidl_next::Transport,
8745{
8746    type Transport = ___T;
8747
8748    #[doc = " Operate on a child component. See documentation for [`Controller`].\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8749    fn open_controller<___R>(
8750        &self,
8751        request: ___R,
8752    ) -> Result<
8753        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenController>,
8754        ::fidl_next::EncodeError,
8755    >
8756    where
8757        ___R: ::fidl_next::Encode<
8758            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8759            Encoded = crate::WireRealmOpenControllerRequest<'static>,
8760        >,
8761    {
8762        self.as_untyped()
8763            .send_two_way(8165227925828473216, request)
8764            .map(::fidl_next::ResponseFuture::from_untyped)
8765    }
8766
8767    #[doc = " Opens the exposed directory of a child component instance. When this\n function successfully returns, `exposed_dir` is bound to a directory\n that contains the capabilities which the child exposed to its realm\n via `ComponentDecl.exposes` (specified via \"expose\" declarations in\n the component\'s manifest). The child component will not start as a\n result of this call. Instead, starting will occur iff the parent binds\n to one of the capabilities contained within `exposed_dir`.\n\n `exposed_dir` is open as long as `child` exists.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8768    fn open_exposed_dir<___R>(
8769        &self,
8770        request: ___R,
8771    ) -> Result<
8772        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::OpenExposedDir>,
8773        ::fidl_next::EncodeError,
8774    >
8775    where
8776        ___R: ::fidl_next::Encode<
8777            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8778            Encoded = crate::WireRealmOpenExposedDirRequest<'static>,
8779        >,
8780    {
8781        self.as_untyped()
8782            .send_two_way(9194435320863127852, request)
8783            .map(::fidl_next::ResponseFuture::from_untyped)
8784    }
8785
8786    #[doc = " Creates a child component instance dynamically. When this function\n returns successfully, the instance exists, but it may not be running.\n\n The environment of the child instance is determined by the environment\n of the collection. `decl` must not set `environment`.\n\n If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,\n [CreateChild] will start the component and return once the component is\n started. Otherwise, [CreateChild] will return immediately after creating\n the component and will not start or resolve it.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`\n   is not a valid declaration.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve\n   in a `SingleRun` collection.\n - `NO_SPACE`: Could not allocate storage for the new instance.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8787    fn create_child<___R>(
8788        &self,
8789        request: ___R,
8790    ) -> Result<
8791        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::CreateChild>,
8792        ::fidl_next::EncodeError,
8793    >
8794    where
8795        ___R: ::fidl_next::Encode<
8796            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8797            Encoded = crate::WireRealmCreateChildRequest<'static>,
8798        >,
8799    {
8800        self.as_untyped()
8801            .send_two_way(4892190024503489888, request)
8802            .map(::fidl_next::ResponseFuture::from_untyped)
8803    }
8804
8805    #[doc = " Destroys a dynamically-created component instance. When this function\n returns, the instance is destroyed and has stopped running.  However,\n cleanup of the component\'s resources (such as its isolated storage) may\n happen in the background after this function returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer\n   to a dynamic instance.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8806    fn destroy_child<___R>(
8807        &self,
8808        request: ___R,
8809    ) -> Result<
8810        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::DestroyChild>,
8811        ::fidl_next::EncodeError,
8812    >
8813    where
8814        ___R: ::fidl_next::Encode<
8815            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8816            Encoded = crate::WireRealmDestroyChildRequest<'static>,
8817        >,
8818    {
8819        self.as_untyped()
8820            .send_two_way(8203529889988252194, request)
8821            .map(::fidl_next::ResponseFuture::from_untyped)
8822    }
8823
8824    #[doc = " Returns an iterator that lists all instances in a collection.\n\n NOTE: The results are not guaranteed to be consistent. Instances may be\n created or destroyed while the iterator is live, but those changes\n won\'t be observed by the iterator after this method returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`\n does not have `ZX_RIGHT_WAIT`.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n - If `iter` does not have standard channel rights, this function may\n   return `ACCESS_DENIED` or component manager may close `iter`.\n"]
8825    fn list_children<___R>(
8826        &self,
8827        request: ___R,
8828    ) -> Result<
8829        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::ListChildren>,
8830        ::fidl_next::EncodeError,
8831    >
8832    where
8833        ___R: ::fidl_next::Encode<
8834            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8835            Encoded = crate::WireRealmListChildrenRequest<'static>,
8836        >,
8837    {
8838        self.as_untyped()
8839            .send_two_way(7532454435519185057, request)
8840            .map(::fidl_next::ResponseFuture::from_untyped)
8841    }
8842
8843    #[doc = " Returns the set of information that was given to the component framework\n by this component\'s resolver.\n"]
8844    fn get_resolved_info(
8845        &self,
8846    ) -> Result<
8847        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::GetResolvedInfo>,
8848        ::fidl_next::EncodeError,
8849    > {
8850        self.as_untyped()
8851            .send_two_way(8308987710372188322, ())
8852            .map(::fidl_next::ResponseFuture::from_untyped)
8853    }
8854
8855    fn get_child_output_dictionary<___R>(
8856        &self,
8857        request: ___R,
8858    ) -> Result<
8859        ::fidl_next::ResponseFuture<'_, Self::Transport, realm::GetChildOutputDictionary>,
8860        ::fidl_next::EncodeError,
8861    >
8862    where
8863        ___R: ::fidl_next::Encode<
8864            <Self::Transport as ::fidl_next::Transport>::SendBuffer,
8865            Encoded = crate::WireRealmGetChildOutputDictionaryRequest<'static>,
8866        >,
8867    {
8868        self.as_untyped()
8869            .send_two_way(4781081784078915088, request)
8870            .map(::fidl_next::ResponseFuture::from_untyped)
8871    }
8872}
8873
8874/// A client handler for the Realm protocol.
8875///
8876/// See [`Realm`] for more details.
8877pub trait RealmClientHandler<___T: ::fidl_next::Transport> {}
8878
8879impl<___T, ___H> ::fidl_next::ClientProtocol<___T, ___H> for Realm
8880where
8881    ___T: ::fidl_next::Transport,
8882    ___H: RealmClientHandler<___T>,
8883
8884    <realm::OpenController as ::fidl_next::Method>::Response:
8885        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8886
8887    <realm::OpenExposedDir as ::fidl_next::Method>::Response:
8888        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8889
8890    <realm::CreateChild as ::fidl_next::Method>::Response:
8891        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8892
8893    <realm::DestroyChild as ::fidl_next::Method>::Response:
8894        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8895
8896    <realm::ListChildren as ::fidl_next::Method>::Response:
8897        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8898
8899    <realm::GetResolvedInfo as ::fidl_next::Method>::Response:
8900        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8901
8902    <realm::GetChildOutputDictionary as ::fidl_next::Method>::Response:
8903        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
8904{
8905    fn on_event(
8906        handler: &mut ___H,
8907        sender: &::fidl_next::ClientSender<___T, Self>,
8908        ordinal: u64,
8909        buffer: ___T::RecvBuffer,
8910    ) {
8911        match ordinal {
8912            ordinal => {
8913                sender.close();
8914            }
8915        }
8916    }
8917}
8918
8919/// A helper trait for the `Realm` server sender.
8920pub trait RealmServerSender {
8921    type Transport: ::fidl_next::Transport;
8922}
8923
8924impl<___T> RealmServerSender for ::fidl_next::ServerSender<___T, Realm>
8925where
8926    ___T: ::fidl_next::Transport,
8927{
8928    type Transport = ___T;
8929}
8930
8931/// A server handler for the Realm protocol.
8932///
8933/// See [`Realm`] for more details.
8934pub trait RealmServerHandler<___T: ::fidl_next::Transport> {
8935    #[doc = " Operate on a child component. See documentation for [`Controller`].\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8936    fn open_controller(
8937        &mut self,
8938        sender: &::fidl_next::ServerSender<___T, Realm>,
8939
8940        request: ::fidl_next::Request<___T, realm::OpenController>,
8941
8942        responder: ::fidl_next::Responder<realm::OpenController>,
8943    );
8944
8945    #[doc = " Opens the exposed directory of a child component instance. When this\n function successfully returns, `exposed_dir` is bound to a directory\n that contains the capabilities which the child exposed to its realm\n via `ComponentDecl.exposes` (specified via \"expose\" declarations in\n the component\'s manifest). The child component will not start as a\n result of this call. Instead, starting will occur iff the parent binds\n to one of the capabilities contained within `exposed_dir`.\n\n `exposed_dir` is open as long as `child` exists.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid child reference.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8946    fn open_exposed_dir(
8947        &mut self,
8948        sender: &::fidl_next::ServerSender<___T, Realm>,
8949
8950        request: ::fidl_next::Request<___T, realm::OpenExposedDir>,
8951
8952        responder: ::fidl_next::Responder<realm::OpenExposedDir>,
8953    );
8954
8955    #[doc = " Creates a child component instance dynamically. When this function\n returns successfully, the instance exists, but it may not be running.\n\n The environment of the child instance is determined by the environment\n of the collection. `decl` must not set `environment`.\n\n If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,\n [CreateChild] will start the component and return once the component is\n started. Otherwise, [CreateChild] will return immediately after creating\n the component and will not start or resolve it.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`\n   is not a valid declaration.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.\n - `INSTANCE_CANNOT_RESOLVE`: `child`\'s component declaration failed to resolve\n   in a `SingleRun` collection.\n - `NO_SPACE`: Could not allocate storage for the new instance.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8956    fn create_child(
8957        &mut self,
8958        sender: &::fidl_next::ServerSender<___T, Realm>,
8959
8960        request: ::fidl_next::Request<___T, realm::CreateChild>,
8961
8962        responder: ::fidl_next::Responder<realm::CreateChild>,
8963    );
8964
8965    #[doc = " Destroys a dynamically-created component instance. When this function\n returns, the instance is destroyed and has stopped running.  However,\n cleanup of the component\'s resources (such as its isolated storage) may\n happen in the background after this function returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer\n   to a dynamic instance.\n - `INSTANCE_NOT_FOUND`: `child` does not exist.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n"]
8966    fn destroy_child(
8967        &mut self,
8968        sender: &::fidl_next::ServerSender<___T, Realm>,
8969
8970        request: ::fidl_next::Request<___T, realm::DestroyChild>,
8971
8972        responder: ::fidl_next::Responder<realm::DestroyChild>,
8973    );
8974
8975    #[doc = " Returns an iterator that lists all instances in a collection.\n\n NOTE: The results are not guaranteed to be consistent. Instances may be\n created or destroyed while the iterator is live, but those changes\n won\'t be observed by the iterator after this method returns.\n\n Errors:\n - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`\n does not have `ZX_RIGHT_WAIT`.\n - `COLLECTION_NOT_FOUND`: `collection` does not exist.\n - `INSTANCE_DIED`: This realm no longer exists.\n - If `iter` does not have standard channel rights, this function may\n   return `ACCESS_DENIED` or component manager may close `iter`.\n"]
8976    fn list_children(
8977        &mut self,
8978        sender: &::fidl_next::ServerSender<___T, Realm>,
8979
8980        request: ::fidl_next::Request<___T, realm::ListChildren>,
8981
8982        responder: ::fidl_next::Responder<realm::ListChildren>,
8983    );
8984
8985    #[doc = " Returns the set of information that was given to the component framework\n by this component\'s resolver.\n"]
8986    fn get_resolved_info(
8987        &mut self,
8988        sender: &::fidl_next::ServerSender<___T, Realm>,
8989
8990        responder: ::fidl_next::Responder<realm::GetResolvedInfo>,
8991    );
8992
8993    fn get_child_output_dictionary(
8994        &mut self,
8995        sender: &::fidl_next::ServerSender<___T, Realm>,
8996
8997        request: ::fidl_next::Request<___T, realm::GetChildOutputDictionary>,
8998
8999        responder: ::fidl_next::Responder<realm::GetChildOutputDictionary>,
9000    );
9001}
9002
9003impl<___T, ___H> ::fidl_next::ServerProtocol<___T, ___H> for Realm
9004where
9005    ___T: ::fidl_next::Transport,
9006    ___H: RealmServerHandler<___T>,
9007
9008    <realm::OpenController as ::fidl_next::Method>::Request:
9009        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9010
9011    <realm::OpenExposedDir as ::fidl_next::Method>::Request:
9012        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9013
9014    <realm::CreateChild as ::fidl_next::Method>::Request:
9015        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9016
9017    <realm::DestroyChild as ::fidl_next::Method>::Request:
9018        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9019
9020    <realm::ListChildren as ::fidl_next::Method>::Request:
9021        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9022
9023    <realm::GetChildOutputDictionary as ::fidl_next::Method>::Request:
9024        ::fidl_next::Decode<<___T as ::fidl_next::Transport>::RecvBuffer>,
9025{
9026    fn on_one_way(
9027        handler: &mut ___H,
9028        sender: &::fidl_next::ServerSender<___T, Self>,
9029        ordinal: u64,
9030        buffer: ___T::RecvBuffer,
9031    ) {
9032        match ordinal {
9033            ordinal => {
9034                sender.close();
9035            }
9036        }
9037    }
9038
9039    fn on_two_way(
9040        handler: &mut ___H,
9041        sender: &::fidl_next::ServerSender<___T, Self>,
9042        ordinal: u64,
9043        buffer: ___T::RecvBuffer,
9044        responder: ::fidl_next::protocol::Responder,
9045    ) {
9046        match ordinal {
9047            8165227925828473216 => {
9048                let responder = ::fidl_next::Responder::from_untyped(responder);
9049
9050                match ::fidl_next::DecoderExt::decode(buffer) {
9051                    Ok(decoded) => handler.open_controller(sender, decoded, responder),
9052                    Err(e) => {
9053                        sender.close();
9054                    }
9055                }
9056            }
9057
9058            9194435320863127852 => {
9059                let responder = ::fidl_next::Responder::from_untyped(responder);
9060
9061                match ::fidl_next::DecoderExt::decode(buffer) {
9062                    Ok(decoded) => handler.open_exposed_dir(sender, decoded, responder),
9063                    Err(e) => {
9064                        sender.close();
9065                    }
9066                }
9067            }
9068
9069            4892190024503489888 => {
9070                let responder = ::fidl_next::Responder::from_untyped(responder);
9071
9072                match ::fidl_next::DecoderExt::decode(buffer) {
9073                    Ok(decoded) => handler.create_child(sender, decoded, responder),
9074                    Err(e) => {
9075                        sender.close();
9076                    }
9077                }
9078            }
9079
9080            8203529889988252194 => {
9081                let responder = ::fidl_next::Responder::from_untyped(responder);
9082
9083                match ::fidl_next::DecoderExt::decode(buffer) {
9084                    Ok(decoded) => handler.destroy_child(sender, decoded, responder),
9085                    Err(e) => {
9086                        sender.close();
9087                    }
9088                }
9089            }
9090
9091            7532454435519185057 => {
9092                let responder = ::fidl_next::Responder::from_untyped(responder);
9093
9094                match ::fidl_next::DecoderExt::decode(buffer) {
9095                    Ok(decoded) => handler.list_children(sender, decoded, responder),
9096                    Err(e) => {
9097                        sender.close();
9098                    }
9099                }
9100            }
9101
9102            8308987710372188322 => {
9103                let responder = ::fidl_next::Responder::from_untyped(responder);
9104
9105                handler.get_resolved_info(sender, responder);
9106            }
9107
9108            4781081784078915088 => {
9109                let responder = ::fidl_next::Responder::from_untyped(responder);
9110
9111                match ::fidl_next::DecoderExt::decode(buffer) {
9112                    Ok(decoded) => handler.get_child_output_dictionary(sender, decoded, responder),
9113                    Err(e) => {
9114                        sender.close();
9115                    }
9116                }
9117            }
9118
9119            ordinal => {
9120                sender.close();
9121            }
9122        }
9123    }
9124}
9125
9126pub type ChildName = String;
9127
9128/// The wire type corresponding to [`ChildName`].
9129pub type WireChildName<'de> = ::fidl_next::WireString<'de>;
9130
9131pub type UrlScheme = String;
9132
9133/// The wire type corresponding to [`UrlScheme`].
9134pub type WireUrlScheme<'de> = ::fidl_next::WireString<'de>;
9135
9136/// Compatibility shims which mimic some API surfaces of the current Rust bindings.
9137pub mod compat {
9138
9139    #[cfg(target_os = "fuchsia")]
9140    /// An alias for a client sender over `zx::Channel` for the `Binder`
9141    /// protocol.
9142    pub type BinderProxy =
9143        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Binder>;
9144
9145    impl ::core::convert::From<crate::Binder> for ::fidl_fuchsia_component::BinderMarker {
9146        #[inline]
9147        fn from(_: crate::Binder) -> Self {
9148            Self
9149        }
9150    }
9151
9152    #[cfg(target_os = "fuchsia")]
9153    /// An alias for a client sender over `zx::Channel` for the `ChildIterator`
9154    /// protocol.
9155    pub type ChildIteratorProxy =
9156        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ChildIterator>;
9157
9158    impl ::core::convert::From<crate::ChildIterator> for ::fidl_fuchsia_component::ChildIteratorMarker {
9159        #[inline]
9160        fn from(_: crate::ChildIterator) -> Self {
9161            Self
9162        }
9163    }
9164
9165    impl ::core::convert::From<crate::Error> for ::fidl_fuchsia_component::Error {
9166        #[inline]
9167        fn from(from: crate::Error) -> Self {
9168            match crate::Error::from(from) {
9169                crate::Error::Internal => Self::Internal,
9170
9171                crate::Error::InvalidArguments => Self::InvalidArguments,
9172
9173                crate::Error::Unsupported => Self::Unsupported,
9174
9175                crate::Error::AccessDenied => Self::AccessDenied,
9176
9177                crate::Error::InstanceNotFound => Self::InstanceNotFound,
9178
9179                crate::Error::InstanceAlreadyExists => Self::InstanceAlreadyExists,
9180
9181                crate::Error::InstanceCannotStart => Self::InstanceCannotStart,
9182
9183                crate::Error::InstanceCannotResolve => Self::InstanceCannotResolve,
9184
9185                crate::Error::CollectionNotFound => Self::CollectionNotFound,
9186
9187                crate::Error::ResourceUnavailable => Self::ResourceUnavailable,
9188
9189                crate::Error::InstanceDied => Self::InstanceDied,
9190
9191                crate::Error::ResourceNotFound => Self::ResourceNotFound,
9192
9193                crate::Error::InstanceCannotUnresolve => Self::InstanceCannotUnresolve,
9194
9195                crate::Error::InstanceAlreadyStarted => Self::InstanceAlreadyStarted,
9196
9197                crate::Error::UnknownOrdinal_(value) => {
9198                    Self::__SourceBreaking { unknown_ordinal: value }
9199                }
9200            }
9201        }
9202    }
9203
9204    #[cfg(target_os = "fuchsia")]
9205    /// An alias for a client sender over `zx::Channel` for the `Controller`
9206    /// protocol.
9207    pub type ControllerProxy =
9208        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Controller>;
9209
9210    impl ::core::convert::From<crate::Controller> for ::fidl_fuchsia_component::ControllerMarker {
9211        #[inline]
9212        fn from(_: crate::Controller) -> Self {
9213            Self
9214        }
9215    }
9216
9217    impl ::core::convert::From<crate::EventType> for ::fidl_fuchsia_component::EventType {
9218        #[inline]
9219        fn from(from: crate::EventType) -> Self {
9220            match crate::EventType::from(from) {
9221                crate::EventType::CapabilityRequested => Self::CapabilityRequested,
9222
9223                crate::EventType::DirectoryReady => Self::DirectoryReady,
9224
9225                crate::EventType::Discovered => Self::Discovered,
9226
9227                crate::EventType::Destroyed => Self::Destroyed,
9228
9229                crate::EventType::Resolved => Self::Resolved,
9230
9231                crate::EventType::Started => Self::Started,
9232
9233                crate::EventType::Stopped => Self::Stopped,
9234
9235                crate::EventType::DebugStarted => Self::DebugStarted,
9236
9237                crate::EventType::Unresolved => Self::Unresolved,
9238            }
9239        }
9240    }
9241
9242    #[cfg(target_os = "fuchsia")]
9243    /// An alias for a client sender over `zx::Channel` for the `EventStream`
9244    /// protocol.
9245    pub type EventStreamProxy =
9246        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::EventStream>;
9247
9248    impl ::core::convert::From<crate::EventStream> for ::fidl_fuchsia_component::EventStreamMarker {
9249        #[inline]
9250        fn from(_: crate::EventStream) -> Self {
9251            Self
9252        }
9253    }
9254
9255    #[cfg(target_os = "fuchsia")]
9256    /// An alias for a client sender over `zx::Channel` for the `ExecutionController`
9257    /// protocol.
9258    pub type ExecutionControllerProxy =
9259        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::ExecutionController>;
9260
9261    impl ::core::convert::From<crate::ExecutionController>
9262        for ::fidl_fuchsia_component::ExecutionControllerMarker
9263    {
9264        #[inline]
9265        fn from(_: crate::ExecutionController) -> Self {
9266            Self
9267        }
9268    }
9269
9270    #[cfg(target_os = "fuchsia")]
9271    /// An alias for a client sender over `zx::Channel` for the `Introspector`
9272    /// protocol.
9273    pub type IntrospectorProxy =
9274        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Introspector>;
9275
9276    impl ::core::convert::From<crate::Introspector> for ::fidl_fuchsia_component::IntrospectorMarker {
9277        #[inline]
9278        fn from(_: crate::Introspector) -> Self {
9279            Self
9280        }
9281    }
9282
9283    impl ::core::convert::From<crate::NamespaceError> for ::fidl_fuchsia_component::NamespaceError {
9284        #[inline]
9285        fn from(from: crate::NamespaceError) -> Self {
9286            match crate::NamespaceError::from(from) {
9287                crate::NamespaceError::Shadow => Self::Shadow,
9288
9289                crate::NamespaceError::Duplicate => Self::Duplicate,
9290
9291                crate::NamespaceError::Conversion => Self::Conversion,
9292
9293                crate::NamespaceError::BadEntry => Self::BadEntry,
9294
9295                crate::NamespaceError::DictionaryRead => Self::DictionaryRead,
9296
9297                crate::NamespaceError::UnknownOrdinal_(value) => {
9298                    Self::__SourceBreaking { unknown_ordinal: value }
9299                }
9300            }
9301        }
9302    }
9303
9304    #[cfg(target_os = "fuchsia")]
9305    /// An alias for a client sender over `zx::Channel` for the `Namespace`
9306    /// protocol.
9307    pub type NamespaceProxy =
9308        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Namespace>;
9309
9310    impl ::core::convert::From<crate::Namespace> for ::fidl_fuchsia_component::NamespaceMarker {
9311        #[inline]
9312        fn from(_: crate::Namespace) -> Self {
9313            Self
9314        }
9315    }
9316
9317    #[cfg(target_os = "fuchsia")]
9318    /// An alias for a client sender over `zx::Channel` for the `Realm`
9319    /// protocol.
9320    pub type RealmProxy =
9321        ::fidl_next::ClientSender<::fidl_next::fuchsia::zx::Channel, crate::Realm>;
9322
9323    impl ::core::convert::From<crate::Realm> for ::fidl_fuchsia_component::RealmMarker {
9324        #[inline]
9325        fn from(_: crate::Realm) -> Self {
9326            Self
9327        }
9328    }
9329}