fdomain_fuchsia_component/
fdomain_fuchsia_component.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fdomain_client::fidl::{ControlHandle as _, FDomainFlexibleIntoResult as _, Responder as _};
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9pub use fidl_fuchsia_component__common::*;
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub struct ControllerOpenExposedDirRequest {
15    pub exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
16}
17
18impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
19    for ControllerOpenExposedDirRequest
20{
21}
22
23#[derive(Debug, PartialEq)]
24pub struct ControllerStartRequest {
25    pub args: StartChildArgs,
26    pub execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
27}
28
29impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ControllerStartRequest {}
30
31#[derive(Debug, PartialEq)]
32pub struct ControllerGetExposedDictionaryResponse {
33    pub dictionary: fdomain_fuchsia_component_sandbox::DictionaryRef,
34}
35
36impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
37    for ControllerGetExposedDictionaryResponse
38{
39}
40
41#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
42pub struct ControllerGetOutputDictionaryResponse {
43    pub dictionary: fdomain_client::EventPair,
44}
45
46impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
47    for ControllerGetOutputDictionaryResponse
48{
49}
50
51#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
52pub struct ControllerIsStartedResponse {
53    pub is_started: bool,
54}
55
56impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
57    for ControllerIsStartedResponse
58{
59}
60
61#[derive(Debug, PartialEq)]
62pub struct EventStreamGetNextResponse {
63    pub events: Vec<Event>,
64}
65
66impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for EventStreamGetNextResponse {}
67
68#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
69pub struct IntrospectorGetMonikerRequest {
70    pub component_instance: fdomain_client::Event,
71}
72
73impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
74    for IntrospectorGetMonikerRequest
75{
76}
77
78#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
79pub struct NamespaceCreate2Request {
80    pub entries: Vec<NamespaceInputEntry2>,
81}
82
83impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreate2Request {}
84
85#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
86pub struct NamespaceCreateRequest {
87    pub entries: Vec<NamespaceInputEntry>,
88}
89
90impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreateRequest {}
91
92#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
93pub struct NamespaceInputEntry {
94    pub path: String,
95    pub dictionary:
96        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_component_sandbox::DictionaryMarker>,
97}
98
99impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceInputEntry {}
100
101#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
102pub struct NamespaceInputEntry2 {
103    /// The path at which the entry will exist in the namespace.
104    pub path: String,
105    /// A capability (created using fuchsia.component.runtime.Capabilities) to
106    /// install in the namespace. Currently only dictionaries are supported.
107    pub capability: fdomain_client::EventPair,
108}
109
110impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceInputEntry2 {}
111
112#[derive(Debug, PartialEq)]
113pub struct NamespaceCreate2Response {
114    pub entries: Vec<NamespaceEntry>,
115}
116
117impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreate2Response {}
118
119#[derive(Debug, PartialEq)]
120pub struct NamespaceCreateResponse {
121    pub entries: Vec<NamespaceEntry>,
122}
123
124impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreateResponse {}
125
126#[derive(Debug, PartialEq)]
127pub struct RealmCreateChildRequest {
128    pub collection: fdomain_fuchsia_component_decl::CollectionRef,
129    pub decl: fdomain_fuchsia_component_decl::Child,
130    pub args: CreateChildArgs,
131}
132
133impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmCreateChildRequest {}
134
135#[derive(Debug, PartialEq)]
136pub struct RealmGetChildOutputDictionaryDeprecatedRequest {
137    pub child: fdomain_fuchsia_component_decl::ChildRef,
138}
139
140impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
141    for RealmGetChildOutputDictionaryDeprecatedRequest
142{
143}
144
145#[derive(Debug, PartialEq)]
146pub struct RealmGetChildOutputDictionaryRequest {
147    pub child: fdomain_fuchsia_component_decl::ChildRef,
148}
149
150impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
151    for RealmGetChildOutputDictionaryRequest
152{
153}
154
155#[derive(Debug, PartialEq)]
156pub struct RealmListChildrenRequest {
157    pub collection: fdomain_fuchsia_component_decl::CollectionRef,
158    pub iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
159}
160
161impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmListChildrenRequest {}
162
163#[derive(Debug, PartialEq)]
164pub struct RealmOpenControllerRequest {
165    pub child: fdomain_fuchsia_component_decl::ChildRef,
166    pub controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
167}
168
169impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmOpenControllerRequest {}
170
171#[derive(Debug, PartialEq)]
172pub struct RealmOpenExposedDirRequest {
173    pub child: fdomain_fuchsia_component_decl::ChildRef,
174    pub exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
175}
176
177impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmOpenExposedDirRequest {}
178
179#[derive(Debug, PartialEq)]
180pub struct RealmGetChildOutputDictionaryDeprecatedResponse {
181    pub dictionary: fdomain_fuchsia_component_sandbox::DictionaryRef,
182}
183
184impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
185    for RealmGetChildOutputDictionaryDeprecatedResponse
186{
187}
188
189#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
190pub struct RealmGetChildOutputDictionaryResponse {
191    pub dictionary: fdomain_client::EventPair,
192}
193
194impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
195    for RealmGetChildOutputDictionaryResponse
196{
197}
198
199#[derive(Debug, PartialEq)]
200pub struct RealmGetResolvedInfoResponse {
201    pub resolved_info: fdomain_fuchsia_component_resolution::Component,
202}
203
204impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
205    for RealmGetResolvedInfoResponse
206{
207}
208
209#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
210pub struct StorageAdminListStorageInRealmRequest {
211    pub relative_moniker: String,
212    pub iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
213}
214
215impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
216    for StorageAdminListStorageInRealmRequest
217{
218}
219
220#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221pub struct StorageAdminOpenComponentStorageByIdRequest {
222    pub id: String,
223    pub object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
224}
225
226impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
227    for StorageAdminOpenComponentStorageByIdRequest
228{
229}
230
231#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
232pub struct StorageAdminOpenStorageRequest {
233    pub relative_moniker: String,
234    pub object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
235}
236
237impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
238    for StorageAdminOpenStorageRequest
239{
240}
241
242/// Payload for CapabilityRequested events
243#[derive(Debug, Default, PartialEq)]
244pub struct CapabilityRequestedPayload {
245    /// The name of the capability.
246    pub name: Option<String>,
247    /// A handle to the server end of the channel to host
248    /// capability.
249    pub capability: Option<fdomain_client::Channel>,
250    #[doc(hidden)]
251    pub __source_breaking: fidl::marker::SourceBreaking,
252}
253
254impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CapabilityRequestedPayload {}
255
256#[derive(Debug, Default, PartialEq)]
257pub struct CreateChildArgs {
258    /// The numbered handles to pass to the component instance.
259    ///
260    /// If the runner for the component does not support the numbered handles it is
261    /// expected to close the handles.
262    pub numbered_handles: Option<Vec<fdomain_fuchsia_process::HandleInfo>>,
263    /// Dynamic offers that will target the component instance.
264    ///
265    /// Including `OfferDecl`s in this vector will cause additional capabilities
266    /// to be offered to the newly created child, beyond the `OfferDecl`s in the
267    /// parent's `ComponentDecl` that target the collection.
268    ///
269    /// Any kind of offer (e.g., protocol, directory) can be used as a dynamic
270    /// offer. Any source that would be valid for a static offer is also valid
271    /// for a dynamic offer. Additionally, unlike static offers, dynamic offers
272    /// can use a "sibling" dynamic child component as a source by setting the
273    /// source to a `ChildRef` that sets the `collection` field.
274    ///
275    /// Dynamic offers always target the newly created child component. As a
276    /// result, `OfferDecl`s in `dynamic_offers` must not set the `target`
277    /// field, as its value is implied.
278    ///
279    /// If either the source (that is, the component named in the `source` field
280    /// of the `OfferDecl`) or the target of a dynamic offer is destroyed, the
281    /// offer itself is destroyed simultaneously.
282    ///
283    /// In order to set this field to a non-empty value, the collection in which
284    /// the child component is being created must specify
285    /// `ComponentDecl.allowed_offers = STATIC_AND_DYNAMIC`.
286    pub dynamic_offers: Option<Vec<fdomain_fuchsia_component_decl::Offer>>,
287    /// The controller for this component, which may be used to influence the
288    /// component's lifecycle.
289    pub controller: Option<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
290    /// A dictionary that contains extra capabilities for the component instance.
291    /// This field should be considered deprecated in favor of
292    /// `additional_inputs`. If both are set, an `INVALID_ARGUMENTS` error will
293    /// be returned.
294    pub dictionary: Option<fdomain_fuchsia_component_sandbox::DictionaryRef>,
295    /// A handle to a dictionary created using
296    /// fuchsia.component.runtime.Capabilities that contains additional
297    /// capabilities that should be added to the inputs of the created child.
298    pub additional_inputs: Option<fdomain_client::EventPair>,
299    #[doc(hidden)]
300    pub __source_breaking: fidl::marker::SourceBreaking,
301}
302
303impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CreateChildArgs {}
304
305/// Payload for DebugStarted events.
306#[derive(Debug, Default, PartialEq)]
307pub struct DebugStartedPayload {
308    /// The directory served by the runner to present runtime and runner-specific information
309    /// about the component. The other side is sent to the runner in ComponentStartInfo.
310    /// For example, it can be queried to know whether the component is an ELF component and
311    /// supports the break_on_start protocol below.
312    pub runtime_dir: Option<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>,
313    /// An eventpair that can be used by debuggers to defer the launch of the component,
314    /// e.g., ELF debuggers can setup the exception channel on the job while holding
315    /// the eventpair, then drop the eventpair to notify the runner that processes could
316    /// be created. The other side is sent to the runner in ComponentStartInfo.
317    pub break_on_start: Option<fdomain_client::EventPair>,
318    #[doc(hidden)]
319    pub __source_breaking: fidl::marker::SourceBreaking,
320}
321
322impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DebugStartedPayload {}
323
324/// Contains all information about a single event
325#[derive(Debug, Default, PartialEq)]
326pub struct Event {
327    /// Information about the component for which this event was generated.
328    pub header: Option<EventHeader>,
329    /// Optional payload for some event types
330    pub payload: Option<EventPayload>,
331    #[doc(hidden)]
332    pub __source_breaking: fidl::marker::SourceBreaking,
333}
334
335impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Event {}
336
337/// A single component namespace entry, which describes a namespace mount point
338/// (`path`) and the directory backing it (`directory`). This type is usually
339/// composed inside a vector.  See `ComponentStartInfo.ns` for more details.
340#[derive(Debug, Default, PartialEq)]
341pub struct NamespaceEntry {
342    /// The mount point for the directory, including a
343    /// leading slash. For example: "/pkg", "/svc", or "/config/data".
344    pub path: Option<String>,
345    /// The directory mounted at the above `path`.
346    pub directory: Option<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>,
347    #[doc(hidden)]
348    pub __source_breaking: fidl::marker::SourceBreaking,
349}
350
351impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceEntry {}
352
353#[derive(Debug, Default, PartialEq)]
354pub struct StartChildArgs {
355    /// The numbered handles to pass to the component instance.
356    ///
357    /// If the runner for the component does not support the numbered handles it
358    /// is expected to close the handles.
359    ///
360    /// If set, the values given here will override the handles given in
361    /// CreateChildArgs.
362    pub numbered_handles: Option<Vec<fdomain_fuchsia_process::HandleInfo>>,
363    /// The namespace generated by component manager will be extended to include
364    /// any namespace entries listed here before being given to the component's
365    /// runner.
366    ///
367    /// If there are any conflicting entries, an error will occur when starting
368    /// the component.
369    pub namespace_entries: Option<Vec<NamespaceEntry>>,
370    /// A dictionary that contains extra capabilities for the component instance.
371    /// This field should be considered deprecated in favor of
372    /// `additional_inputs`. If both are set, an `INVALID_ARGUMENTS` error will
373    /// be returned.
374    pub dictionary: Option<fdomain_fuchsia_component_sandbox::DictionaryRef>,
375    /// A handle to a dictionary created using
376    /// fuchsia.component.runtime.Capabilities that contains additional
377    /// capabilities that should be added to the inputs of the started program.
378    pub additional_inputs: Option<fdomain_client::EventPair>,
379    #[doc(hidden)]
380    pub __source_breaking: fidl::marker::SourceBreaking,
381}
382
383impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for StartChildArgs {}
384
385/// Encapsulates additional data/protocols for some event types.
386#[derive(Debug)]
387pub enum EventPayload {
388    /// Payload for CapabilityRequested events
389    CapabilityRequested(CapabilityRequestedPayload),
390    /// Payload for Purged events.
391    Purged(PurgedPayload),
392    /// Payload for Discovered events.
393    Discovered(DiscoveredPayload),
394    /// Payload for Destroyed events.
395    Destroyed(DestroyedPayload),
396    /// Payload for Resolved events
397    Resolved(ResolvedPayload),
398    /// Payload for Started events
399    Started(StartedPayload),
400    /// Payload for Stopped events
401    Stopped(StoppedPayload),
402    /// Payload for DebugStarted events
403    DebugStarted(DebugStartedPayload),
404    /// Payload for Unresolved events
405    Unresolved(UnresolvedPayload),
406    #[doc(hidden)]
407    __SourceBreaking { unknown_ordinal: u64 },
408}
409
410/// Pattern that matches an unknown `EventPayload` member.
411#[macro_export]
412macro_rules! EventPayloadUnknown {
413    () => {
414        _
415    };
416}
417
418// Custom PartialEq so that unknown variants are not equal to themselves.
419impl PartialEq for EventPayload {
420    fn eq(&self, other: &Self) -> bool {
421        match (self, other) {
422            (Self::CapabilityRequested(x), Self::CapabilityRequested(y)) => *x == *y,
423            (Self::Purged(x), Self::Purged(y)) => *x == *y,
424            (Self::Discovered(x), Self::Discovered(y)) => *x == *y,
425            (Self::Destroyed(x), Self::Destroyed(y)) => *x == *y,
426            (Self::Resolved(x), Self::Resolved(y)) => *x == *y,
427            (Self::Started(x), Self::Started(y)) => *x == *y,
428            (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
429            (Self::DebugStarted(x), Self::DebugStarted(y)) => *x == *y,
430            (Self::Unresolved(x), Self::Unresolved(y)) => *x == *y,
431            _ => false,
432        }
433    }
434}
435
436impl EventPayload {
437    #[inline]
438    pub fn ordinal(&self) -> u64 {
439        match *self {
440            Self::CapabilityRequested(_) => 1,
441            Self::Purged(_) => 2,
442            Self::Discovered(_) => 4,
443            Self::Destroyed(_) => 5,
444            Self::Resolved(_) => 6,
445            Self::Started(_) => 7,
446            Self::Stopped(_) => 8,
447            Self::DebugStarted(_) => 9,
448            Self::Unresolved(_) => 10,
449            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
450        }
451    }
452
453    #[inline]
454    pub fn unknown_variant_for_testing() -> Self {
455        Self::__SourceBreaking { unknown_ordinal: 0 }
456    }
457
458    #[inline]
459    pub fn is_unknown(&self) -> bool {
460        match self {
461            Self::__SourceBreaking { .. } => true,
462            _ => false,
463        }
464    }
465}
466
467impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for EventPayload {}
468
469#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
470pub struct BinderMarker;
471
472impl fdomain_client::fidl::ProtocolMarker for BinderMarker {
473    type Proxy = BinderProxy;
474    type RequestStream = BinderRequestStream;
475
476    const DEBUG_NAME: &'static str = "fuchsia.component.Binder";
477}
478impl fdomain_client::fidl::DiscoverableProtocolMarker for BinderMarker {}
479
480pub trait BinderProxyInterface: Send + Sync {}
481
482#[derive(Debug, Clone)]
483pub struct BinderProxy {
484    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
485}
486
487impl fdomain_client::fidl::Proxy for BinderProxy {
488    type Protocol = BinderMarker;
489
490    fn from_channel(inner: fdomain_client::Channel) -> Self {
491        Self::new(inner)
492    }
493
494    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
495        self.client.into_channel().map_err(|client| Self { client })
496    }
497
498    fn as_channel(&self) -> &fdomain_client::Channel {
499        self.client.as_channel()
500    }
501}
502
503impl BinderProxy {
504    /// Create a new Proxy for fuchsia.component/Binder.
505    pub fn new(channel: fdomain_client::Channel) -> Self {
506        let protocol_name = <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
507        Self { client: fidl::client::Client::new(channel, protocol_name) }
508    }
509
510    /// Get a Stream of events from the remote end of the protocol.
511    ///
512    /// # Panics
513    ///
514    /// Panics if the event stream was already taken.
515    pub fn take_event_stream(&self) -> BinderEventStream {
516        BinderEventStream { event_receiver: self.client.take_event_receiver() }
517    }
518}
519
520impl BinderProxyInterface for BinderProxy {}
521
522pub struct BinderEventStream {
523    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
524}
525
526impl std::marker::Unpin for BinderEventStream {}
527
528impl futures::stream::FusedStream for BinderEventStream {
529    fn is_terminated(&self) -> bool {
530        self.event_receiver.is_terminated()
531    }
532}
533
534impl futures::Stream for BinderEventStream {
535    type Item = Result<BinderEvent, fidl::Error>;
536
537    fn poll_next(
538        mut self: std::pin::Pin<&mut Self>,
539        cx: &mut std::task::Context<'_>,
540    ) -> std::task::Poll<Option<Self::Item>> {
541        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
542            &mut self.event_receiver,
543            cx
544        )?) {
545            Some(buf) => std::task::Poll::Ready(Some(BinderEvent::decode(buf))),
546            None => std::task::Poll::Ready(None),
547        }
548    }
549}
550
551#[derive(Debug)]
552pub enum BinderEvent {}
553
554impl BinderEvent {
555    /// Decodes a message buffer as a [`BinderEvent`].
556    fn decode(
557        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
558    ) -> Result<BinderEvent, fidl::Error> {
559        let (bytes, _handles) = buf.split_mut();
560        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
561        debug_assert_eq!(tx_header.tx_id, 0);
562        match tx_header.ordinal {
563            _ => Err(fidl::Error::UnknownOrdinal {
564                ordinal: tx_header.ordinal,
565                protocol_name: <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
566            }),
567        }
568    }
569}
570
571/// A Stream of incoming requests for fuchsia.component/Binder.
572pub struct BinderRequestStream {
573    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
574    is_terminated: bool,
575}
576
577impl std::marker::Unpin for BinderRequestStream {}
578
579impl futures::stream::FusedStream for BinderRequestStream {
580    fn is_terminated(&self) -> bool {
581        self.is_terminated
582    }
583}
584
585impl fdomain_client::fidl::RequestStream for BinderRequestStream {
586    type Protocol = BinderMarker;
587    type ControlHandle = BinderControlHandle;
588
589    fn from_channel(channel: fdomain_client::Channel) -> Self {
590        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
591    }
592
593    fn control_handle(&self) -> Self::ControlHandle {
594        BinderControlHandle { inner: self.inner.clone() }
595    }
596
597    fn into_inner(
598        self,
599    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
600    {
601        (self.inner, self.is_terminated)
602    }
603
604    fn from_inner(
605        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
606        is_terminated: bool,
607    ) -> Self {
608        Self { inner, is_terminated }
609    }
610}
611
612impl futures::Stream for BinderRequestStream {
613    type Item = Result<BinderRequest, fidl::Error>;
614
615    fn poll_next(
616        mut self: std::pin::Pin<&mut Self>,
617        cx: &mut std::task::Context<'_>,
618    ) -> std::task::Poll<Option<Self::Item>> {
619        let this = &mut *self;
620        if this.inner.check_shutdown(cx) {
621            this.is_terminated = true;
622            return std::task::Poll::Ready(None);
623        }
624        if this.is_terminated {
625            panic!("polled BinderRequestStream after completion");
626        }
627        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
628            |bytes, handles| {
629                match this.inner.channel().read_etc(cx, bytes, handles) {
630                    std::task::Poll::Ready(Ok(())) => {}
631                    std::task::Poll::Pending => return std::task::Poll::Pending,
632                    std::task::Poll::Ready(Err(None)) => {
633                        this.is_terminated = true;
634                        return std::task::Poll::Ready(None);
635                    }
636                    std::task::Poll::Ready(Err(Some(e))) => {
637                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
638                            e.into(),
639                        ))));
640                    }
641                }
642
643                // A message has been received from the channel
644                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
645
646                std::task::Poll::Ready(Some(match header.ordinal {
647                    _ => Err(fidl::Error::UnknownOrdinal {
648                        ordinal: header.ordinal,
649                        protocol_name:
650                            <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
651                    }),
652                }))
653            },
654        )
655    }
656}
657
658/// A framework-provided protocol that allows components that use it to bind to
659/// the component that exposes it. The act of connecting to this protocol will
660/// trigger the bind. Thus, this protocol contains no methods. For more details
661/// on binding, see
662/// https://fuchsia.dev/fuchsia-src/concepts/components/v2/lifecycle#binding.
663///
664/// When a component connects to protocol, the component exposing this capability
665/// will be started if it's not already running. Upon a failure to start, the
666/// component framework will close the server end of the channel with a
667/// zx.Status epitaph.
668#[derive(Debug)]
669pub enum BinderRequest {}
670
671impl BinderRequest {
672    /// Name of the method defined in FIDL
673    pub fn method_name(&self) -> &'static str {
674        match *self {}
675    }
676}
677
678#[derive(Debug, Clone)]
679pub struct BinderControlHandle {
680    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
681}
682
683impl fdomain_client::fidl::ControlHandle for BinderControlHandle {
684    fn shutdown(&self) {
685        self.inner.shutdown()
686    }
687
688    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
689        self.inner.shutdown_with_epitaph(status)
690    }
691
692    fn is_closed(&self) -> bool {
693        self.inner.channel().is_closed()
694    }
695    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
696        self.inner.channel().on_closed()
697    }
698}
699
700impl BinderControlHandle {}
701
702#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
703pub struct ChildIteratorMarker;
704
705impl fdomain_client::fidl::ProtocolMarker for ChildIteratorMarker {
706    type Proxy = ChildIteratorProxy;
707    type RequestStream = ChildIteratorRequestStream;
708
709    const DEBUG_NAME: &'static str = "(anonymous) ChildIterator";
710}
711
712pub trait ChildIteratorProxyInterface: Send + Sync {
713    type NextResponseFut: std::future::Future<
714            Output = Result<Vec<fdomain_fuchsia_component_decl::ChildRef>, fidl::Error>,
715        > + Send;
716    fn r#next(&self) -> Self::NextResponseFut;
717}
718
719#[derive(Debug, Clone)]
720pub struct ChildIteratorProxy {
721    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
722}
723
724impl fdomain_client::fidl::Proxy for ChildIteratorProxy {
725    type Protocol = ChildIteratorMarker;
726
727    fn from_channel(inner: fdomain_client::Channel) -> Self {
728        Self::new(inner)
729    }
730
731    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
732        self.client.into_channel().map_err(|client| Self { client })
733    }
734
735    fn as_channel(&self) -> &fdomain_client::Channel {
736        self.client.as_channel()
737    }
738}
739
740impl ChildIteratorProxy {
741    /// Create a new Proxy for fuchsia.component/ChildIterator.
742    pub fn new(channel: fdomain_client::Channel) -> Self {
743        let protocol_name =
744            <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
745        Self { client: fidl::client::Client::new(channel, protocol_name) }
746    }
747
748    /// Get a Stream of events from the remote end of the protocol.
749    ///
750    /// # Panics
751    ///
752    /// Panics if the event stream was already taken.
753    pub fn take_event_stream(&self) -> ChildIteratorEventStream {
754        ChildIteratorEventStream { event_receiver: self.client.take_event_receiver() }
755    }
756
757    /// Advance the iterator and return the next batch of children.
758    ///
759    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
760    /// no more children.
761    pub fn r#next(
762        &self,
763    ) -> fidl::client::QueryResponseFut<
764        Vec<fdomain_fuchsia_component_decl::ChildRef>,
765        fdomain_client::fidl::FDomainResourceDialect,
766    > {
767        ChildIteratorProxyInterface::r#next(self)
768    }
769}
770
771impl ChildIteratorProxyInterface for ChildIteratorProxy {
772    type NextResponseFut = fidl::client::QueryResponseFut<
773        Vec<fdomain_fuchsia_component_decl::ChildRef>,
774        fdomain_client::fidl::FDomainResourceDialect,
775    >;
776    fn r#next(&self) -> Self::NextResponseFut {
777        fn _decode(
778            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
779        ) -> Result<Vec<fdomain_fuchsia_component_decl::ChildRef>, fidl::Error> {
780            let _response = fidl::client::decode_transaction_body::<
781                ChildIteratorNextResponse,
782                fdomain_client::fidl::FDomainResourceDialect,
783                0x40e4c3882b050d08,
784            >(_buf?)?;
785            Ok(_response.children)
786        }
787        self.client.send_query_and_decode::<
788            fidl::encoding::EmptyPayload,
789            Vec<fdomain_fuchsia_component_decl::ChildRef>,
790        >(
791            (),
792            0x40e4c3882b050d08,
793            fidl::encoding::DynamicFlags::empty(),
794            _decode,
795        )
796    }
797}
798
799pub struct ChildIteratorEventStream {
800    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
801}
802
803impl std::marker::Unpin for ChildIteratorEventStream {}
804
805impl futures::stream::FusedStream for ChildIteratorEventStream {
806    fn is_terminated(&self) -> bool {
807        self.event_receiver.is_terminated()
808    }
809}
810
811impl futures::Stream for ChildIteratorEventStream {
812    type Item = Result<ChildIteratorEvent, fidl::Error>;
813
814    fn poll_next(
815        mut self: std::pin::Pin<&mut Self>,
816        cx: &mut std::task::Context<'_>,
817    ) -> std::task::Poll<Option<Self::Item>> {
818        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
819            &mut self.event_receiver,
820            cx
821        )?) {
822            Some(buf) => std::task::Poll::Ready(Some(ChildIteratorEvent::decode(buf))),
823            None => std::task::Poll::Ready(None),
824        }
825    }
826}
827
828#[derive(Debug)]
829pub enum ChildIteratorEvent {}
830
831impl ChildIteratorEvent {
832    /// Decodes a message buffer as a [`ChildIteratorEvent`].
833    fn decode(
834        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
835    ) -> Result<ChildIteratorEvent, fidl::Error> {
836        let (bytes, _handles) = buf.split_mut();
837        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
838        debug_assert_eq!(tx_header.tx_id, 0);
839        match tx_header.ordinal {
840            _ => Err(fidl::Error::UnknownOrdinal {
841                ordinal: tx_header.ordinal,
842                protocol_name:
843                    <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
844            }),
845        }
846    }
847}
848
849/// A Stream of incoming requests for fuchsia.component/ChildIterator.
850pub struct ChildIteratorRequestStream {
851    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
852    is_terminated: bool,
853}
854
855impl std::marker::Unpin for ChildIteratorRequestStream {}
856
857impl futures::stream::FusedStream for ChildIteratorRequestStream {
858    fn is_terminated(&self) -> bool {
859        self.is_terminated
860    }
861}
862
863impl fdomain_client::fidl::RequestStream for ChildIteratorRequestStream {
864    type Protocol = ChildIteratorMarker;
865    type ControlHandle = ChildIteratorControlHandle;
866
867    fn from_channel(channel: fdomain_client::Channel) -> Self {
868        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
869    }
870
871    fn control_handle(&self) -> Self::ControlHandle {
872        ChildIteratorControlHandle { inner: self.inner.clone() }
873    }
874
875    fn into_inner(
876        self,
877    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
878    {
879        (self.inner, self.is_terminated)
880    }
881
882    fn from_inner(
883        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
884        is_terminated: bool,
885    ) -> Self {
886        Self { inner, is_terminated }
887    }
888}
889
890impl futures::Stream for ChildIteratorRequestStream {
891    type Item = Result<ChildIteratorRequest, fidl::Error>;
892
893    fn poll_next(
894        mut self: std::pin::Pin<&mut Self>,
895        cx: &mut std::task::Context<'_>,
896    ) -> std::task::Poll<Option<Self::Item>> {
897        let this = &mut *self;
898        if this.inner.check_shutdown(cx) {
899            this.is_terminated = true;
900            return std::task::Poll::Ready(None);
901        }
902        if this.is_terminated {
903            panic!("polled ChildIteratorRequestStream after completion");
904        }
905        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
906            |bytes, handles| {
907                match this.inner.channel().read_etc(cx, bytes, handles) {
908                    std::task::Poll::Ready(Ok(())) => {}
909                    std::task::Poll::Pending => return std::task::Poll::Pending,
910                    std::task::Poll::Ready(Err(None)) => {
911                        this.is_terminated = true;
912                        return std::task::Poll::Ready(None);
913                    }
914                    std::task::Poll::Ready(Err(Some(e))) => {
915                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
916                            e.into(),
917                        ))));
918                    }
919                }
920
921                // A message has been received from the channel
922                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
923
924                std::task::Poll::Ready(Some(match header.ordinal {
925                0x40e4c3882b050d08 => {
926                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
927                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
928                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
929                    let control_handle = ChildIteratorControlHandle {
930                        inner: this.inner.clone(),
931                    };
932                    Ok(ChildIteratorRequest::Next {
933                        responder: ChildIteratorNextResponder {
934                            control_handle: std::mem::ManuallyDrop::new(control_handle),
935                            tx_id: header.tx_id,
936                        },
937                    })
938                }
939                _ => Err(fidl::Error::UnknownOrdinal {
940                    ordinal: header.ordinal,
941                    protocol_name: <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
942                }),
943            }))
944            },
945        )
946    }
947}
948
949/// A protocol to iterate over the list of children in a realm.
950#[derive(Debug)]
951pub enum ChildIteratorRequest {
952    /// Advance the iterator and return the next batch of children.
953    ///
954    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
955    /// no more children.
956    Next { responder: ChildIteratorNextResponder },
957}
958
959impl ChildIteratorRequest {
960    #[allow(irrefutable_let_patterns)]
961    pub fn into_next(self) -> Option<(ChildIteratorNextResponder)> {
962        if let ChildIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
963    }
964
965    /// Name of the method defined in FIDL
966    pub fn method_name(&self) -> &'static str {
967        match *self {
968            ChildIteratorRequest::Next { .. } => "next",
969        }
970    }
971}
972
973#[derive(Debug, Clone)]
974pub struct ChildIteratorControlHandle {
975    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
976}
977
978impl fdomain_client::fidl::ControlHandle for ChildIteratorControlHandle {
979    fn shutdown(&self) {
980        self.inner.shutdown()
981    }
982
983    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
984        self.inner.shutdown_with_epitaph(status)
985    }
986
987    fn is_closed(&self) -> bool {
988        self.inner.channel().is_closed()
989    }
990    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
991        self.inner.channel().on_closed()
992    }
993}
994
995impl ChildIteratorControlHandle {}
996
997#[must_use = "FIDL methods require a response to be sent"]
998#[derive(Debug)]
999pub struct ChildIteratorNextResponder {
1000    control_handle: std::mem::ManuallyDrop<ChildIteratorControlHandle>,
1001    tx_id: u32,
1002}
1003
1004/// Set the the channel to be shutdown (see [`ChildIteratorControlHandle::shutdown`])
1005/// if the responder is dropped without sending a response, so that the client
1006/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1007impl std::ops::Drop for ChildIteratorNextResponder {
1008    fn drop(&mut self) {
1009        self.control_handle.shutdown();
1010        // Safety: drops once, never accessed again
1011        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1012    }
1013}
1014
1015impl fdomain_client::fidl::Responder for ChildIteratorNextResponder {
1016    type ControlHandle = ChildIteratorControlHandle;
1017
1018    fn control_handle(&self) -> &ChildIteratorControlHandle {
1019        &self.control_handle
1020    }
1021
1022    fn drop_without_shutdown(mut self) {
1023        // Safety: drops once, never accessed again due to mem::forget
1024        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1025        // Prevent Drop from running (which would shut down the channel)
1026        std::mem::forget(self);
1027    }
1028}
1029
1030impl ChildIteratorNextResponder {
1031    /// Sends a response to the FIDL transaction.
1032    ///
1033    /// Sets the channel to shutdown if an error occurs.
1034    pub fn send(
1035        self,
1036        mut children: &[fdomain_fuchsia_component_decl::ChildRef],
1037    ) -> Result<(), fidl::Error> {
1038        let _result = self.send_raw(children);
1039        if _result.is_err() {
1040            self.control_handle.shutdown();
1041        }
1042        self.drop_without_shutdown();
1043        _result
1044    }
1045
1046    /// Similar to "send" but does not shutdown the channel if an error occurs.
1047    pub fn send_no_shutdown_on_err(
1048        self,
1049        mut children: &[fdomain_fuchsia_component_decl::ChildRef],
1050    ) -> Result<(), fidl::Error> {
1051        let _result = self.send_raw(children);
1052        self.drop_without_shutdown();
1053        _result
1054    }
1055
1056    fn send_raw(
1057        &self,
1058        mut children: &[fdomain_fuchsia_component_decl::ChildRef],
1059    ) -> Result<(), fidl::Error> {
1060        self.control_handle.inner.send::<ChildIteratorNextResponse>(
1061            (children,),
1062            self.tx_id,
1063            0x40e4c3882b050d08,
1064            fidl::encoding::DynamicFlags::empty(),
1065        )
1066    }
1067}
1068
1069#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1070pub struct ControllerMarker;
1071
1072impl fdomain_client::fidl::ProtocolMarker for ControllerMarker {
1073    type Proxy = ControllerProxy;
1074    type RequestStream = ControllerRequestStream;
1075
1076    const DEBUG_NAME: &'static str = "(anonymous) Controller";
1077}
1078pub type ControllerStartResult = Result<(), Error>;
1079pub type ControllerIsStartedResult = Result<bool, Error>;
1080pub type ControllerOpenExposedDirResult = Result<(), Error>;
1081pub type ControllerGetExposedDictionaryResult =
1082    Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>;
1083pub type ControllerGetOutputDictionaryResult = Result<fdomain_client::EventPair, Error>;
1084pub type ControllerDestroyResult = Result<(), Error>;
1085
1086pub trait ControllerProxyInterface: Send + Sync {
1087    type StartResponseFut: std::future::Future<Output = Result<ControllerStartResult, fidl::Error>>
1088        + Send;
1089    fn r#start(
1090        &self,
1091        args: StartChildArgs,
1092        execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1093    ) -> Self::StartResponseFut;
1094    type IsStartedResponseFut: std::future::Future<Output = Result<ControllerIsStartedResult, fidl::Error>>
1095        + Send;
1096    fn r#is_started(&self) -> Self::IsStartedResponseFut;
1097    type OpenExposedDirResponseFut: std::future::Future<Output = Result<ControllerOpenExposedDirResult, fidl::Error>>
1098        + Send;
1099    fn r#open_exposed_dir(
1100        &self,
1101        exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
1102    ) -> Self::OpenExposedDirResponseFut;
1103    type GetExposedDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetExposedDictionaryResult, fidl::Error>>
1104        + Send;
1105    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut;
1106    type GetOutputDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetOutputDictionaryResult, fidl::Error>>
1107        + Send;
1108    fn r#get_output_dictionary(&self) -> Self::GetOutputDictionaryResponseFut;
1109    type DestroyResponseFut: std::future::Future<Output = Result<ControllerDestroyResult, fidl::Error>>
1110        + Send;
1111    fn r#destroy(&self) -> Self::DestroyResponseFut;
1112}
1113
1114#[derive(Debug, Clone)]
1115pub struct ControllerProxy {
1116    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1117}
1118
1119impl fdomain_client::fidl::Proxy for ControllerProxy {
1120    type Protocol = ControllerMarker;
1121
1122    fn from_channel(inner: fdomain_client::Channel) -> Self {
1123        Self::new(inner)
1124    }
1125
1126    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1127        self.client.into_channel().map_err(|client| Self { client })
1128    }
1129
1130    fn as_channel(&self) -> &fdomain_client::Channel {
1131        self.client.as_channel()
1132    }
1133}
1134
1135impl ControllerProxy {
1136    /// Create a new Proxy for fuchsia.component/Controller.
1137    pub fn new(channel: fdomain_client::Channel) -> Self {
1138        let protocol_name = <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1139        Self { client: fidl::client::Client::new(channel, protocol_name) }
1140    }
1141
1142    /// Get a Stream of events from the remote end of the protocol.
1143    ///
1144    /// # Panics
1145    ///
1146    /// Panics if the event stream was already taken.
1147    pub fn take_event_stream(&self) -> ControllerEventStream {
1148        ControllerEventStream { event_receiver: self.client.take_event_receiver() }
1149    }
1150
1151    /// Start the component, optionally providing additional handles to be given
1152    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1153    /// currently running.
1154    pub fn r#start(
1155        &self,
1156        mut args: StartChildArgs,
1157        mut execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1158    ) -> fidl::client::QueryResponseFut<
1159        ControllerStartResult,
1160        fdomain_client::fidl::FDomainResourceDialect,
1161    > {
1162        ControllerProxyInterface::r#start(self, args, execution_controller)
1163    }
1164
1165    /// Returns true if this instance is currently running.
1166    pub fn r#is_started(
1167        &self,
1168    ) -> fidl::client::QueryResponseFut<
1169        ControllerIsStartedResult,
1170        fdomain_client::fidl::FDomainResourceDialect,
1171    > {
1172        ControllerProxyInterface::r#is_started(self)
1173    }
1174
1175    /// Opens the exposed directory of the controlled component, through which
1176    /// capabilities the component exposed via `ComponentDecl.exposes` are
1177    /// available, on success.
1178    ///
1179    /// Binding to the exposed directory requires that the component be
1180    /// resolved, but it will not be started until/unless some capability is
1181    /// requested that requires it to be.
1182    ///
1183    /// If this component is destroyed, any outstanding connections to
1184    /// `exposed_dir` will be closed.
1185    ///
1186    /// Errors:
1187    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
1188    pub fn r#open_exposed_dir(
1189        &self,
1190        mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
1191    ) -> fidl::client::QueryResponseFut<
1192        ControllerOpenExposedDirResult,
1193        fdomain_client::fidl::FDomainResourceDialect,
1194    > {
1195        ControllerProxyInterface::r#open_exposed_dir(self, exposed_dir)
1196    }
1197
1198    /// Returns the dictionary containing the component's exposed capabilities.
1199    pub fn r#get_exposed_dictionary(
1200        &self,
1201    ) -> fidl::client::QueryResponseFut<
1202        ControllerGetExposedDictionaryResult,
1203        fdomain_client::fidl::FDomainResourceDialect,
1204    > {
1205        ControllerProxyInterface::r#get_exposed_dictionary(self)
1206    }
1207
1208    /// Returns a reference to the component's output dictionary, which may be
1209    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
1210    pub fn r#get_output_dictionary(
1211        &self,
1212    ) -> fidl::client::QueryResponseFut<
1213        ControllerGetOutputDictionaryResult,
1214        fdomain_client::fidl::FDomainResourceDialect,
1215    > {
1216        ControllerProxyInterface::r#get_output_dictionary(self)
1217    }
1218
1219    /// Destroys this component. When this method returns, the component is
1220    /// either destroyed or in the case of an error no destruction happened.
1221    ///
1222    /// Errors:
1223    ///
1224    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1225    /// Currently, this can happen if the component is a static child of its
1226    /// parent.
1227    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
1228    ///   manager's logs will contain more detail.
1229    pub fn r#destroy(
1230        &self,
1231    ) -> fidl::client::QueryResponseFut<
1232        ControllerDestroyResult,
1233        fdomain_client::fidl::FDomainResourceDialect,
1234    > {
1235        ControllerProxyInterface::r#destroy(self)
1236    }
1237}
1238
1239impl ControllerProxyInterface for ControllerProxy {
1240    type StartResponseFut = fidl::client::QueryResponseFut<
1241        ControllerStartResult,
1242        fdomain_client::fidl::FDomainResourceDialect,
1243    >;
1244    fn r#start(
1245        &self,
1246        mut args: StartChildArgs,
1247        mut execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1248    ) -> Self::StartResponseFut {
1249        fn _decode(
1250            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1251        ) -> Result<ControllerStartResult, fidl::Error> {
1252            let _response = fidl::client::decode_transaction_body::<
1253                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1254                fdomain_client::fidl::FDomainResourceDialect,
1255                0x68878076b8d2eac5,
1256            >(_buf?)?
1257            .into_result_fdomain::<ControllerMarker>("start")?;
1258            Ok(_response.map(|x| x))
1259        }
1260        self.client.send_query_and_decode::<ControllerStartRequest, ControllerStartResult>(
1261            (&mut args, execution_controller),
1262            0x68878076b8d2eac5,
1263            fidl::encoding::DynamicFlags::FLEXIBLE,
1264            _decode,
1265        )
1266    }
1267
1268    type IsStartedResponseFut = fidl::client::QueryResponseFut<
1269        ControllerIsStartedResult,
1270        fdomain_client::fidl::FDomainResourceDialect,
1271    >;
1272    fn r#is_started(&self) -> Self::IsStartedResponseFut {
1273        fn _decode(
1274            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1275        ) -> Result<ControllerIsStartedResult, fidl::Error> {
1276            let _response = fidl::client::decode_transaction_body::<
1277                fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1278                fdomain_client::fidl::FDomainResourceDialect,
1279                0x2155e6e1db2083c3,
1280            >(_buf?)?
1281            .into_result_fdomain::<ControllerMarker>("is_started")?;
1282            Ok(_response.map(|x| x.is_started))
1283        }
1284        self.client
1285            .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerIsStartedResult>(
1286                (),
1287                0x2155e6e1db2083c3,
1288                fidl::encoding::DynamicFlags::FLEXIBLE,
1289                _decode,
1290            )
1291    }
1292
1293    type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
1294        ControllerOpenExposedDirResult,
1295        fdomain_client::fidl::FDomainResourceDialect,
1296    >;
1297    fn r#open_exposed_dir(
1298        &self,
1299        mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
1300    ) -> Self::OpenExposedDirResponseFut {
1301        fn _decode(
1302            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1303        ) -> Result<ControllerOpenExposedDirResult, fidl::Error> {
1304            let _response = fidl::client::decode_transaction_body::<
1305                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1306                fdomain_client::fidl::FDomainResourceDialect,
1307                0x253cabb9a840ed94,
1308            >(_buf?)?;
1309            Ok(_response.map(|x| x))
1310        }
1311        self.client.send_query_and_decode::<
1312            ControllerOpenExposedDirRequest,
1313            ControllerOpenExposedDirResult,
1314        >(
1315            (exposed_dir,),
1316            0x253cabb9a840ed94,
1317            fidl::encoding::DynamicFlags::empty(),
1318            _decode,
1319        )
1320    }
1321
1322    type GetExposedDictionaryResponseFut = fidl::client::QueryResponseFut<
1323        ControllerGetExposedDictionaryResult,
1324        fdomain_client::fidl::FDomainResourceDialect,
1325    >;
1326    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut {
1327        fn _decode(
1328            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1329        ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1330            let _response = fidl::client::decode_transaction_body::<
1331                fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1332                fdomain_client::fidl::FDomainResourceDialect,
1333                0x7e48373e5eda1f9b,
1334            >(_buf?)?
1335            .into_result_fdomain::<ControllerMarker>("get_exposed_dictionary")?;
1336            Ok(_response.map(|x| x.dictionary))
1337        }
1338        self.client.send_query_and_decode::<
1339            fidl::encoding::EmptyPayload,
1340            ControllerGetExposedDictionaryResult,
1341        >(
1342            (),
1343            0x7e48373e5eda1f9b,
1344            fidl::encoding::DynamicFlags::FLEXIBLE,
1345            _decode,
1346        )
1347    }
1348
1349    type GetOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
1350        ControllerGetOutputDictionaryResult,
1351        fdomain_client::fidl::FDomainResourceDialect,
1352    >;
1353    fn r#get_output_dictionary(&self) -> Self::GetOutputDictionaryResponseFut {
1354        fn _decode(
1355            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1356        ) -> Result<ControllerGetOutputDictionaryResult, fidl::Error> {
1357            let _response = fidl::client::decode_transaction_body::<
1358                fidl::encoding::FlexibleResultType<ControllerGetOutputDictionaryResponse, Error>,
1359                fdomain_client::fidl::FDomainResourceDialect,
1360                0x3a0c4696620ad221,
1361            >(_buf?)?
1362            .into_result_fdomain::<ControllerMarker>("get_output_dictionary")?;
1363            Ok(_response.map(|x| x.dictionary))
1364        }
1365        self.client.send_query_and_decode::<
1366            fidl::encoding::EmptyPayload,
1367            ControllerGetOutputDictionaryResult,
1368        >(
1369            (),
1370            0x3a0c4696620ad221,
1371            fidl::encoding::DynamicFlags::FLEXIBLE,
1372            _decode,
1373        )
1374    }
1375
1376    type DestroyResponseFut = fidl::client::QueryResponseFut<
1377        ControllerDestroyResult,
1378        fdomain_client::fidl::FDomainResourceDialect,
1379    >;
1380    fn r#destroy(&self) -> Self::DestroyResponseFut {
1381        fn _decode(
1382            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1383        ) -> Result<ControllerDestroyResult, fidl::Error> {
1384            let _response = fidl::client::decode_transaction_body::<
1385                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1386                fdomain_client::fidl::FDomainResourceDialect,
1387                0x74529fa68b5c1741,
1388            >(_buf?)?
1389            .into_result_fdomain::<ControllerMarker>("destroy")?;
1390            Ok(_response.map(|x| x))
1391        }
1392        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerDestroyResult>(
1393            (),
1394            0x74529fa68b5c1741,
1395            fidl::encoding::DynamicFlags::FLEXIBLE,
1396            _decode,
1397        )
1398    }
1399}
1400
1401pub struct ControllerEventStream {
1402    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1403}
1404
1405impl std::marker::Unpin for ControllerEventStream {}
1406
1407impl futures::stream::FusedStream for ControllerEventStream {
1408    fn is_terminated(&self) -> bool {
1409        self.event_receiver.is_terminated()
1410    }
1411}
1412
1413impl futures::Stream for ControllerEventStream {
1414    type Item = Result<ControllerEvent, fidl::Error>;
1415
1416    fn poll_next(
1417        mut self: std::pin::Pin<&mut Self>,
1418        cx: &mut std::task::Context<'_>,
1419    ) -> std::task::Poll<Option<Self::Item>> {
1420        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1421            &mut self.event_receiver,
1422            cx
1423        )?) {
1424            Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1425            None => std::task::Poll::Ready(None),
1426        }
1427    }
1428}
1429
1430#[derive(Debug)]
1431pub enum ControllerEvent {
1432    #[non_exhaustive]
1433    _UnknownEvent {
1434        /// Ordinal of the event that was sent.
1435        ordinal: u64,
1436    },
1437}
1438
1439impl ControllerEvent {
1440    /// Decodes a message buffer as a [`ControllerEvent`].
1441    fn decode(
1442        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1443    ) -> Result<ControllerEvent, fidl::Error> {
1444        let (bytes, _handles) = buf.split_mut();
1445        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1446        debug_assert_eq!(tx_header.tx_id, 0);
1447        match tx_header.ordinal {
1448            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1449                Ok(ControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1450            }
1451            _ => Err(fidl::Error::UnknownOrdinal {
1452                ordinal: tx_header.ordinal,
1453                protocol_name:
1454                    <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1455            }),
1456        }
1457    }
1458}
1459
1460/// A Stream of incoming requests for fuchsia.component/Controller.
1461pub struct ControllerRequestStream {
1462    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1463    is_terminated: bool,
1464}
1465
1466impl std::marker::Unpin for ControllerRequestStream {}
1467
1468impl futures::stream::FusedStream for ControllerRequestStream {
1469    fn is_terminated(&self) -> bool {
1470        self.is_terminated
1471    }
1472}
1473
1474impl fdomain_client::fidl::RequestStream for ControllerRequestStream {
1475    type Protocol = ControllerMarker;
1476    type ControlHandle = ControllerControlHandle;
1477
1478    fn from_channel(channel: fdomain_client::Channel) -> Self {
1479        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1480    }
1481
1482    fn control_handle(&self) -> Self::ControlHandle {
1483        ControllerControlHandle { inner: self.inner.clone() }
1484    }
1485
1486    fn into_inner(
1487        self,
1488    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1489    {
1490        (self.inner, self.is_terminated)
1491    }
1492
1493    fn from_inner(
1494        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1495        is_terminated: bool,
1496    ) -> Self {
1497        Self { inner, is_terminated }
1498    }
1499}
1500
1501impl futures::Stream for ControllerRequestStream {
1502    type Item = Result<ControllerRequest, fidl::Error>;
1503
1504    fn poll_next(
1505        mut self: std::pin::Pin<&mut Self>,
1506        cx: &mut std::task::Context<'_>,
1507    ) -> std::task::Poll<Option<Self::Item>> {
1508        let this = &mut *self;
1509        if this.inner.check_shutdown(cx) {
1510            this.is_terminated = true;
1511            return std::task::Poll::Ready(None);
1512        }
1513        if this.is_terminated {
1514            panic!("polled ControllerRequestStream after completion");
1515        }
1516        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1517            |bytes, handles| {
1518                match this.inner.channel().read_etc(cx, bytes, handles) {
1519                    std::task::Poll::Ready(Ok(())) => {}
1520                    std::task::Poll::Pending => return std::task::Poll::Pending,
1521                    std::task::Poll::Ready(Err(None)) => {
1522                        this.is_terminated = true;
1523                        return std::task::Poll::Ready(None);
1524                    }
1525                    std::task::Poll::Ready(Err(Some(e))) => {
1526                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1527                            e.into(),
1528                        ))));
1529                    }
1530                }
1531
1532                // A message has been received from the channel
1533                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1534
1535                std::task::Poll::Ready(Some(match header.ordinal {
1536                    0x68878076b8d2eac5 => {
1537                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1538                        let mut req = fidl::new_empty!(
1539                            ControllerStartRequest,
1540                            fdomain_client::fidl::FDomainResourceDialect
1541                        );
1542                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1543                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1544                        Ok(ControllerRequest::Start {
1545                            args: req.args,
1546                            execution_controller: req.execution_controller,
1547
1548                            responder: ControllerStartResponder {
1549                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1550                                tx_id: header.tx_id,
1551                            },
1552                        })
1553                    }
1554                    0x2155e6e1db2083c3 => {
1555                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1556                        let mut req = fidl::new_empty!(
1557                            fidl::encoding::EmptyPayload,
1558                            fdomain_client::fidl::FDomainResourceDialect
1559                        );
1560                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1561                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1562                        Ok(ControllerRequest::IsStarted {
1563                            responder: ControllerIsStartedResponder {
1564                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1565                                tx_id: header.tx_id,
1566                            },
1567                        })
1568                    }
1569                    0x253cabb9a840ed94 => {
1570                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1571                        let mut req = fidl::new_empty!(
1572                            ControllerOpenExposedDirRequest,
1573                            fdomain_client::fidl::FDomainResourceDialect
1574                        );
1575                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
1576                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1577                        Ok(ControllerRequest::OpenExposedDir {
1578                            exposed_dir: req.exposed_dir,
1579
1580                            responder: ControllerOpenExposedDirResponder {
1581                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1582                                tx_id: header.tx_id,
1583                            },
1584                        })
1585                    }
1586                    0x7e48373e5eda1f9b => {
1587                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1588                        let mut req = fidl::new_empty!(
1589                            fidl::encoding::EmptyPayload,
1590                            fdomain_client::fidl::FDomainResourceDialect
1591                        );
1592                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1593                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1594                        Ok(ControllerRequest::GetExposedDictionary {
1595                            responder: ControllerGetExposedDictionaryResponder {
1596                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1597                                tx_id: header.tx_id,
1598                            },
1599                        })
1600                    }
1601                    0x3a0c4696620ad221 => {
1602                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1603                        let mut req = fidl::new_empty!(
1604                            fidl::encoding::EmptyPayload,
1605                            fdomain_client::fidl::FDomainResourceDialect
1606                        );
1607                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1608                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1609                        Ok(ControllerRequest::GetOutputDictionary {
1610                            responder: ControllerGetOutputDictionaryResponder {
1611                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1612                                tx_id: header.tx_id,
1613                            },
1614                        })
1615                    }
1616                    0x74529fa68b5c1741 => {
1617                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1618                        let mut req = fidl::new_empty!(
1619                            fidl::encoding::EmptyPayload,
1620                            fdomain_client::fidl::FDomainResourceDialect
1621                        );
1622                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1623                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1624                        Ok(ControllerRequest::Destroy {
1625                            responder: ControllerDestroyResponder {
1626                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1627                                tx_id: header.tx_id,
1628                            },
1629                        })
1630                    }
1631                    _ if header.tx_id == 0
1632                        && header
1633                            .dynamic_flags()
1634                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1635                    {
1636                        Ok(ControllerRequest::_UnknownMethod {
1637                            ordinal: header.ordinal,
1638                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
1639                            method_type: fidl::MethodType::OneWay,
1640                        })
1641                    }
1642                    _ if header
1643                        .dynamic_flags()
1644                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1645                    {
1646                        this.inner.send_framework_err(
1647                            fidl::encoding::FrameworkErr::UnknownMethod,
1648                            header.tx_id,
1649                            header.ordinal,
1650                            header.dynamic_flags(),
1651                            (bytes, handles),
1652                        )?;
1653                        Ok(ControllerRequest::_UnknownMethod {
1654                            ordinal: header.ordinal,
1655                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
1656                            method_type: fidl::MethodType::TwoWay,
1657                        })
1658                    }
1659                    _ => Err(fidl::Error::UnknownOrdinal {
1660                        ordinal: header.ordinal,
1661                        protocol_name:
1662                            <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1663                    }),
1664                }))
1665            },
1666        )
1667    }
1668}
1669
1670/// A protocol used to operate on a component.
1671///
1672/// One may get access to a `Controller` when creating a component with the
1673/// `Realm.CreateChild` method. You may also obtain a `Controller` for an
1674/// existing child component with the `Realm.OpenController` method.
1675#[derive(Debug)]
1676pub enum ControllerRequest {
1677    /// Start the component, optionally providing additional handles to be given
1678    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1679    /// currently running.
1680    Start {
1681        args: StartChildArgs,
1682        execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1683        responder: ControllerStartResponder,
1684    },
1685    /// Returns true if this instance is currently running.
1686    IsStarted { responder: ControllerIsStartedResponder },
1687    /// Opens the exposed directory of the controlled component, through which
1688    /// capabilities the component exposed via `ComponentDecl.exposes` are
1689    /// available, on success.
1690    ///
1691    /// Binding to the exposed directory requires that the component be
1692    /// resolved, but it will not be started until/unless some capability is
1693    /// requested that requires it to be.
1694    ///
1695    /// If this component is destroyed, any outstanding connections to
1696    /// `exposed_dir` will be closed.
1697    ///
1698    /// Errors:
1699    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
1700    OpenExposedDir {
1701        exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
1702        responder: ControllerOpenExposedDirResponder,
1703    },
1704    /// Returns the dictionary containing the component's exposed capabilities.
1705    GetExposedDictionary { responder: ControllerGetExposedDictionaryResponder },
1706    /// Returns a reference to the component's output dictionary, which may be
1707    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
1708    GetOutputDictionary { responder: ControllerGetOutputDictionaryResponder },
1709    /// Destroys this component. When this method returns, the component is
1710    /// either destroyed or in the case of an error no destruction happened.
1711    ///
1712    /// Errors:
1713    ///
1714    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1715    /// Currently, this can happen if the component is a static child of its
1716    /// parent.
1717    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
1718    ///   manager's logs will contain more detail.
1719    Destroy { responder: ControllerDestroyResponder },
1720    /// An interaction was received which does not match any known method.
1721    #[non_exhaustive]
1722    _UnknownMethod {
1723        /// Ordinal of the method that was called.
1724        ordinal: u64,
1725        control_handle: ControllerControlHandle,
1726        method_type: fidl::MethodType,
1727    },
1728}
1729
1730impl ControllerRequest {
1731    #[allow(irrefutable_let_patterns)]
1732    pub fn into_start(
1733        self,
1734    ) -> Option<(
1735        StartChildArgs,
1736        fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1737        ControllerStartResponder,
1738    )> {
1739        if let ControllerRequest::Start { args, execution_controller, responder } = self {
1740            Some((args, execution_controller, responder))
1741        } else {
1742            None
1743        }
1744    }
1745
1746    #[allow(irrefutable_let_patterns)]
1747    pub fn into_is_started(self) -> Option<(ControllerIsStartedResponder)> {
1748        if let ControllerRequest::IsStarted { responder } = self { Some((responder)) } else { None }
1749    }
1750
1751    #[allow(irrefutable_let_patterns)]
1752    pub fn into_open_exposed_dir(
1753        self,
1754    ) -> Option<(
1755        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
1756        ControllerOpenExposedDirResponder,
1757    )> {
1758        if let ControllerRequest::OpenExposedDir { exposed_dir, responder } = self {
1759            Some((exposed_dir, responder))
1760        } else {
1761            None
1762        }
1763    }
1764
1765    #[allow(irrefutable_let_patterns)]
1766    pub fn into_get_exposed_dictionary(self) -> Option<(ControllerGetExposedDictionaryResponder)> {
1767        if let ControllerRequest::GetExposedDictionary { responder } = self {
1768            Some((responder))
1769        } else {
1770            None
1771        }
1772    }
1773
1774    #[allow(irrefutable_let_patterns)]
1775    pub fn into_get_output_dictionary(self) -> Option<(ControllerGetOutputDictionaryResponder)> {
1776        if let ControllerRequest::GetOutputDictionary { responder } = self {
1777            Some((responder))
1778        } else {
1779            None
1780        }
1781    }
1782
1783    #[allow(irrefutable_let_patterns)]
1784    pub fn into_destroy(self) -> Option<(ControllerDestroyResponder)> {
1785        if let ControllerRequest::Destroy { responder } = self { Some((responder)) } else { None }
1786    }
1787
1788    /// Name of the method defined in FIDL
1789    pub fn method_name(&self) -> &'static str {
1790        match *self {
1791            ControllerRequest::Start { .. } => "start",
1792            ControllerRequest::IsStarted { .. } => "is_started",
1793            ControllerRequest::OpenExposedDir { .. } => "open_exposed_dir",
1794            ControllerRequest::GetExposedDictionary { .. } => "get_exposed_dictionary",
1795            ControllerRequest::GetOutputDictionary { .. } => "get_output_dictionary",
1796            ControllerRequest::Destroy { .. } => "destroy",
1797            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1798                "unknown one-way method"
1799            }
1800            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1801                "unknown two-way method"
1802            }
1803        }
1804    }
1805}
1806
1807#[derive(Debug, Clone)]
1808pub struct ControllerControlHandle {
1809    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1810}
1811
1812impl fdomain_client::fidl::ControlHandle for ControllerControlHandle {
1813    fn shutdown(&self) {
1814        self.inner.shutdown()
1815    }
1816
1817    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1818        self.inner.shutdown_with_epitaph(status)
1819    }
1820
1821    fn is_closed(&self) -> bool {
1822        self.inner.channel().is_closed()
1823    }
1824    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1825        self.inner.channel().on_closed()
1826    }
1827}
1828
1829impl ControllerControlHandle {}
1830
1831#[must_use = "FIDL methods require a response to be sent"]
1832#[derive(Debug)]
1833pub struct ControllerStartResponder {
1834    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1835    tx_id: u32,
1836}
1837
1838/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1839/// if the responder is dropped without sending a response, so that the client
1840/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1841impl std::ops::Drop for ControllerStartResponder {
1842    fn drop(&mut self) {
1843        self.control_handle.shutdown();
1844        // Safety: drops once, never accessed again
1845        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1846    }
1847}
1848
1849impl fdomain_client::fidl::Responder for ControllerStartResponder {
1850    type ControlHandle = ControllerControlHandle;
1851
1852    fn control_handle(&self) -> &ControllerControlHandle {
1853        &self.control_handle
1854    }
1855
1856    fn drop_without_shutdown(mut self) {
1857        // Safety: drops once, never accessed again due to mem::forget
1858        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1859        // Prevent Drop from running (which would shut down the channel)
1860        std::mem::forget(self);
1861    }
1862}
1863
1864impl ControllerStartResponder {
1865    /// Sends a response to the FIDL transaction.
1866    ///
1867    /// Sets the channel to shutdown if an error occurs.
1868    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1869        let _result = self.send_raw(result);
1870        if _result.is_err() {
1871            self.control_handle.shutdown();
1872        }
1873        self.drop_without_shutdown();
1874        _result
1875    }
1876
1877    /// Similar to "send" but does not shutdown the channel if an error occurs.
1878    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1879        let _result = self.send_raw(result);
1880        self.drop_without_shutdown();
1881        _result
1882    }
1883
1884    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1885        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1886            fidl::encoding::EmptyStruct,
1887            Error,
1888        >>(
1889            fidl::encoding::FlexibleResult::new(result),
1890            self.tx_id,
1891            0x68878076b8d2eac5,
1892            fidl::encoding::DynamicFlags::FLEXIBLE,
1893        )
1894    }
1895}
1896
1897#[must_use = "FIDL methods require a response to be sent"]
1898#[derive(Debug)]
1899pub struct ControllerIsStartedResponder {
1900    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1901    tx_id: u32,
1902}
1903
1904/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1905/// if the responder is dropped without sending a response, so that the client
1906/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1907impl std::ops::Drop for ControllerIsStartedResponder {
1908    fn drop(&mut self) {
1909        self.control_handle.shutdown();
1910        // Safety: drops once, never accessed again
1911        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1912    }
1913}
1914
1915impl fdomain_client::fidl::Responder for ControllerIsStartedResponder {
1916    type ControlHandle = ControllerControlHandle;
1917
1918    fn control_handle(&self) -> &ControllerControlHandle {
1919        &self.control_handle
1920    }
1921
1922    fn drop_without_shutdown(mut self) {
1923        // Safety: drops once, never accessed again due to mem::forget
1924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1925        // Prevent Drop from running (which would shut down the channel)
1926        std::mem::forget(self);
1927    }
1928}
1929
1930impl ControllerIsStartedResponder {
1931    /// Sends a response to the FIDL transaction.
1932    ///
1933    /// Sets the channel to shutdown if an error occurs.
1934    pub fn send(self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1935        let _result = self.send_raw(result);
1936        if _result.is_err() {
1937            self.control_handle.shutdown();
1938        }
1939        self.drop_without_shutdown();
1940        _result
1941    }
1942
1943    /// Similar to "send" but does not shutdown the channel if an error occurs.
1944    pub fn send_no_shutdown_on_err(
1945        self,
1946        mut result: Result<bool, Error>,
1947    ) -> Result<(), fidl::Error> {
1948        let _result = self.send_raw(result);
1949        self.drop_without_shutdown();
1950        _result
1951    }
1952
1953    fn send_raw(&self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1954        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1955            ControllerIsStartedResponse,
1956            Error,
1957        >>(
1958            fidl::encoding::FlexibleResult::new(result.map(|is_started| (is_started,))),
1959            self.tx_id,
1960            0x2155e6e1db2083c3,
1961            fidl::encoding::DynamicFlags::FLEXIBLE,
1962        )
1963    }
1964}
1965
1966#[must_use = "FIDL methods require a response to be sent"]
1967#[derive(Debug)]
1968pub struct ControllerOpenExposedDirResponder {
1969    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1970    tx_id: u32,
1971}
1972
1973/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1974/// if the responder is dropped without sending a response, so that the client
1975/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1976impl std::ops::Drop for ControllerOpenExposedDirResponder {
1977    fn drop(&mut self) {
1978        self.control_handle.shutdown();
1979        // Safety: drops once, never accessed again
1980        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1981    }
1982}
1983
1984impl fdomain_client::fidl::Responder for ControllerOpenExposedDirResponder {
1985    type ControlHandle = ControllerControlHandle;
1986
1987    fn control_handle(&self) -> &ControllerControlHandle {
1988        &self.control_handle
1989    }
1990
1991    fn drop_without_shutdown(mut self) {
1992        // Safety: drops once, never accessed again due to mem::forget
1993        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1994        // Prevent Drop from running (which would shut down the channel)
1995        std::mem::forget(self);
1996    }
1997}
1998
1999impl ControllerOpenExposedDirResponder {
2000    /// Sends a response to the FIDL transaction.
2001    ///
2002    /// Sets the channel to shutdown if an error occurs.
2003    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2004        let _result = self.send_raw(result);
2005        if _result.is_err() {
2006            self.control_handle.shutdown();
2007        }
2008        self.drop_without_shutdown();
2009        _result
2010    }
2011
2012    /// Similar to "send" but does not shutdown the channel if an error occurs.
2013    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2014        let _result = self.send_raw(result);
2015        self.drop_without_shutdown();
2016        _result
2017    }
2018
2019    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2020        self.control_handle
2021            .inner
2022            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2023                result,
2024                self.tx_id,
2025                0x253cabb9a840ed94,
2026                fidl::encoding::DynamicFlags::empty(),
2027            )
2028    }
2029}
2030
2031#[must_use = "FIDL methods require a response to be sent"]
2032#[derive(Debug)]
2033pub struct ControllerGetExposedDictionaryResponder {
2034    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2035    tx_id: u32,
2036}
2037
2038/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2039/// if the responder is dropped without sending a response, so that the client
2040/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2041impl std::ops::Drop for ControllerGetExposedDictionaryResponder {
2042    fn drop(&mut self) {
2043        self.control_handle.shutdown();
2044        // Safety: drops once, never accessed again
2045        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2046    }
2047}
2048
2049impl fdomain_client::fidl::Responder for ControllerGetExposedDictionaryResponder {
2050    type ControlHandle = ControllerControlHandle;
2051
2052    fn control_handle(&self) -> &ControllerControlHandle {
2053        &self.control_handle
2054    }
2055
2056    fn drop_without_shutdown(mut self) {
2057        // Safety: drops once, never accessed again due to mem::forget
2058        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2059        // Prevent Drop from running (which would shut down the channel)
2060        std::mem::forget(self);
2061    }
2062}
2063
2064impl ControllerGetExposedDictionaryResponder {
2065    /// Sends a response to the FIDL transaction.
2066    ///
2067    /// Sets the channel to shutdown if an error occurs.
2068    pub fn send(
2069        self,
2070        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
2071    ) -> Result<(), fidl::Error> {
2072        let _result = self.send_raw(result);
2073        if _result.is_err() {
2074            self.control_handle.shutdown();
2075        }
2076        self.drop_without_shutdown();
2077        _result
2078    }
2079
2080    /// Similar to "send" but does not shutdown the channel if an error occurs.
2081    pub fn send_no_shutdown_on_err(
2082        self,
2083        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
2084    ) -> Result<(), fidl::Error> {
2085        let _result = self.send_raw(result);
2086        self.drop_without_shutdown();
2087        _result
2088    }
2089
2090    fn send_raw(
2091        &self,
2092        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
2093    ) -> Result<(), fidl::Error> {
2094        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2095            ControllerGetExposedDictionaryResponse,
2096            Error,
2097        >>(
2098            fidl::encoding::FlexibleResult::new(
2099                result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
2100            ),
2101            self.tx_id,
2102            0x7e48373e5eda1f9b,
2103            fidl::encoding::DynamicFlags::FLEXIBLE,
2104        )
2105    }
2106}
2107
2108#[must_use = "FIDL methods require a response to be sent"]
2109#[derive(Debug)]
2110pub struct ControllerGetOutputDictionaryResponder {
2111    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2112    tx_id: u32,
2113}
2114
2115/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2116/// if the responder is dropped without sending a response, so that the client
2117/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2118impl std::ops::Drop for ControllerGetOutputDictionaryResponder {
2119    fn drop(&mut self) {
2120        self.control_handle.shutdown();
2121        // Safety: drops once, never accessed again
2122        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2123    }
2124}
2125
2126impl fdomain_client::fidl::Responder for ControllerGetOutputDictionaryResponder {
2127    type ControlHandle = ControllerControlHandle;
2128
2129    fn control_handle(&self) -> &ControllerControlHandle {
2130        &self.control_handle
2131    }
2132
2133    fn drop_without_shutdown(mut self) {
2134        // Safety: drops once, never accessed again due to mem::forget
2135        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2136        // Prevent Drop from running (which would shut down the channel)
2137        std::mem::forget(self);
2138    }
2139}
2140
2141impl ControllerGetOutputDictionaryResponder {
2142    /// Sends a response to the FIDL transaction.
2143    ///
2144    /// Sets the channel to shutdown if an error occurs.
2145    pub fn send(
2146        self,
2147        mut result: Result<fdomain_client::EventPair, Error>,
2148    ) -> Result<(), fidl::Error> {
2149        let _result = self.send_raw(result);
2150        if _result.is_err() {
2151            self.control_handle.shutdown();
2152        }
2153        self.drop_without_shutdown();
2154        _result
2155    }
2156
2157    /// Similar to "send" but does not shutdown the channel if an error occurs.
2158    pub fn send_no_shutdown_on_err(
2159        self,
2160        mut result: Result<fdomain_client::EventPair, Error>,
2161    ) -> Result<(), fidl::Error> {
2162        let _result = self.send_raw(result);
2163        self.drop_without_shutdown();
2164        _result
2165    }
2166
2167    fn send_raw(
2168        &self,
2169        mut result: Result<fdomain_client::EventPair, Error>,
2170    ) -> Result<(), fidl::Error> {
2171        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2172            ControllerGetOutputDictionaryResponse,
2173            Error,
2174        >>(
2175            fidl::encoding::FlexibleResult::new(result.map(|dictionary| (dictionary,))),
2176            self.tx_id,
2177            0x3a0c4696620ad221,
2178            fidl::encoding::DynamicFlags::FLEXIBLE,
2179        )
2180    }
2181}
2182
2183#[must_use = "FIDL methods require a response to be sent"]
2184#[derive(Debug)]
2185pub struct ControllerDestroyResponder {
2186    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2187    tx_id: u32,
2188}
2189
2190/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2191/// if the responder is dropped without sending a response, so that the client
2192/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2193impl std::ops::Drop for ControllerDestroyResponder {
2194    fn drop(&mut self) {
2195        self.control_handle.shutdown();
2196        // Safety: drops once, never accessed again
2197        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2198    }
2199}
2200
2201impl fdomain_client::fidl::Responder for ControllerDestroyResponder {
2202    type ControlHandle = ControllerControlHandle;
2203
2204    fn control_handle(&self) -> &ControllerControlHandle {
2205        &self.control_handle
2206    }
2207
2208    fn drop_without_shutdown(mut self) {
2209        // Safety: drops once, never accessed again due to mem::forget
2210        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2211        // Prevent Drop from running (which would shut down the channel)
2212        std::mem::forget(self);
2213    }
2214}
2215
2216impl ControllerDestroyResponder {
2217    /// Sends a response to the FIDL transaction.
2218    ///
2219    /// Sets the channel to shutdown if an error occurs.
2220    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2221        let _result = self.send_raw(result);
2222        if _result.is_err() {
2223            self.control_handle.shutdown();
2224        }
2225        self.drop_without_shutdown();
2226        _result
2227    }
2228
2229    /// Similar to "send" but does not shutdown the channel if an error occurs.
2230    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2231        let _result = self.send_raw(result);
2232        self.drop_without_shutdown();
2233        _result
2234    }
2235
2236    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2237        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2238            fidl::encoding::EmptyStruct,
2239            Error,
2240        >>(
2241            fidl::encoding::FlexibleResult::new(result),
2242            self.tx_id,
2243            0x74529fa68b5c1741,
2244            fidl::encoding::DynamicFlags::FLEXIBLE,
2245        )
2246    }
2247}
2248
2249#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2250pub struct EventStreamMarker;
2251
2252impl fdomain_client::fidl::ProtocolMarker for EventStreamMarker {
2253    type Proxy = EventStreamProxy;
2254    type RequestStream = EventStreamRequestStream;
2255
2256    const DEBUG_NAME: &'static str = "fuchsia.component.EventStream";
2257}
2258impl fdomain_client::fidl::DiscoverableProtocolMarker for EventStreamMarker {}
2259
2260pub trait EventStreamProxyInterface: Send + Sync {
2261    type GetNextResponseFut: std::future::Future<Output = Result<Vec<Event>, fidl::Error>> + Send;
2262    fn r#get_next(&self) -> Self::GetNextResponseFut;
2263    type WaitForReadyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2264    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut;
2265}
2266
2267#[derive(Debug, Clone)]
2268pub struct EventStreamProxy {
2269    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2270}
2271
2272impl fdomain_client::fidl::Proxy for EventStreamProxy {
2273    type Protocol = EventStreamMarker;
2274
2275    fn from_channel(inner: fdomain_client::Channel) -> Self {
2276        Self::new(inner)
2277    }
2278
2279    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2280        self.client.into_channel().map_err(|client| Self { client })
2281    }
2282
2283    fn as_channel(&self) -> &fdomain_client::Channel {
2284        self.client.as_channel()
2285    }
2286}
2287
2288impl EventStreamProxy {
2289    /// Create a new Proxy for fuchsia.component/EventStream.
2290    pub fn new(channel: fdomain_client::Channel) -> Self {
2291        let protocol_name = <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2292        Self { client: fidl::client::Client::new(channel, protocol_name) }
2293    }
2294
2295    /// Get a Stream of events from the remote end of the protocol.
2296    ///
2297    /// # Panics
2298    ///
2299    /// Panics if the event stream was already taken.
2300    pub fn take_event_stream(&self) -> EventStreamEventStream {
2301        EventStreamEventStream { event_receiver: self.client.take_event_receiver() }
2302    }
2303
2304    pub fn r#get_next(
2305        &self,
2306    ) -> fidl::client::QueryResponseFut<Vec<Event>, fdomain_client::fidl::FDomainResourceDialect>
2307    {
2308        EventStreamProxyInterface::r#get_next(self)
2309    }
2310
2311    /// Returns immediately. Used to indicate that the FIDL connection
2312    /// completed. This is needed for non-static streams to verify
2313    /// that subscribe has completed before components are started.
2314    pub fn r#wait_for_ready(
2315        &self,
2316    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
2317        EventStreamProxyInterface::r#wait_for_ready(self)
2318    }
2319}
2320
2321impl EventStreamProxyInterface for EventStreamProxy {
2322    type GetNextResponseFut =
2323        fidl::client::QueryResponseFut<Vec<Event>, fdomain_client::fidl::FDomainResourceDialect>;
2324    fn r#get_next(&self) -> Self::GetNextResponseFut {
2325        fn _decode(
2326            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2327        ) -> Result<Vec<Event>, fidl::Error> {
2328            let _response = fidl::client::decode_transaction_body::<
2329                EventStreamGetNextResponse,
2330                fdomain_client::fidl::FDomainResourceDialect,
2331                0x3f24c9495978eb86,
2332            >(_buf?)?;
2333            Ok(_response.events)
2334        }
2335        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Event>>(
2336            (),
2337            0x3f24c9495978eb86,
2338            fidl::encoding::DynamicFlags::empty(),
2339            _decode,
2340        )
2341    }
2342
2343    type WaitForReadyResponseFut =
2344        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
2345    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut {
2346        fn _decode(
2347            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2348        ) -> Result<(), fidl::Error> {
2349            let _response = fidl::client::decode_transaction_body::<
2350                fidl::encoding::EmptyPayload,
2351                fdomain_client::fidl::FDomainResourceDialect,
2352                0x31331f9578d2e682,
2353            >(_buf?)?;
2354            Ok(_response)
2355        }
2356        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2357            (),
2358            0x31331f9578d2e682,
2359            fidl::encoding::DynamicFlags::empty(),
2360            _decode,
2361        )
2362    }
2363}
2364
2365pub struct EventStreamEventStream {
2366    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2367}
2368
2369impl std::marker::Unpin for EventStreamEventStream {}
2370
2371impl futures::stream::FusedStream for EventStreamEventStream {
2372    fn is_terminated(&self) -> bool {
2373        self.event_receiver.is_terminated()
2374    }
2375}
2376
2377impl futures::Stream for EventStreamEventStream {
2378    type Item = Result<EventStreamEvent, fidl::Error>;
2379
2380    fn poll_next(
2381        mut self: std::pin::Pin<&mut Self>,
2382        cx: &mut std::task::Context<'_>,
2383    ) -> std::task::Poll<Option<Self::Item>> {
2384        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2385            &mut self.event_receiver,
2386            cx
2387        )?) {
2388            Some(buf) => std::task::Poll::Ready(Some(EventStreamEvent::decode(buf))),
2389            None => std::task::Poll::Ready(None),
2390        }
2391    }
2392}
2393
2394#[derive(Debug)]
2395pub enum EventStreamEvent {}
2396
2397impl EventStreamEvent {
2398    /// Decodes a message buffer as a [`EventStreamEvent`].
2399    fn decode(
2400        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2401    ) -> Result<EventStreamEvent, fidl::Error> {
2402        let (bytes, _handles) = buf.split_mut();
2403        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2404        debug_assert_eq!(tx_header.tx_id, 0);
2405        match tx_header.ordinal {
2406            _ => Err(fidl::Error::UnknownOrdinal {
2407                ordinal: tx_header.ordinal,
2408                protocol_name:
2409                    <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2410            }),
2411        }
2412    }
2413}
2414
2415/// A Stream of incoming requests for fuchsia.component/EventStream.
2416pub struct EventStreamRequestStream {
2417    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2418    is_terminated: bool,
2419}
2420
2421impl std::marker::Unpin for EventStreamRequestStream {}
2422
2423impl futures::stream::FusedStream for EventStreamRequestStream {
2424    fn is_terminated(&self) -> bool {
2425        self.is_terminated
2426    }
2427}
2428
2429impl fdomain_client::fidl::RequestStream for EventStreamRequestStream {
2430    type Protocol = EventStreamMarker;
2431    type ControlHandle = EventStreamControlHandle;
2432
2433    fn from_channel(channel: fdomain_client::Channel) -> Self {
2434        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2435    }
2436
2437    fn control_handle(&self) -> Self::ControlHandle {
2438        EventStreamControlHandle { inner: self.inner.clone() }
2439    }
2440
2441    fn into_inner(
2442        self,
2443    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2444    {
2445        (self.inner, self.is_terminated)
2446    }
2447
2448    fn from_inner(
2449        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2450        is_terminated: bool,
2451    ) -> Self {
2452        Self { inner, is_terminated }
2453    }
2454}
2455
2456impl futures::Stream for EventStreamRequestStream {
2457    type Item = Result<EventStreamRequest, fidl::Error>;
2458
2459    fn poll_next(
2460        mut self: std::pin::Pin<&mut Self>,
2461        cx: &mut std::task::Context<'_>,
2462    ) -> std::task::Poll<Option<Self::Item>> {
2463        let this = &mut *self;
2464        if this.inner.check_shutdown(cx) {
2465            this.is_terminated = true;
2466            return std::task::Poll::Ready(None);
2467        }
2468        if this.is_terminated {
2469            panic!("polled EventStreamRequestStream after completion");
2470        }
2471        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2472            |bytes, handles| {
2473                match this.inner.channel().read_etc(cx, bytes, handles) {
2474                    std::task::Poll::Ready(Ok(())) => {}
2475                    std::task::Poll::Pending => return std::task::Poll::Pending,
2476                    std::task::Poll::Ready(Err(None)) => {
2477                        this.is_terminated = true;
2478                        return std::task::Poll::Ready(None);
2479                    }
2480                    std::task::Poll::Ready(Err(Some(e))) => {
2481                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2482                            e.into(),
2483                        ))));
2484                    }
2485                }
2486
2487                // A message has been received from the channel
2488                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2489
2490                std::task::Poll::Ready(Some(match header.ordinal {
2491                    0x3f24c9495978eb86 => {
2492                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2493                        let mut req = fidl::new_empty!(
2494                            fidl::encoding::EmptyPayload,
2495                            fdomain_client::fidl::FDomainResourceDialect
2496                        );
2497                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2498                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2499                        Ok(EventStreamRequest::GetNext {
2500                            responder: EventStreamGetNextResponder {
2501                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2502                                tx_id: header.tx_id,
2503                            },
2504                        })
2505                    }
2506                    0x31331f9578d2e682 => {
2507                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2508                        let mut req = fidl::new_empty!(
2509                            fidl::encoding::EmptyPayload,
2510                            fdomain_client::fidl::FDomainResourceDialect
2511                        );
2512                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2513                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2514                        Ok(EventStreamRequest::WaitForReady {
2515                            responder: EventStreamWaitForReadyResponder {
2516                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2517                                tx_id: header.tx_id,
2518                            },
2519                        })
2520                    }
2521                    _ => Err(fidl::Error::UnknownOrdinal {
2522                        ordinal: header.ordinal,
2523                        protocol_name:
2524                            <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2525                    }),
2526                }))
2527            },
2528        )
2529    }
2530}
2531
2532/// Listener for events on the component hierarchy.
2533/// Can't be used outside of the platform.
2534#[derive(Debug)]
2535pub enum EventStreamRequest {
2536    GetNext {
2537        responder: EventStreamGetNextResponder,
2538    },
2539    /// Returns immediately. Used to indicate that the FIDL connection
2540    /// completed. This is needed for non-static streams to verify
2541    /// that subscribe has completed before components are started.
2542    WaitForReady {
2543        responder: EventStreamWaitForReadyResponder,
2544    },
2545}
2546
2547impl EventStreamRequest {
2548    #[allow(irrefutable_let_patterns)]
2549    pub fn into_get_next(self) -> Option<(EventStreamGetNextResponder)> {
2550        if let EventStreamRequest::GetNext { responder } = self { Some((responder)) } else { None }
2551    }
2552
2553    #[allow(irrefutable_let_patterns)]
2554    pub fn into_wait_for_ready(self) -> Option<(EventStreamWaitForReadyResponder)> {
2555        if let EventStreamRequest::WaitForReady { responder } = self {
2556            Some((responder))
2557        } else {
2558            None
2559        }
2560    }
2561
2562    /// Name of the method defined in FIDL
2563    pub fn method_name(&self) -> &'static str {
2564        match *self {
2565            EventStreamRequest::GetNext { .. } => "get_next",
2566            EventStreamRequest::WaitForReady { .. } => "wait_for_ready",
2567        }
2568    }
2569}
2570
2571#[derive(Debug, Clone)]
2572pub struct EventStreamControlHandle {
2573    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2574}
2575
2576impl fdomain_client::fidl::ControlHandle for EventStreamControlHandle {
2577    fn shutdown(&self) {
2578        self.inner.shutdown()
2579    }
2580
2581    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2582        self.inner.shutdown_with_epitaph(status)
2583    }
2584
2585    fn is_closed(&self) -> bool {
2586        self.inner.channel().is_closed()
2587    }
2588    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2589        self.inner.channel().on_closed()
2590    }
2591}
2592
2593impl EventStreamControlHandle {}
2594
2595#[must_use = "FIDL methods require a response to be sent"]
2596#[derive(Debug)]
2597pub struct EventStreamGetNextResponder {
2598    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2599    tx_id: u32,
2600}
2601
2602/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
2603/// if the responder is dropped without sending a response, so that the client
2604/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2605impl std::ops::Drop for EventStreamGetNextResponder {
2606    fn drop(&mut self) {
2607        self.control_handle.shutdown();
2608        // Safety: drops once, never accessed again
2609        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2610    }
2611}
2612
2613impl fdomain_client::fidl::Responder for EventStreamGetNextResponder {
2614    type ControlHandle = EventStreamControlHandle;
2615
2616    fn control_handle(&self) -> &EventStreamControlHandle {
2617        &self.control_handle
2618    }
2619
2620    fn drop_without_shutdown(mut self) {
2621        // Safety: drops once, never accessed again due to mem::forget
2622        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2623        // Prevent Drop from running (which would shut down the channel)
2624        std::mem::forget(self);
2625    }
2626}
2627
2628impl EventStreamGetNextResponder {
2629    /// Sends a response to the FIDL transaction.
2630    ///
2631    /// Sets the channel to shutdown if an error occurs.
2632    pub fn send(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2633        let _result = self.send_raw(events);
2634        if _result.is_err() {
2635            self.control_handle.shutdown();
2636        }
2637        self.drop_without_shutdown();
2638        _result
2639    }
2640
2641    /// Similar to "send" but does not shutdown the channel if an error occurs.
2642    pub fn send_no_shutdown_on_err(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2643        let _result = self.send_raw(events);
2644        self.drop_without_shutdown();
2645        _result
2646    }
2647
2648    fn send_raw(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2649        self.control_handle.inner.send::<EventStreamGetNextResponse>(
2650            (events.as_mut(),),
2651            self.tx_id,
2652            0x3f24c9495978eb86,
2653            fidl::encoding::DynamicFlags::empty(),
2654        )
2655    }
2656}
2657
2658#[must_use = "FIDL methods require a response to be sent"]
2659#[derive(Debug)]
2660pub struct EventStreamWaitForReadyResponder {
2661    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2662    tx_id: u32,
2663}
2664
2665/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
2666/// if the responder is dropped without sending a response, so that the client
2667/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2668impl std::ops::Drop for EventStreamWaitForReadyResponder {
2669    fn drop(&mut self) {
2670        self.control_handle.shutdown();
2671        // Safety: drops once, never accessed again
2672        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2673    }
2674}
2675
2676impl fdomain_client::fidl::Responder for EventStreamWaitForReadyResponder {
2677    type ControlHandle = EventStreamControlHandle;
2678
2679    fn control_handle(&self) -> &EventStreamControlHandle {
2680        &self.control_handle
2681    }
2682
2683    fn drop_without_shutdown(mut self) {
2684        // Safety: drops once, never accessed again due to mem::forget
2685        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2686        // Prevent Drop from running (which would shut down the channel)
2687        std::mem::forget(self);
2688    }
2689}
2690
2691impl EventStreamWaitForReadyResponder {
2692    /// Sends a response to the FIDL transaction.
2693    ///
2694    /// Sets the channel to shutdown if an error occurs.
2695    pub fn send(self) -> Result<(), fidl::Error> {
2696        let _result = self.send_raw();
2697        if _result.is_err() {
2698            self.control_handle.shutdown();
2699        }
2700        self.drop_without_shutdown();
2701        _result
2702    }
2703
2704    /// Similar to "send" but does not shutdown the channel if an error occurs.
2705    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2706        let _result = self.send_raw();
2707        self.drop_without_shutdown();
2708        _result
2709    }
2710
2711    fn send_raw(&self) -> Result<(), fidl::Error> {
2712        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2713            (),
2714            self.tx_id,
2715            0x31331f9578d2e682,
2716            fidl::encoding::DynamicFlags::empty(),
2717        )
2718    }
2719}
2720
2721#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2722pub struct ExecutionControllerMarker;
2723
2724impl fdomain_client::fidl::ProtocolMarker for ExecutionControllerMarker {
2725    type Proxy = ExecutionControllerProxy;
2726    type RequestStream = ExecutionControllerRequestStream;
2727
2728    const DEBUG_NAME: &'static str = "(anonymous) ExecutionController";
2729}
2730
2731pub trait ExecutionControllerProxyInterface: Send + Sync {
2732    fn r#stop(&self) -> Result<(), fidl::Error>;
2733}
2734
2735#[derive(Debug, Clone)]
2736pub struct ExecutionControllerProxy {
2737    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2738}
2739
2740impl fdomain_client::fidl::Proxy for ExecutionControllerProxy {
2741    type Protocol = ExecutionControllerMarker;
2742
2743    fn from_channel(inner: fdomain_client::Channel) -> Self {
2744        Self::new(inner)
2745    }
2746
2747    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2748        self.client.into_channel().map_err(|client| Self { client })
2749    }
2750
2751    fn as_channel(&self) -> &fdomain_client::Channel {
2752        self.client.as_channel()
2753    }
2754}
2755
2756impl ExecutionControllerProxy {
2757    /// Create a new Proxy for fuchsia.component/ExecutionController.
2758    pub fn new(channel: fdomain_client::Channel) -> Self {
2759        let protocol_name =
2760            <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2761        Self { client: fidl::client::Client::new(channel, protocol_name) }
2762    }
2763
2764    /// Get a Stream of events from the remote end of the protocol.
2765    ///
2766    /// # Panics
2767    ///
2768    /// Panics if the event stream was already taken.
2769    pub fn take_event_stream(&self) -> ExecutionControllerEventStream {
2770        ExecutionControllerEventStream { event_receiver: self.client.take_event_receiver() }
2771    }
2772
2773    /// Initiates a stop action on this component. Once complete, OnStop will be
2774    /// called with the stopped payload and this channel is closed.
2775    ///
2776    /// Note that a component may stop running on its own at any time, so it is
2777    /// possible for `OnStop` to be received before `Stop` is called.
2778    pub fn r#stop(&self) -> Result<(), fidl::Error> {
2779        ExecutionControllerProxyInterface::r#stop(self)
2780    }
2781}
2782
2783impl ExecutionControllerProxyInterface for ExecutionControllerProxy {
2784    fn r#stop(&self) -> Result<(), fidl::Error> {
2785        self.client.send::<fidl::encoding::EmptyPayload>(
2786            (),
2787            0x56d23cec21036117,
2788            fidl::encoding::DynamicFlags::FLEXIBLE,
2789        )
2790    }
2791}
2792
2793pub struct ExecutionControllerEventStream {
2794    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2795}
2796
2797impl std::marker::Unpin for ExecutionControllerEventStream {}
2798
2799impl futures::stream::FusedStream for ExecutionControllerEventStream {
2800    fn is_terminated(&self) -> bool {
2801        self.event_receiver.is_terminated()
2802    }
2803}
2804
2805impl futures::Stream for ExecutionControllerEventStream {
2806    type Item = Result<ExecutionControllerEvent, fidl::Error>;
2807
2808    fn poll_next(
2809        mut self: std::pin::Pin<&mut Self>,
2810        cx: &mut std::task::Context<'_>,
2811    ) -> std::task::Poll<Option<Self::Item>> {
2812        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2813            &mut self.event_receiver,
2814            cx
2815        )?) {
2816            Some(buf) => std::task::Poll::Ready(Some(ExecutionControllerEvent::decode(buf))),
2817            None => std::task::Poll::Ready(None),
2818        }
2819    }
2820}
2821
2822#[derive(Debug)]
2823pub enum ExecutionControllerEvent {
2824    OnStop {
2825        stopped_payload: StoppedPayload,
2826    },
2827    #[non_exhaustive]
2828    _UnknownEvent {
2829        /// Ordinal of the event that was sent.
2830        ordinal: u64,
2831    },
2832}
2833
2834impl ExecutionControllerEvent {
2835    #[allow(irrefutable_let_patterns)]
2836    pub fn into_on_stop(self) -> Option<StoppedPayload> {
2837        if let ExecutionControllerEvent::OnStop { stopped_payload } = self {
2838            Some((stopped_payload))
2839        } else {
2840            None
2841        }
2842    }
2843
2844    /// Decodes a message buffer as a [`ExecutionControllerEvent`].
2845    fn decode(
2846        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2847    ) -> Result<ExecutionControllerEvent, fidl::Error> {
2848        let (bytes, _handles) = buf.split_mut();
2849        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2850        debug_assert_eq!(tx_header.tx_id, 0);
2851        match tx_header.ordinal {
2852            0x62d5018e2174f57f => {
2853                let mut out = fidl::new_empty!(
2854                    ExecutionControllerOnStopRequest,
2855                    fdomain_client::fidl::FDomainResourceDialect
2856                );
2857                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ExecutionControllerOnStopRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2858                Ok((ExecutionControllerEvent::OnStop { stopped_payload: out.stopped_payload }))
2859            }
2860            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2861                Ok(ExecutionControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2862            }
2863            _ => Err(fidl::Error::UnknownOrdinal {
2864                ordinal: tx_header.ordinal,
2865                protocol_name:
2866                    <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2867            }),
2868        }
2869    }
2870}
2871
2872/// A Stream of incoming requests for fuchsia.component/ExecutionController.
2873pub struct ExecutionControllerRequestStream {
2874    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2875    is_terminated: bool,
2876}
2877
2878impl std::marker::Unpin for ExecutionControllerRequestStream {}
2879
2880impl futures::stream::FusedStream for ExecutionControllerRequestStream {
2881    fn is_terminated(&self) -> bool {
2882        self.is_terminated
2883    }
2884}
2885
2886impl fdomain_client::fidl::RequestStream for ExecutionControllerRequestStream {
2887    type Protocol = ExecutionControllerMarker;
2888    type ControlHandle = ExecutionControllerControlHandle;
2889
2890    fn from_channel(channel: fdomain_client::Channel) -> Self {
2891        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2892    }
2893
2894    fn control_handle(&self) -> Self::ControlHandle {
2895        ExecutionControllerControlHandle { inner: self.inner.clone() }
2896    }
2897
2898    fn into_inner(
2899        self,
2900    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2901    {
2902        (self.inner, self.is_terminated)
2903    }
2904
2905    fn from_inner(
2906        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2907        is_terminated: bool,
2908    ) -> Self {
2909        Self { inner, is_terminated }
2910    }
2911}
2912
2913impl futures::Stream for ExecutionControllerRequestStream {
2914    type Item = Result<ExecutionControllerRequest, fidl::Error>;
2915
2916    fn poll_next(
2917        mut self: std::pin::Pin<&mut Self>,
2918        cx: &mut std::task::Context<'_>,
2919    ) -> std::task::Poll<Option<Self::Item>> {
2920        let this = &mut *self;
2921        if this.inner.check_shutdown(cx) {
2922            this.is_terminated = true;
2923            return std::task::Poll::Ready(None);
2924        }
2925        if this.is_terminated {
2926            panic!("polled ExecutionControllerRequestStream after completion");
2927        }
2928        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2929            |bytes, handles| {
2930                match this.inner.channel().read_etc(cx, bytes, handles) {
2931                    std::task::Poll::Ready(Ok(())) => {}
2932                    std::task::Poll::Pending => return std::task::Poll::Pending,
2933                    std::task::Poll::Ready(Err(None)) => {
2934                        this.is_terminated = true;
2935                        return std::task::Poll::Ready(None);
2936                    }
2937                    std::task::Poll::Ready(Err(Some(e))) => {
2938                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2939                            e.into(),
2940                        ))));
2941                    }
2942                }
2943
2944                // A message has been received from the channel
2945                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2946
2947                std::task::Poll::Ready(Some(match header.ordinal {
2948                0x56d23cec21036117 => {
2949                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2950                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
2951                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2952                    let control_handle = ExecutionControllerControlHandle {
2953                        inner: this.inner.clone(),
2954                    };
2955                    Ok(ExecutionControllerRequest::Stop {
2956                        control_handle,
2957                    })
2958                }
2959                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2960                    Ok(ExecutionControllerRequest::_UnknownMethod {
2961                        ordinal: header.ordinal,
2962                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
2963                        method_type: fidl::MethodType::OneWay,
2964                    })
2965                }
2966                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2967                    this.inner.send_framework_err(
2968                        fidl::encoding::FrameworkErr::UnknownMethod,
2969                        header.tx_id,
2970                        header.ordinal,
2971                        header.dynamic_flags(),
2972                        (bytes, handles),
2973                    )?;
2974                    Ok(ExecutionControllerRequest::_UnknownMethod {
2975                        ordinal: header.ordinal,
2976                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
2977                        method_type: fidl::MethodType::TwoWay,
2978                    })
2979                }
2980                _ => Err(fidl::Error::UnknownOrdinal {
2981                    ordinal: header.ordinal,
2982                    protocol_name: <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2983                }),
2984            }))
2985            },
2986        )
2987    }
2988}
2989
2990#[derive(Debug)]
2991pub enum ExecutionControllerRequest {
2992    /// Initiates a stop action on this component. Once complete, OnStop will be
2993    /// called with the stopped payload and this channel is closed.
2994    ///
2995    /// Note that a component may stop running on its own at any time, so it is
2996    /// possible for `OnStop` to be received before `Stop` is called.
2997    Stop { control_handle: ExecutionControllerControlHandle },
2998    /// An interaction was received which does not match any known method.
2999    #[non_exhaustive]
3000    _UnknownMethod {
3001        /// Ordinal of the method that was called.
3002        ordinal: u64,
3003        control_handle: ExecutionControllerControlHandle,
3004        method_type: fidl::MethodType,
3005    },
3006}
3007
3008impl ExecutionControllerRequest {
3009    #[allow(irrefutable_let_patterns)]
3010    pub fn into_stop(self) -> Option<(ExecutionControllerControlHandle)> {
3011        if let ExecutionControllerRequest::Stop { control_handle } = self {
3012            Some((control_handle))
3013        } else {
3014            None
3015        }
3016    }
3017
3018    /// Name of the method defined in FIDL
3019    pub fn method_name(&self) -> &'static str {
3020        match *self {
3021            ExecutionControllerRequest::Stop { .. } => "stop",
3022            ExecutionControllerRequest::_UnknownMethod {
3023                method_type: fidl::MethodType::OneWay,
3024                ..
3025            } => "unknown one-way method",
3026            ExecutionControllerRequest::_UnknownMethod {
3027                method_type: fidl::MethodType::TwoWay,
3028                ..
3029            } => "unknown two-way method",
3030        }
3031    }
3032}
3033
3034#[derive(Debug, Clone)]
3035pub struct ExecutionControllerControlHandle {
3036    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3037}
3038
3039impl fdomain_client::fidl::ControlHandle for ExecutionControllerControlHandle {
3040    fn shutdown(&self) {
3041        self.inner.shutdown()
3042    }
3043
3044    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3045        self.inner.shutdown_with_epitaph(status)
3046    }
3047
3048    fn is_closed(&self) -> bool {
3049        self.inner.channel().is_closed()
3050    }
3051    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3052        self.inner.channel().on_closed()
3053    }
3054}
3055
3056impl ExecutionControllerControlHandle {
3057    pub fn send_on_stop(&self, mut stopped_payload: &StoppedPayload) -> Result<(), fidl::Error> {
3058        self.inner.send::<ExecutionControllerOnStopRequest>(
3059            (stopped_payload,),
3060            0,
3061            0x62d5018e2174f57f,
3062            fidl::encoding::DynamicFlags::FLEXIBLE,
3063        )
3064    }
3065}
3066
3067#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3068pub struct IntrospectorMarker;
3069
3070impl fdomain_client::fidl::ProtocolMarker for IntrospectorMarker {
3071    type Proxy = IntrospectorProxy;
3072    type RequestStream = IntrospectorRequestStream;
3073
3074    const DEBUG_NAME: &'static str = "fuchsia.component.Introspector";
3075}
3076impl fdomain_client::fidl::DiscoverableProtocolMarker for IntrospectorMarker {}
3077pub type IntrospectorGetMonikerResult = Result<String, Error>;
3078
3079pub trait IntrospectorProxyInterface: Send + Sync {
3080    type GetMonikerResponseFut: std::future::Future<Output = Result<IntrospectorGetMonikerResult, fidl::Error>>
3081        + Send;
3082    fn r#get_moniker(
3083        &self,
3084        component_instance: fdomain_client::Event,
3085    ) -> Self::GetMonikerResponseFut;
3086}
3087
3088#[derive(Debug, Clone)]
3089pub struct IntrospectorProxy {
3090    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3091}
3092
3093impl fdomain_client::fidl::Proxy for IntrospectorProxy {
3094    type Protocol = IntrospectorMarker;
3095
3096    fn from_channel(inner: fdomain_client::Channel) -> Self {
3097        Self::new(inner)
3098    }
3099
3100    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3101        self.client.into_channel().map_err(|client| Self { client })
3102    }
3103
3104    fn as_channel(&self) -> &fdomain_client::Channel {
3105        self.client.as_channel()
3106    }
3107}
3108
3109impl IntrospectorProxy {
3110    /// Create a new Proxy for fuchsia.component/Introspector.
3111    pub fn new(channel: fdomain_client::Channel) -> Self {
3112        let protocol_name =
3113            <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3114        Self { client: fidl::client::Client::new(channel, protocol_name) }
3115    }
3116
3117    /// Get a Stream of events from the remote end of the protocol.
3118    ///
3119    /// # Panics
3120    ///
3121    /// Panics if the event stream was already taken.
3122    pub fn take_event_stream(&self) -> IntrospectorEventStream {
3123        IntrospectorEventStream { event_receiver: self.client.take_event_receiver() }
3124    }
3125
3126    /// Obtains the moniker relative to this realm of the component
3127    /// corresponding to the provided token. Runners may obtain the token via
3128    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
3129    ///
3130    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
3131    /// does not correspond to a component under this realm.
3132    pub fn r#get_moniker(
3133        &self,
3134        mut component_instance: fdomain_client::Event,
3135    ) -> fidl::client::QueryResponseFut<
3136        IntrospectorGetMonikerResult,
3137        fdomain_client::fidl::FDomainResourceDialect,
3138    > {
3139        IntrospectorProxyInterface::r#get_moniker(self, component_instance)
3140    }
3141}
3142
3143impl IntrospectorProxyInterface for IntrospectorProxy {
3144    type GetMonikerResponseFut = fidl::client::QueryResponseFut<
3145        IntrospectorGetMonikerResult,
3146        fdomain_client::fidl::FDomainResourceDialect,
3147    >;
3148    fn r#get_moniker(
3149        &self,
3150        mut component_instance: fdomain_client::Event,
3151    ) -> Self::GetMonikerResponseFut {
3152        fn _decode(
3153            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3154        ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
3155            let _response = fidl::client::decode_transaction_body::<
3156                fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
3157                fdomain_client::fidl::FDomainResourceDialect,
3158                0x2f980ceb37bf458,
3159            >(_buf?)?
3160            .into_result_fdomain::<IntrospectorMarker>("get_moniker")?;
3161            Ok(_response.map(|x| x.moniker))
3162        }
3163        self.client
3164            .send_query_and_decode::<IntrospectorGetMonikerRequest, IntrospectorGetMonikerResult>(
3165                (component_instance,),
3166                0x2f980ceb37bf458,
3167                fidl::encoding::DynamicFlags::FLEXIBLE,
3168                _decode,
3169            )
3170    }
3171}
3172
3173pub struct IntrospectorEventStream {
3174    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3175}
3176
3177impl std::marker::Unpin for IntrospectorEventStream {}
3178
3179impl futures::stream::FusedStream for IntrospectorEventStream {
3180    fn is_terminated(&self) -> bool {
3181        self.event_receiver.is_terminated()
3182    }
3183}
3184
3185impl futures::Stream for IntrospectorEventStream {
3186    type Item = Result<IntrospectorEvent, fidl::Error>;
3187
3188    fn poll_next(
3189        mut self: std::pin::Pin<&mut Self>,
3190        cx: &mut std::task::Context<'_>,
3191    ) -> std::task::Poll<Option<Self::Item>> {
3192        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3193            &mut self.event_receiver,
3194            cx
3195        )?) {
3196            Some(buf) => std::task::Poll::Ready(Some(IntrospectorEvent::decode(buf))),
3197            None => std::task::Poll::Ready(None),
3198        }
3199    }
3200}
3201
3202#[derive(Debug)]
3203pub enum IntrospectorEvent {
3204    #[non_exhaustive]
3205    _UnknownEvent {
3206        /// Ordinal of the event that was sent.
3207        ordinal: u64,
3208    },
3209}
3210
3211impl IntrospectorEvent {
3212    /// Decodes a message buffer as a [`IntrospectorEvent`].
3213    fn decode(
3214        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3215    ) -> Result<IntrospectorEvent, fidl::Error> {
3216        let (bytes, _handles) = buf.split_mut();
3217        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3218        debug_assert_eq!(tx_header.tx_id, 0);
3219        match tx_header.ordinal {
3220            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3221                Ok(IntrospectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3222            }
3223            _ => Err(fidl::Error::UnknownOrdinal {
3224                ordinal: tx_header.ordinal,
3225                protocol_name:
3226                    <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3227            }),
3228        }
3229    }
3230}
3231
3232/// A Stream of incoming requests for fuchsia.component/Introspector.
3233pub struct IntrospectorRequestStream {
3234    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3235    is_terminated: bool,
3236}
3237
3238impl std::marker::Unpin for IntrospectorRequestStream {}
3239
3240impl futures::stream::FusedStream for IntrospectorRequestStream {
3241    fn is_terminated(&self) -> bool {
3242        self.is_terminated
3243    }
3244}
3245
3246impl fdomain_client::fidl::RequestStream for IntrospectorRequestStream {
3247    type Protocol = IntrospectorMarker;
3248    type ControlHandle = IntrospectorControlHandle;
3249
3250    fn from_channel(channel: fdomain_client::Channel) -> Self {
3251        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3252    }
3253
3254    fn control_handle(&self) -> Self::ControlHandle {
3255        IntrospectorControlHandle { inner: self.inner.clone() }
3256    }
3257
3258    fn into_inner(
3259        self,
3260    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3261    {
3262        (self.inner, self.is_terminated)
3263    }
3264
3265    fn from_inner(
3266        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3267        is_terminated: bool,
3268    ) -> Self {
3269        Self { inner, is_terminated }
3270    }
3271}
3272
3273impl futures::Stream for IntrospectorRequestStream {
3274    type Item = Result<IntrospectorRequest, fidl::Error>;
3275
3276    fn poll_next(
3277        mut self: std::pin::Pin<&mut Self>,
3278        cx: &mut std::task::Context<'_>,
3279    ) -> std::task::Poll<Option<Self::Item>> {
3280        let this = &mut *self;
3281        if this.inner.check_shutdown(cx) {
3282            this.is_terminated = true;
3283            return std::task::Poll::Ready(None);
3284        }
3285        if this.is_terminated {
3286            panic!("polled IntrospectorRequestStream after completion");
3287        }
3288        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3289            |bytes, handles| {
3290                match this.inner.channel().read_etc(cx, bytes, handles) {
3291                    std::task::Poll::Ready(Ok(())) => {}
3292                    std::task::Poll::Pending => return std::task::Poll::Pending,
3293                    std::task::Poll::Ready(Err(None)) => {
3294                        this.is_terminated = true;
3295                        return std::task::Poll::Ready(None);
3296                    }
3297                    std::task::Poll::Ready(Err(Some(e))) => {
3298                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3299                            e.into(),
3300                        ))));
3301                    }
3302                }
3303
3304                // A message has been received from the channel
3305                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3306
3307                std::task::Poll::Ready(Some(match header.ordinal {
3308                    0x2f980ceb37bf458 => {
3309                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3310                        let mut req = fidl::new_empty!(
3311                            IntrospectorGetMonikerRequest,
3312                            fdomain_client::fidl::FDomainResourceDialect
3313                        );
3314                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<IntrospectorGetMonikerRequest>(&header, _body_bytes, handles, &mut req)?;
3315                        let control_handle =
3316                            IntrospectorControlHandle { inner: this.inner.clone() };
3317                        Ok(IntrospectorRequest::GetMoniker {
3318                            component_instance: req.component_instance,
3319
3320                            responder: IntrospectorGetMonikerResponder {
3321                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3322                                tx_id: header.tx_id,
3323                            },
3324                        })
3325                    }
3326                    _ if header.tx_id == 0
3327                        && header
3328                            .dynamic_flags()
3329                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3330                    {
3331                        Ok(IntrospectorRequest::_UnknownMethod {
3332                            ordinal: header.ordinal,
3333                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
3334                            method_type: fidl::MethodType::OneWay,
3335                        })
3336                    }
3337                    _ if header
3338                        .dynamic_flags()
3339                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3340                    {
3341                        this.inner.send_framework_err(
3342                            fidl::encoding::FrameworkErr::UnknownMethod,
3343                            header.tx_id,
3344                            header.ordinal,
3345                            header.dynamic_flags(),
3346                            (bytes, handles),
3347                        )?;
3348                        Ok(IntrospectorRequest::_UnknownMethod {
3349                            ordinal: header.ordinal,
3350                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
3351                            method_type: fidl::MethodType::TwoWay,
3352                        })
3353                    }
3354                    _ => Err(fidl::Error::UnknownOrdinal {
3355                        ordinal: header.ordinal,
3356                        protocol_name:
3357                            <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3358                    }),
3359                }))
3360            },
3361        )
3362    }
3363}
3364
3365/// A protocol used by a component instance to obtain information about
3366/// components in its own realm.
3367///
3368/// This protocol only supports getting the moniker at the moment but could
3369/// expand to other privileged information such as the URL of a component.
3370///
3371/// The component framework provides this capability to components that use
3372/// `fuchsia.component.Introspector` from framework.
3373#[derive(Debug)]
3374pub enum IntrospectorRequest {
3375    /// Obtains the moniker relative to this realm of the component
3376    /// corresponding to the provided token. Runners may obtain the token via
3377    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
3378    ///
3379    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
3380    /// does not correspond to a component under this realm.
3381    GetMoniker {
3382        component_instance: fdomain_client::Event,
3383        responder: IntrospectorGetMonikerResponder,
3384    },
3385    /// An interaction was received which does not match any known method.
3386    #[non_exhaustive]
3387    _UnknownMethod {
3388        /// Ordinal of the method that was called.
3389        ordinal: u64,
3390        control_handle: IntrospectorControlHandle,
3391        method_type: fidl::MethodType,
3392    },
3393}
3394
3395impl IntrospectorRequest {
3396    #[allow(irrefutable_let_patterns)]
3397    pub fn into_get_moniker(
3398        self,
3399    ) -> Option<(fdomain_client::Event, IntrospectorGetMonikerResponder)> {
3400        if let IntrospectorRequest::GetMoniker { component_instance, responder } = self {
3401            Some((component_instance, responder))
3402        } else {
3403            None
3404        }
3405    }
3406
3407    /// Name of the method defined in FIDL
3408    pub fn method_name(&self) -> &'static str {
3409        match *self {
3410            IntrospectorRequest::GetMoniker { .. } => "get_moniker",
3411            IntrospectorRequest::_UnknownMethod {
3412                method_type: fidl::MethodType::OneWay, ..
3413            } => "unknown one-way method",
3414            IntrospectorRequest::_UnknownMethod {
3415                method_type: fidl::MethodType::TwoWay, ..
3416            } => "unknown two-way method",
3417        }
3418    }
3419}
3420
3421#[derive(Debug, Clone)]
3422pub struct IntrospectorControlHandle {
3423    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3424}
3425
3426impl fdomain_client::fidl::ControlHandle for IntrospectorControlHandle {
3427    fn shutdown(&self) {
3428        self.inner.shutdown()
3429    }
3430
3431    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3432        self.inner.shutdown_with_epitaph(status)
3433    }
3434
3435    fn is_closed(&self) -> bool {
3436        self.inner.channel().is_closed()
3437    }
3438    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3439        self.inner.channel().on_closed()
3440    }
3441}
3442
3443impl IntrospectorControlHandle {}
3444
3445#[must_use = "FIDL methods require a response to be sent"]
3446#[derive(Debug)]
3447pub struct IntrospectorGetMonikerResponder {
3448    control_handle: std::mem::ManuallyDrop<IntrospectorControlHandle>,
3449    tx_id: u32,
3450}
3451
3452/// Set the the channel to be shutdown (see [`IntrospectorControlHandle::shutdown`])
3453/// if the responder is dropped without sending a response, so that the client
3454/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3455impl std::ops::Drop for IntrospectorGetMonikerResponder {
3456    fn drop(&mut self) {
3457        self.control_handle.shutdown();
3458        // Safety: drops once, never accessed again
3459        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3460    }
3461}
3462
3463impl fdomain_client::fidl::Responder for IntrospectorGetMonikerResponder {
3464    type ControlHandle = IntrospectorControlHandle;
3465
3466    fn control_handle(&self) -> &IntrospectorControlHandle {
3467        &self.control_handle
3468    }
3469
3470    fn drop_without_shutdown(mut self) {
3471        // Safety: drops once, never accessed again due to mem::forget
3472        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3473        // Prevent Drop from running (which would shut down the channel)
3474        std::mem::forget(self);
3475    }
3476}
3477
3478impl IntrospectorGetMonikerResponder {
3479    /// Sends a response to the FIDL transaction.
3480    ///
3481    /// Sets the channel to shutdown if an error occurs.
3482    pub fn send(self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3483        let _result = self.send_raw(result);
3484        if _result.is_err() {
3485            self.control_handle.shutdown();
3486        }
3487        self.drop_without_shutdown();
3488        _result
3489    }
3490
3491    /// Similar to "send" but does not shutdown the channel if an error occurs.
3492    pub fn send_no_shutdown_on_err(
3493        self,
3494        mut result: Result<&str, Error>,
3495    ) -> Result<(), fidl::Error> {
3496        let _result = self.send_raw(result);
3497        self.drop_without_shutdown();
3498        _result
3499    }
3500
3501    fn send_raw(&self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3502        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3503            IntrospectorGetMonikerResponse,
3504            Error,
3505        >>(
3506            fidl::encoding::FlexibleResult::new(result.map(|moniker| (moniker,))),
3507            self.tx_id,
3508            0x2f980ceb37bf458,
3509            fidl::encoding::DynamicFlags::FLEXIBLE,
3510        )
3511    }
3512}
3513
3514#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3515pub struct NamespaceMarker;
3516
3517impl fdomain_client::fidl::ProtocolMarker for NamespaceMarker {
3518    type Proxy = NamespaceProxy;
3519    type RequestStream = NamespaceRequestStream;
3520
3521    const DEBUG_NAME: &'static str = "fuchsia.component.Namespace";
3522}
3523impl fdomain_client::fidl::DiscoverableProtocolMarker for NamespaceMarker {}
3524pub type NamespaceCreateResult = Result<Vec<NamespaceEntry>, NamespaceError>;
3525pub type NamespaceCreate2Result = Result<Vec<NamespaceEntry>, NamespaceError>;
3526
3527pub trait NamespaceProxyInterface: Send + Sync {
3528    type CreateResponseFut: std::future::Future<Output = Result<NamespaceCreateResult, fidl::Error>>
3529        + Send;
3530    fn r#create(&self, entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut;
3531    type Create2ResponseFut: std::future::Future<Output = Result<NamespaceCreate2Result, fidl::Error>>
3532        + Send;
3533    fn r#create2(&self, entries: Vec<NamespaceInputEntry2>) -> Self::Create2ResponseFut;
3534}
3535
3536#[derive(Debug, Clone)]
3537pub struct NamespaceProxy {
3538    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3539}
3540
3541impl fdomain_client::fidl::Proxy for NamespaceProxy {
3542    type Protocol = NamespaceMarker;
3543
3544    fn from_channel(inner: fdomain_client::Channel) -> Self {
3545        Self::new(inner)
3546    }
3547
3548    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3549        self.client.into_channel().map_err(|client| Self { client })
3550    }
3551
3552    fn as_channel(&self) -> &fdomain_client::Channel {
3553        self.client.as_channel()
3554    }
3555}
3556
3557impl NamespaceProxy {
3558    /// Create a new Proxy for fuchsia.component/Namespace.
3559    pub fn new(channel: fdomain_client::Channel) -> Self {
3560        let protocol_name = <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3561        Self { client: fidl::client::Client::new(channel, protocol_name) }
3562    }
3563
3564    /// Get a Stream of events from the remote end of the protocol.
3565    ///
3566    /// # Panics
3567    ///
3568    /// Panics if the event stream was already taken.
3569    pub fn take_event_stream(&self) -> NamespaceEventStream {
3570        NamespaceEventStream { event_receiver: self.client.take_event_receiver() }
3571    }
3572
3573    pub fn r#create(
3574        &self,
3575        mut entries: Vec<NamespaceInputEntry>,
3576    ) -> fidl::client::QueryResponseFut<
3577        NamespaceCreateResult,
3578        fdomain_client::fidl::FDomainResourceDialect,
3579    > {
3580        NamespaceProxyInterface::r#create(self, entries)
3581    }
3582
3583    pub fn r#create2(
3584        &self,
3585        mut entries: Vec<NamespaceInputEntry2>,
3586    ) -> fidl::client::QueryResponseFut<
3587        NamespaceCreate2Result,
3588        fdomain_client::fidl::FDomainResourceDialect,
3589    > {
3590        NamespaceProxyInterface::r#create2(self, entries)
3591    }
3592}
3593
3594impl NamespaceProxyInterface for NamespaceProxy {
3595    type CreateResponseFut = fidl::client::QueryResponseFut<
3596        NamespaceCreateResult,
3597        fdomain_client::fidl::FDomainResourceDialect,
3598    >;
3599    fn r#create(&self, mut entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut {
3600        fn _decode(
3601            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3602        ) -> Result<NamespaceCreateResult, fidl::Error> {
3603            let _response = fidl::client::decode_transaction_body::<
3604                fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
3605                fdomain_client::fidl::FDomainResourceDialect,
3606                0x4329fe12b2a790f9,
3607            >(_buf?)?
3608            .into_result_fdomain::<NamespaceMarker>("create")?;
3609            Ok(_response.map(|x| x.entries))
3610        }
3611        self.client.send_query_and_decode::<NamespaceCreateRequest, NamespaceCreateResult>(
3612            (entries.as_mut(),),
3613            0x4329fe12b2a790f9,
3614            fidl::encoding::DynamicFlags::FLEXIBLE,
3615            _decode,
3616        )
3617    }
3618
3619    type Create2ResponseFut = fidl::client::QueryResponseFut<
3620        NamespaceCreate2Result,
3621        fdomain_client::fidl::FDomainResourceDialect,
3622    >;
3623    fn r#create2(&self, mut entries: Vec<NamespaceInputEntry2>) -> Self::Create2ResponseFut {
3624        fn _decode(
3625            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3626        ) -> Result<NamespaceCreate2Result, fidl::Error> {
3627            let _response = fidl::client::decode_transaction_body::<
3628                fidl::encoding::FlexibleResultType<NamespaceCreate2Response, NamespaceError>,
3629                fdomain_client::fidl::FDomainResourceDialect,
3630                0x665aa4bb3773b351,
3631            >(_buf?)?
3632            .into_result_fdomain::<NamespaceMarker>("create2")?;
3633            Ok(_response.map(|x| x.entries))
3634        }
3635        self.client.send_query_and_decode::<NamespaceCreate2Request, NamespaceCreate2Result>(
3636            (entries.as_mut(),),
3637            0x665aa4bb3773b351,
3638            fidl::encoding::DynamicFlags::FLEXIBLE,
3639            _decode,
3640        )
3641    }
3642}
3643
3644pub struct NamespaceEventStream {
3645    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3646}
3647
3648impl std::marker::Unpin for NamespaceEventStream {}
3649
3650impl futures::stream::FusedStream for NamespaceEventStream {
3651    fn is_terminated(&self) -> bool {
3652        self.event_receiver.is_terminated()
3653    }
3654}
3655
3656impl futures::Stream for NamespaceEventStream {
3657    type Item = Result<NamespaceEvent, fidl::Error>;
3658
3659    fn poll_next(
3660        mut self: std::pin::Pin<&mut Self>,
3661        cx: &mut std::task::Context<'_>,
3662    ) -> std::task::Poll<Option<Self::Item>> {
3663        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3664            &mut self.event_receiver,
3665            cx
3666        )?) {
3667            Some(buf) => std::task::Poll::Ready(Some(NamespaceEvent::decode(buf))),
3668            None => std::task::Poll::Ready(None),
3669        }
3670    }
3671}
3672
3673#[derive(Debug)]
3674pub enum NamespaceEvent {
3675    #[non_exhaustive]
3676    _UnknownEvent {
3677        /// Ordinal of the event that was sent.
3678        ordinal: u64,
3679    },
3680}
3681
3682impl NamespaceEvent {
3683    /// Decodes a message buffer as a [`NamespaceEvent`].
3684    fn decode(
3685        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3686    ) -> Result<NamespaceEvent, fidl::Error> {
3687        let (bytes, _handles) = buf.split_mut();
3688        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3689        debug_assert_eq!(tx_header.tx_id, 0);
3690        match tx_header.ordinal {
3691            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3692                Ok(NamespaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3693            }
3694            _ => Err(fidl::Error::UnknownOrdinal {
3695                ordinal: tx_header.ordinal,
3696                protocol_name:
3697                    <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3698            }),
3699        }
3700    }
3701}
3702
3703/// A Stream of incoming requests for fuchsia.component/Namespace.
3704pub struct NamespaceRequestStream {
3705    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3706    is_terminated: bool,
3707}
3708
3709impl std::marker::Unpin for NamespaceRequestStream {}
3710
3711impl futures::stream::FusedStream for NamespaceRequestStream {
3712    fn is_terminated(&self) -> bool {
3713        self.is_terminated
3714    }
3715}
3716
3717impl fdomain_client::fidl::RequestStream for NamespaceRequestStream {
3718    type Protocol = NamespaceMarker;
3719    type ControlHandle = NamespaceControlHandle;
3720
3721    fn from_channel(channel: fdomain_client::Channel) -> Self {
3722        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3723    }
3724
3725    fn control_handle(&self) -> Self::ControlHandle {
3726        NamespaceControlHandle { inner: self.inner.clone() }
3727    }
3728
3729    fn into_inner(
3730        self,
3731    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3732    {
3733        (self.inner, self.is_terminated)
3734    }
3735
3736    fn from_inner(
3737        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3738        is_terminated: bool,
3739    ) -> Self {
3740        Self { inner, is_terminated }
3741    }
3742}
3743
3744impl futures::Stream for NamespaceRequestStream {
3745    type Item = Result<NamespaceRequest, fidl::Error>;
3746
3747    fn poll_next(
3748        mut self: std::pin::Pin<&mut Self>,
3749        cx: &mut std::task::Context<'_>,
3750    ) -> std::task::Poll<Option<Self::Item>> {
3751        let this = &mut *self;
3752        if this.inner.check_shutdown(cx) {
3753            this.is_terminated = true;
3754            return std::task::Poll::Ready(None);
3755        }
3756        if this.is_terminated {
3757            panic!("polled NamespaceRequestStream after completion");
3758        }
3759        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3760            |bytes, handles| {
3761                match this.inner.channel().read_etc(cx, bytes, handles) {
3762                    std::task::Poll::Ready(Ok(())) => {}
3763                    std::task::Poll::Pending => return std::task::Poll::Pending,
3764                    std::task::Poll::Ready(Err(None)) => {
3765                        this.is_terminated = true;
3766                        return std::task::Poll::Ready(None);
3767                    }
3768                    std::task::Poll::Ready(Err(Some(e))) => {
3769                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3770                            e.into(),
3771                        ))));
3772                    }
3773                }
3774
3775                // A message has been received from the channel
3776                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3777
3778                std::task::Poll::Ready(Some(match header.ordinal {
3779                    0x4329fe12b2a790f9 => {
3780                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3781                        let mut req = fidl::new_empty!(
3782                            NamespaceCreateRequest,
3783                            fdomain_client::fidl::FDomainResourceDialect
3784                        );
3785                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NamespaceCreateRequest>(&header, _body_bytes, handles, &mut req)?;
3786                        let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
3787                        Ok(NamespaceRequest::Create {
3788                            entries: req.entries,
3789
3790                            responder: NamespaceCreateResponder {
3791                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3792                                tx_id: header.tx_id,
3793                            },
3794                        })
3795                    }
3796                    0x665aa4bb3773b351 => {
3797                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3798                        let mut req = fidl::new_empty!(
3799                            NamespaceCreate2Request,
3800                            fdomain_client::fidl::FDomainResourceDialect
3801                        );
3802                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NamespaceCreate2Request>(&header, _body_bytes, handles, &mut req)?;
3803                        let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
3804                        Ok(NamespaceRequest::Create2 {
3805                            entries: req.entries,
3806
3807                            responder: NamespaceCreate2Responder {
3808                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3809                                tx_id: header.tx_id,
3810                            },
3811                        })
3812                    }
3813                    _ if header.tx_id == 0
3814                        && header
3815                            .dynamic_flags()
3816                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3817                    {
3818                        Ok(NamespaceRequest::_UnknownMethod {
3819                            ordinal: header.ordinal,
3820                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
3821                            method_type: fidl::MethodType::OneWay,
3822                        })
3823                    }
3824                    _ if header
3825                        .dynamic_flags()
3826                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3827                    {
3828                        this.inner.send_framework_err(
3829                            fidl::encoding::FrameworkErr::UnknownMethod,
3830                            header.tx_id,
3831                            header.ordinal,
3832                            header.dynamic_flags(),
3833                            (bytes, handles),
3834                        )?;
3835                        Ok(NamespaceRequest::_UnknownMethod {
3836                            ordinal: header.ordinal,
3837                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
3838                            method_type: fidl::MethodType::TwoWay,
3839                        })
3840                    }
3841                    _ => Err(fidl::Error::UnknownOrdinal {
3842                        ordinal: header.ordinal,
3843                        protocol_name:
3844                            <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3845                    }),
3846                }))
3847            },
3848        )
3849    }
3850}
3851
3852/// Protocol for performing namespace operations.
3853#[derive(Debug)]
3854pub enum NamespaceRequest {
3855    Create {
3856        entries: Vec<NamespaceInputEntry>,
3857        responder: NamespaceCreateResponder,
3858    },
3859    Create2 {
3860        entries: Vec<NamespaceInputEntry2>,
3861        responder: NamespaceCreate2Responder,
3862    },
3863    /// An interaction was received which does not match any known method.
3864    #[non_exhaustive]
3865    _UnknownMethod {
3866        /// Ordinal of the method that was called.
3867        ordinal: u64,
3868        control_handle: NamespaceControlHandle,
3869        method_type: fidl::MethodType,
3870    },
3871}
3872
3873impl NamespaceRequest {
3874    #[allow(irrefutable_let_patterns)]
3875    pub fn into_create(self) -> Option<(Vec<NamespaceInputEntry>, NamespaceCreateResponder)> {
3876        if let NamespaceRequest::Create { entries, responder } = self {
3877            Some((entries, responder))
3878        } else {
3879            None
3880        }
3881    }
3882
3883    #[allow(irrefutable_let_patterns)]
3884    pub fn into_create2(self) -> Option<(Vec<NamespaceInputEntry2>, NamespaceCreate2Responder)> {
3885        if let NamespaceRequest::Create2 { entries, responder } = self {
3886            Some((entries, responder))
3887        } else {
3888            None
3889        }
3890    }
3891
3892    /// Name of the method defined in FIDL
3893    pub fn method_name(&self) -> &'static str {
3894        match *self {
3895            NamespaceRequest::Create { .. } => "create",
3896            NamespaceRequest::Create2 { .. } => "create2",
3897            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3898                "unknown one-way method"
3899            }
3900            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3901                "unknown two-way method"
3902            }
3903        }
3904    }
3905}
3906
3907#[derive(Debug, Clone)]
3908pub struct NamespaceControlHandle {
3909    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3910}
3911
3912impl fdomain_client::fidl::ControlHandle for NamespaceControlHandle {
3913    fn shutdown(&self) {
3914        self.inner.shutdown()
3915    }
3916
3917    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3918        self.inner.shutdown_with_epitaph(status)
3919    }
3920
3921    fn is_closed(&self) -> bool {
3922        self.inner.channel().is_closed()
3923    }
3924    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3925        self.inner.channel().on_closed()
3926    }
3927}
3928
3929impl NamespaceControlHandle {}
3930
3931#[must_use = "FIDL methods require a response to be sent"]
3932#[derive(Debug)]
3933pub struct NamespaceCreateResponder {
3934    control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
3935    tx_id: u32,
3936}
3937
3938/// Set the the channel to be shutdown (see [`NamespaceControlHandle::shutdown`])
3939/// if the responder is dropped without sending a response, so that the client
3940/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3941impl std::ops::Drop for NamespaceCreateResponder {
3942    fn drop(&mut self) {
3943        self.control_handle.shutdown();
3944        // Safety: drops once, never accessed again
3945        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3946    }
3947}
3948
3949impl fdomain_client::fidl::Responder for NamespaceCreateResponder {
3950    type ControlHandle = NamespaceControlHandle;
3951
3952    fn control_handle(&self) -> &NamespaceControlHandle {
3953        &self.control_handle
3954    }
3955
3956    fn drop_without_shutdown(mut self) {
3957        // Safety: drops once, never accessed again due to mem::forget
3958        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3959        // Prevent Drop from running (which would shut down the channel)
3960        std::mem::forget(self);
3961    }
3962}
3963
3964impl NamespaceCreateResponder {
3965    /// Sends a response to the FIDL transaction.
3966    ///
3967    /// Sets the channel to shutdown if an error occurs.
3968    pub fn send(
3969        self,
3970        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3971    ) -> Result<(), fidl::Error> {
3972        let _result = self.send_raw(result);
3973        if _result.is_err() {
3974            self.control_handle.shutdown();
3975        }
3976        self.drop_without_shutdown();
3977        _result
3978    }
3979
3980    /// Similar to "send" but does not shutdown the channel if an error occurs.
3981    pub fn send_no_shutdown_on_err(
3982        self,
3983        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3984    ) -> Result<(), fidl::Error> {
3985        let _result = self.send_raw(result);
3986        self.drop_without_shutdown();
3987        _result
3988    }
3989
3990    fn send_raw(
3991        &self,
3992        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3993    ) -> Result<(), fidl::Error> {
3994        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3995            NamespaceCreateResponse,
3996            NamespaceError,
3997        >>(
3998            fidl::encoding::FlexibleResult::new(
3999                result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
4000            ),
4001            self.tx_id,
4002            0x4329fe12b2a790f9,
4003            fidl::encoding::DynamicFlags::FLEXIBLE,
4004        )
4005    }
4006}
4007
4008#[must_use = "FIDL methods require a response to be sent"]
4009#[derive(Debug)]
4010pub struct NamespaceCreate2Responder {
4011    control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
4012    tx_id: u32,
4013}
4014
4015/// Set the the channel to be shutdown (see [`NamespaceControlHandle::shutdown`])
4016/// if the responder is dropped without sending a response, so that the client
4017/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4018impl std::ops::Drop for NamespaceCreate2Responder {
4019    fn drop(&mut self) {
4020        self.control_handle.shutdown();
4021        // Safety: drops once, never accessed again
4022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4023    }
4024}
4025
4026impl fdomain_client::fidl::Responder for NamespaceCreate2Responder {
4027    type ControlHandle = NamespaceControlHandle;
4028
4029    fn control_handle(&self) -> &NamespaceControlHandle {
4030        &self.control_handle
4031    }
4032
4033    fn drop_without_shutdown(mut self) {
4034        // Safety: drops once, never accessed again due to mem::forget
4035        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4036        // Prevent Drop from running (which would shut down the channel)
4037        std::mem::forget(self);
4038    }
4039}
4040
4041impl NamespaceCreate2Responder {
4042    /// Sends a response to the FIDL transaction.
4043    ///
4044    /// Sets the channel to shutdown if an error occurs.
4045    pub fn send(
4046        self,
4047        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4048    ) -> Result<(), fidl::Error> {
4049        let _result = self.send_raw(result);
4050        if _result.is_err() {
4051            self.control_handle.shutdown();
4052        }
4053        self.drop_without_shutdown();
4054        _result
4055    }
4056
4057    /// Similar to "send" but does not shutdown the channel if an error occurs.
4058    pub fn send_no_shutdown_on_err(
4059        self,
4060        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4061    ) -> Result<(), fidl::Error> {
4062        let _result = self.send_raw(result);
4063        self.drop_without_shutdown();
4064        _result
4065    }
4066
4067    fn send_raw(
4068        &self,
4069        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4070    ) -> Result<(), fidl::Error> {
4071        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4072            NamespaceCreate2Response,
4073            NamespaceError,
4074        >>(
4075            fidl::encoding::FlexibleResult::new(
4076                result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
4077            ),
4078            self.tx_id,
4079            0x665aa4bb3773b351,
4080            fidl::encoding::DynamicFlags::FLEXIBLE,
4081        )
4082    }
4083}
4084
4085#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4086pub struct RealmMarker;
4087
4088impl fdomain_client::fidl::ProtocolMarker for RealmMarker {
4089    type Proxy = RealmProxy;
4090    type RequestStream = RealmRequestStream;
4091
4092    const DEBUG_NAME: &'static str = "fuchsia.component.Realm";
4093}
4094impl fdomain_client::fidl::DiscoverableProtocolMarker for RealmMarker {}
4095pub type RealmOpenControllerResult = Result<(), Error>;
4096pub type RealmOpenExposedDirResult = Result<(), Error>;
4097pub type RealmCreateChildResult = Result<(), Error>;
4098pub type RealmDestroyChildResult = Result<(), Error>;
4099pub type RealmListChildrenResult = Result<(), Error>;
4100pub type RealmGetResolvedInfoResult =
4101    Result<fdomain_fuchsia_component_resolution::Component, Error>;
4102pub type RealmGetChildOutputDictionaryDeprecatedResult =
4103    Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>;
4104pub type RealmGetChildOutputDictionaryResult = Result<fdomain_client::EventPair, Error>;
4105
4106pub trait RealmProxyInterface: Send + Sync {
4107    type OpenControllerResponseFut: std::future::Future<Output = Result<RealmOpenControllerResult, fidl::Error>>
4108        + Send;
4109    fn r#open_controller(
4110        &self,
4111        child: &fdomain_fuchsia_component_decl::ChildRef,
4112        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4113    ) -> Self::OpenControllerResponseFut;
4114    type OpenExposedDirResponseFut: std::future::Future<Output = Result<RealmOpenExposedDirResult, fidl::Error>>
4115        + Send;
4116    fn r#open_exposed_dir(
4117        &self,
4118        child: &fdomain_fuchsia_component_decl::ChildRef,
4119        exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4120    ) -> Self::OpenExposedDirResponseFut;
4121    type CreateChildResponseFut: std::future::Future<Output = Result<RealmCreateChildResult, fidl::Error>>
4122        + Send;
4123    fn r#create_child(
4124        &self,
4125        collection: &fdomain_fuchsia_component_decl::CollectionRef,
4126        decl: &fdomain_fuchsia_component_decl::Child,
4127        args: CreateChildArgs,
4128    ) -> Self::CreateChildResponseFut;
4129    type DestroyChildResponseFut: std::future::Future<Output = Result<RealmDestroyChildResult, fidl::Error>>
4130        + Send;
4131    fn r#destroy_child(
4132        &self,
4133        child: &fdomain_fuchsia_component_decl::ChildRef,
4134    ) -> Self::DestroyChildResponseFut;
4135    type ListChildrenResponseFut: std::future::Future<Output = Result<RealmListChildrenResult, fidl::Error>>
4136        + Send;
4137    fn r#list_children(
4138        &self,
4139        collection: &fdomain_fuchsia_component_decl::CollectionRef,
4140        iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4141    ) -> Self::ListChildrenResponseFut;
4142    type GetResolvedInfoResponseFut: std::future::Future<Output = Result<RealmGetResolvedInfoResult, fidl::Error>>
4143        + Send;
4144    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut;
4145    type GetChildOutputDictionaryDeprecatedResponseFut: std::future::Future<
4146            Output = Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error>,
4147        > + Send;
4148    fn r#get_child_output_dictionary_deprecated(
4149        &self,
4150        child: &fdomain_fuchsia_component_decl::ChildRef,
4151    ) -> Self::GetChildOutputDictionaryDeprecatedResponseFut;
4152    type GetChildOutputDictionaryResponseFut: std::future::Future<Output = Result<RealmGetChildOutputDictionaryResult, fidl::Error>>
4153        + Send;
4154    fn r#get_child_output_dictionary(
4155        &self,
4156        child: &fdomain_fuchsia_component_decl::ChildRef,
4157    ) -> Self::GetChildOutputDictionaryResponseFut;
4158}
4159
4160#[derive(Debug, Clone)]
4161pub struct RealmProxy {
4162    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4163}
4164
4165impl fdomain_client::fidl::Proxy for RealmProxy {
4166    type Protocol = RealmMarker;
4167
4168    fn from_channel(inner: fdomain_client::Channel) -> Self {
4169        Self::new(inner)
4170    }
4171
4172    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4173        self.client.into_channel().map_err(|client| Self { client })
4174    }
4175
4176    fn as_channel(&self) -> &fdomain_client::Channel {
4177        self.client.as_channel()
4178    }
4179}
4180
4181impl RealmProxy {
4182    /// Create a new Proxy for fuchsia.component/Realm.
4183    pub fn new(channel: fdomain_client::Channel) -> Self {
4184        let protocol_name = <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
4185        Self { client: fidl::client::Client::new(channel, protocol_name) }
4186    }
4187
4188    /// Get a Stream of events from the remote end of the protocol.
4189    ///
4190    /// # Panics
4191    ///
4192    /// Panics if the event stream was already taken.
4193    pub fn take_event_stream(&self) -> RealmEventStream {
4194        RealmEventStream { event_receiver: self.client.take_event_receiver() }
4195    }
4196
4197    /// Operate on a child component. See documentation for [`Controller`].
4198    ///
4199    /// Errors:
4200    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4201    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4202    /// - `INSTANCE_DIED`: This realm no longer exists.
4203    pub fn r#open_controller(
4204        &self,
4205        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4206        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4207    ) -> fidl::client::QueryResponseFut<
4208        RealmOpenControllerResult,
4209        fdomain_client::fidl::FDomainResourceDialect,
4210    > {
4211        RealmProxyInterface::r#open_controller(self, child, controller)
4212    }
4213
4214    /// Opens the exposed directory of a child component. When this function
4215    /// successfully returns, `exposed_dir` is bound to a directory that
4216    /// contains the capabilities which the child exposed to its realm via
4217    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
4218    /// component's manifest). The child component will not start as a result of
4219    /// this call.
4220    ///
4221    /// `exposed_dir` is open as long as `child` exists.
4222    ///
4223    /// Errors:
4224    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4225    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4226    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
4227    /// - `INSTANCE_DIED`: This realm no longer exists.
4228    pub fn r#open_exposed_dir(
4229        &self,
4230        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4231        mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4232    ) -> fidl::client::QueryResponseFut<
4233        RealmOpenExposedDirResult,
4234        fdomain_client::fidl::FDomainResourceDialect,
4235    > {
4236        RealmProxyInterface::r#open_exposed_dir(self, child, exposed_dir)
4237    }
4238
4239    /// Creates a child component instance dynamically. When this function
4240    /// returns successfully, the instance exists, but it may not be running.
4241    ///
4242    /// The environment of the child instance is determined by the environment
4243    /// of the collection. `decl` must not set `environment`.
4244    ///
4245    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
4246    /// [CreateChild] will start the component and return once the component is
4247    /// started. Otherwise, [CreateChild] will return immediately after creating
4248    /// the component and will not start or resolve it.
4249    ///
4250    /// Errors:
4251    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
4252    ///   is not a valid declaration.
4253    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4254    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
4255    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
4256    ///   in a `SingleRun` collection.
4257    /// - `NO_SPACE`: Could not allocate storage for the new instance.
4258    /// - `INSTANCE_DIED`: This realm no longer exists.
4259    pub fn r#create_child(
4260        &self,
4261        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
4262        mut decl: &fdomain_fuchsia_component_decl::Child,
4263        mut args: CreateChildArgs,
4264    ) -> fidl::client::QueryResponseFut<
4265        RealmCreateChildResult,
4266        fdomain_client::fidl::FDomainResourceDialect,
4267    > {
4268        RealmProxyInterface::r#create_child(self, collection, decl, args)
4269    }
4270
4271    /// Destroys a dynamically-created component instance. When this function
4272    /// returns, the instance is destroyed and has stopped running.  However,
4273    /// cleanup of the component's resources (such as its isolated storage) may
4274    /// happen in the background after this function returns.
4275    ///
4276    /// Errors:
4277    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
4278    ///   to a dynamic instance.
4279    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4280    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4281    /// - `INSTANCE_DIED`: This realm no longer exists.
4282    pub fn r#destroy_child(
4283        &self,
4284        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4285    ) -> fidl::client::QueryResponseFut<
4286        RealmDestroyChildResult,
4287        fdomain_client::fidl::FDomainResourceDialect,
4288    > {
4289        RealmProxyInterface::r#destroy_child(self, child)
4290    }
4291
4292    /// Returns an iterator that lists all instances in a collection.
4293    ///
4294    /// NOTE: The results are not guaranteed to be consistent. Instances may be
4295    /// created or destroyed while the iterator is live, but those changes
4296    /// won't be observed by the iterator after this method returns.
4297    ///
4298    /// Errors:
4299    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
4300    /// does not have `ZX_RIGHT_WAIT`.
4301    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4302    /// - `INSTANCE_DIED`: This realm no longer exists.
4303    /// - If `iter` does not have standard channel rights, this function may
4304    ///   return `ACCESS_DENIED` or component manager may close `iter`.
4305    pub fn r#list_children(
4306        &self,
4307        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
4308        mut iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4309    ) -> fidl::client::QueryResponseFut<
4310        RealmListChildrenResult,
4311        fdomain_client::fidl::FDomainResourceDialect,
4312    > {
4313        RealmProxyInterface::r#list_children(self, collection, iter)
4314    }
4315
4316    /// Returns the set of information that was given to the component framework
4317    /// by this component's resolver.
4318    pub fn r#get_resolved_info(
4319        &self,
4320    ) -> fidl::client::QueryResponseFut<
4321        RealmGetResolvedInfoResult,
4322        fdomain_client::fidl::FDomainResourceDialect,
4323    > {
4324        RealmProxyInterface::r#get_resolved_info(self)
4325    }
4326
4327    pub fn r#get_child_output_dictionary_deprecated(
4328        &self,
4329        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4330    ) -> fidl::client::QueryResponseFut<
4331        RealmGetChildOutputDictionaryDeprecatedResult,
4332        fdomain_client::fidl::FDomainResourceDialect,
4333    > {
4334        RealmProxyInterface::r#get_child_output_dictionary_deprecated(self, child)
4335    }
4336
4337    /// Returns a reference to a child's output dictionary, which may be
4338    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
4339    pub fn r#get_child_output_dictionary(
4340        &self,
4341        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4342    ) -> fidl::client::QueryResponseFut<
4343        RealmGetChildOutputDictionaryResult,
4344        fdomain_client::fidl::FDomainResourceDialect,
4345    > {
4346        RealmProxyInterface::r#get_child_output_dictionary(self, child)
4347    }
4348}
4349
4350impl RealmProxyInterface for RealmProxy {
4351    type OpenControllerResponseFut = fidl::client::QueryResponseFut<
4352        RealmOpenControllerResult,
4353        fdomain_client::fidl::FDomainResourceDialect,
4354    >;
4355    fn r#open_controller(
4356        &self,
4357        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4358        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4359    ) -> Self::OpenControllerResponseFut {
4360        fn _decode(
4361            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4362        ) -> Result<RealmOpenControllerResult, fidl::Error> {
4363            let _response = fidl::client::decode_transaction_body::<
4364                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4365                fdomain_client::fidl::FDomainResourceDialect,
4366                0x7150b7898d1b1180,
4367            >(_buf?)?;
4368            Ok(_response.map(|x| x))
4369        }
4370        self.client.send_query_and_decode::<RealmOpenControllerRequest, RealmOpenControllerResult>(
4371            (child, controller),
4372            0x7150b7898d1b1180,
4373            fidl::encoding::DynamicFlags::empty(),
4374            _decode,
4375        )
4376    }
4377
4378    type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
4379        RealmOpenExposedDirResult,
4380        fdomain_client::fidl::FDomainResourceDialect,
4381    >;
4382    fn r#open_exposed_dir(
4383        &self,
4384        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4385        mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4386    ) -> Self::OpenExposedDirResponseFut {
4387        fn _decode(
4388            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4389        ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
4390            let _response = fidl::client::decode_transaction_body::<
4391                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4392                fdomain_client::fidl::FDomainResourceDialect,
4393                0x7f993235ca59f92c,
4394            >(_buf?)?;
4395            Ok(_response.map(|x| x))
4396        }
4397        self.client.send_query_and_decode::<RealmOpenExposedDirRequest, RealmOpenExposedDirResult>(
4398            (child, exposed_dir),
4399            0x7f993235ca59f92c,
4400            fidl::encoding::DynamicFlags::empty(),
4401            _decode,
4402        )
4403    }
4404
4405    type CreateChildResponseFut = fidl::client::QueryResponseFut<
4406        RealmCreateChildResult,
4407        fdomain_client::fidl::FDomainResourceDialect,
4408    >;
4409    fn r#create_child(
4410        &self,
4411        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
4412        mut decl: &fdomain_fuchsia_component_decl::Child,
4413        mut args: CreateChildArgs,
4414    ) -> Self::CreateChildResponseFut {
4415        fn _decode(
4416            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4417        ) -> Result<RealmCreateChildResult, fidl::Error> {
4418            let _response = fidl::client::decode_transaction_body::<
4419                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4420                fdomain_client::fidl::FDomainResourceDialect,
4421                0x43e48ce8483d7560,
4422            >(_buf?)?;
4423            Ok(_response.map(|x| x))
4424        }
4425        self.client.send_query_and_decode::<RealmCreateChildRequest, RealmCreateChildResult>(
4426            (collection, decl, &mut args),
4427            0x43e48ce8483d7560,
4428            fidl::encoding::DynamicFlags::empty(),
4429            _decode,
4430        )
4431    }
4432
4433    type DestroyChildResponseFut = fidl::client::QueryResponseFut<
4434        RealmDestroyChildResult,
4435        fdomain_client::fidl::FDomainResourceDialect,
4436    >;
4437    fn r#destroy_child(
4438        &self,
4439        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4440    ) -> Self::DestroyChildResponseFut {
4441        fn _decode(
4442            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4443        ) -> Result<RealmDestroyChildResult, fidl::Error> {
4444            let _response = fidl::client::decode_transaction_body::<
4445                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4446                fdomain_client::fidl::FDomainResourceDialect,
4447                0x71d8caf8850c9222,
4448            >(_buf?)?;
4449            Ok(_response.map(|x| x))
4450        }
4451        self.client.send_query_and_decode::<RealmDestroyChildRequest, RealmDestroyChildResult>(
4452            (child,),
4453            0x71d8caf8850c9222,
4454            fidl::encoding::DynamicFlags::empty(),
4455            _decode,
4456        )
4457    }
4458
4459    type ListChildrenResponseFut = fidl::client::QueryResponseFut<
4460        RealmListChildrenResult,
4461        fdomain_client::fidl::FDomainResourceDialect,
4462    >;
4463    fn r#list_children(
4464        &self,
4465        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
4466        mut iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4467    ) -> Self::ListChildrenResponseFut {
4468        fn _decode(
4469            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4470        ) -> Result<RealmListChildrenResult, fidl::Error> {
4471            let _response = fidl::client::decode_transaction_body::<
4472                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4473                fdomain_client::fidl::FDomainResourceDialect,
4474                0x6888a76683efc0a1,
4475            >(_buf?)?;
4476            Ok(_response.map(|x| x))
4477        }
4478        self.client.send_query_and_decode::<RealmListChildrenRequest, RealmListChildrenResult>(
4479            (collection, iter),
4480            0x6888a76683efc0a1,
4481            fidl::encoding::DynamicFlags::empty(),
4482            _decode,
4483        )
4484    }
4485
4486    type GetResolvedInfoResponseFut = fidl::client::QueryResponseFut<
4487        RealmGetResolvedInfoResult,
4488        fdomain_client::fidl::FDomainResourceDialect,
4489    >;
4490    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut {
4491        fn _decode(
4492            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4493        ) -> Result<RealmGetResolvedInfoResult, fidl::Error> {
4494            let _response = fidl::client::decode_transaction_body::<
4495                fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>,
4496                fdomain_client::fidl::FDomainResourceDialect,
4497                0x734f744cb7d210a2,
4498            >(_buf?)?;
4499            Ok(_response.map(|x| x.resolved_info))
4500        }
4501        self.client
4502            .send_query_and_decode::<fidl::encoding::EmptyPayload, RealmGetResolvedInfoResult>(
4503                (),
4504                0x734f744cb7d210a2,
4505                fidl::encoding::DynamicFlags::empty(),
4506                _decode,
4507            )
4508    }
4509
4510    type GetChildOutputDictionaryDeprecatedResponseFut = fidl::client::QueryResponseFut<
4511        RealmGetChildOutputDictionaryDeprecatedResult,
4512        fdomain_client::fidl::FDomainResourceDialect,
4513    >;
4514    fn r#get_child_output_dictionary_deprecated(
4515        &self,
4516        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4517    ) -> Self::GetChildOutputDictionaryDeprecatedResponseFut {
4518        fn _decode(
4519            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4520        ) -> Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error> {
4521            let _response = fidl::client::decode_transaction_body::<
4522                fidl::encoding::ResultType<RealmGetChildOutputDictionaryDeprecatedResponse, Error>,
4523                fdomain_client::fidl::FDomainResourceDialect,
4524                0x39245b02aba94364,
4525            >(_buf?)?;
4526            Ok(_response.map(|x| x.dictionary))
4527        }
4528        self.client.send_query_and_decode::<
4529            RealmGetChildOutputDictionaryDeprecatedRequest,
4530            RealmGetChildOutputDictionaryDeprecatedResult,
4531        >(
4532            (child,),
4533            0x39245b02aba94364,
4534            fidl::encoding::DynamicFlags::empty(),
4535            _decode,
4536        )
4537    }
4538
4539    type GetChildOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
4540        RealmGetChildOutputDictionaryResult,
4541        fdomain_client::fidl::FDomainResourceDialect,
4542    >;
4543    fn r#get_child_output_dictionary(
4544        &self,
4545        mut child: &fdomain_fuchsia_component_decl::ChildRef,
4546    ) -> Self::GetChildOutputDictionaryResponseFut {
4547        fn _decode(
4548            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4549        ) -> Result<RealmGetChildOutputDictionaryResult, fidl::Error> {
4550            let _response = fidl::client::decode_transaction_body::<
4551                fidl::encoding::ResultType<RealmGetChildOutputDictionaryResponse, Error>,
4552                fdomain_client::fidl::FDomainResourceDialect,
4553                0x4259d08d261d5610,
4554            >(_buf?)?;
4555            Ok(_response.map(|x| x.dictionary))
4556        }
4557        self.client.send_query_and_decode::<
4558            RealmGetChildOutputDictionaryRequest,
4559            RealmGetChildOutputDictionaryResult,
4560        >(
4561            (child,),
4562            0x4259d08d261d5610,
4563            fidl::encoding::DynamicFlags::empty(),
4564            _decode,
4565        )
4566    }
4567}
4568
4569pub struct RealmEventStream {
4570    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
4571}
4572
4573impl std::marker::Unpin for RealmEventStream {}
4574
4575impl futures::stream::FusedStream for RealmEventStream {
4576    fn is_terminated(&self) -> bool {
4577        self.event_receiver.is_terminated()
4578    }
4579}
4580
4581impl futures::Stream for RealmEventStream {
4582    type Item = Result<RealmEvent, fidl::Error>;
4583
4584    fn poll_next(
4585        mut self: std::pin::Pin<&mut Self>,
4586        cx: &mut std::task::Context<'_>,
4587    ) -> std::task::Poll<Option<Self::Item>> {
4588        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4589            &mut self.event_receiver,
4590            cx
4591        )?) {
4592            Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
4593            None => std::task::Poll::Ready(None),
4594        }
4595    }
4596}
4597
4598#[derive(Debug)]
4599pub enum RealmEvent {}
4600
4601impl RealmEvent {
4602    /// Decodes a message buffer as a [`RealmEvent`].
4603    fn decode(
4604        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4605    ) -> Result<RealmEvent, fidl::Error> {
4606        let (bytes, _handles) = buf.split_mut();
4607        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4608        debug_assert_eq!(tx_header.tx_id, 0);
4609        match tx_header.ordinal {
4610            _ => Err(fidl::Error::UnknownOrdinal {
4611                ordinal: tx_header.ordinal,
4612                protocol_name: <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4613            }),
4614        }
4615    }
4616}
4617
4618/// A Stream of incoming requests for fuchsia.component/Realm.
4619pub struct RealmRequestStream {
4620    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4621    is_terminated: bool,
4622}
4623
4624impl std::marker::Unpin for RealmRequestStream {}
4625
4626impl futures::stream::FusedStream for RealmRequestStream {
4627    fn is_terminated(&self) -> bool {
4628        self.is_terminated
4629    }
4630}
4631
4632impl fdomain_client::fidl::RequestStream for RealmRequestStream {
4633    type Protocol = RealmMarker;
4634    type ControlHandle = RealmControlHandle;
4635
4636    fn from_channel(channel: fdomain_client::Channel) -> Self {
4637        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4638    }
4639
4640    fn control_handle(&self) -> Self::ControlHandle {
4641        RealmControlHandle { inner: self.inner.clone() }
4642    }
4643
4644    fn into_inner(
4645        self,
4646    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4647    {
4648        (self.inner, self.is_terminated)
4649    }
4650
4651    fn from_inner(
4652        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4653        is_terminated: bool,
4654    ) -> Self {
4655        Self { inner, is_terminated }
4656    }
4657}
4658
4659impl futures::Stream for RealmRequestStream {
4660    type Item = Result<RealmRequest, fidl::Error>;
4661
4662    fn poll_next(
4663        mut self: std::pin::Pin<&mut Self>,
4664        cx: &mut std::task::Context<'_>,
4665    ) -> std::task::Poll<Option<Self::Item>> {
4666        let this = &mut *self;
4667        if this.inner.check_shutdown(cx) {
4668            this.is_terminated = true;
4669            return std::task::Poll::Ready(None);
4670        }
4671        if this.is_terminated {
4672            panic!("polled RealmRequestStream after completion");
4673        }
4674        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4675            |bytes, handles| {
4676                match this.inner.channel().read_etc(cx, bytes, handles) {
4677                    std::task::Poll::Ready(Ok(())) => {}
4678                    std::task::Poll::Pending => return std::task::Poll::Pending,
4679                    std::task::Poll::Ready(Err(None)) => {
4680                        this.is_terminated = true;
4681                        return std::task::Poll::Ready(None);
4682                    }
4683                    std::task::Poll::Ready(Err(Some(e))) => {
4684                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4685                            e.into(),
4686                        ))));
4687                    }
4688                }
4689
4690                // A message has been received from the channel
4691                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4692
4693                std::task::Poll::Ready(Some(match header.ordinal {
4694                    0x7150b7898d1b1180 => {
4695                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4696                        let mut req = fidl::new_empty!(
4697                            RealmOpenControllerRequest,
4698                            fdomain_client::fidl::FDomainResourceDialect
4699                        );
4700                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmOpenControllerRequest>(&header, _body_bytes, handles, &mut req)?;
4701                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4702                        Ok(RealmRequest::OpenController {
4703                            child: req.child,
4704                            controller: req.controller,
4705
4706                            responder: RealmOpenControllerResponder {
4707                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4708                                tx_id: header.tx_id,
4709                            },
4710                        })
4711                    }
4712                    0x7f993235ca59f92c => {
4713                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4714                        let mut req = fidl::new_empty!(
4715                            RealmOpenExposedDirRequest,
4716                            fdomain_client::fidl::FDomainResourceDialect
4717                        );
4718                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
4719                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4720                        Ok(RealmRequest::OpenExposedDir {
4721                            child: req.child,
4722                            exposed_dir: req.exposed_dir,
4723
4724                            responder: RealmOpenExposedDirResponder {
4725                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4726                                tx_id: header.tx_id,
4727                            },
4728                        })
4729                    }
4730                    0x43e48ce8483d7560 => {
4731                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4732                        let mut req = fidl::new_empty!(
4733                            RealmCreateChildRequest,
4734                            fdomain_client::fidl::FDomainResourceDialect
4735                        );
4736                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmCreateChildRequest>(&header, _body_bytes, handles, &mut req)?;
4737                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4738                        Ok(RealmRequest::CreateChild {
4739                            collection: req.collection,
4740                            decl: req.decl,
4741                            args: req.args,
4742
4743                            responder: RealmCreateChildResponder {
4744                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4745                                tx_id: header.tx_id,
4746                            },
4747                        })
4748                    }
4749                    0x71d8caf8850c9222 => {
4750                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4751                        let mut req = fidl::new_empty!(
4752                            RealmDestroyChildRequest,
4753                            fdomain_client::fidl::FDomainResourceDialect
4754                        );
4755                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmDestroyChildRequest>(&header, _body_bytes, handles, &mut req)?;
4756                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4757                        Ok(RealmRequest::DestroyChild {
4758                            child: req.child,
4759
4760                            responder: RealmDestroyChildResponder {
4761                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4762                                tx_id: header.tx_id,
4763                            },
4764                        })
4765                    }
4766                    0x6888a76683efc0a1 => {
4767                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4768                        let mut req = fidl::new_empty!(
4769                            RealmListChildrenRequest,
4770                            fdomain_client::fidl::FDomainResourceDialect
4771                        );
4772                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmListChildrenRequest>(&header, _body_bytes, handles, &mut req)?;
4773                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4774                        Ok(RealmRequest::ListChildren {
4775                            collection: req.collection,
4776                            iter: req.iter,
4777
4778                            responder: RealmListChildrenResponder {
4779                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4780                                tx_id: header.tx_id,
4781                            },
4782                        })
4783                    }
4784                    0x734f744cb7d210a2 => {
4785                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4786                        let mut req = fidl::new_empty!(
4787                            fidl::encoding::EmptyPayload,
4788                            fdomain_client::fidl::FDomainResourceDialect
4789                        );
4790                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4791                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4792                        Ok(RealmRequest::GetResolvedInfo {
4793                            responder: RealmGetResolvedInfoResponder {
4794                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4795                                tx_id: header.tx_id,
4796                            },
4797                        })
4798                    }
4799                    0x39245b02aba94364 => {
4800                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4801                        let mut req = fidl::new_empty!(
4802                            RealmGetChildOutputDictionaryDeprecatedRequest,
4803                            fdomain_client::fidl::FDomainResourceDialect
4804                        );
4805                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmGetChildOutputDictionaryDeprecatedRequest>(&header, _body_bytes, handles, &mut req)?;
4806                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4807                        Ok(RealmRequest::GetChildOutputDictionaryDeprecated {
4808                            child: req.child,
4809
4810                            responder: RealmGetChildOutputDictionaryDeprecatedResponder {
4811                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4812                                tx_id: header.tx_id,
4813                            },
4814                        })
4815                    }
4816                    0x4259d08d261d5610 => {
4817                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4818                        let mut req = fidl::new_empty!(
4819                            RealmGetChildOutputDictionaryRequest,
4820                            fdomain_client::fidl::FDomainResourceDialect
4821                        );
4822                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmGetChildOutputDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
4823                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4824                        Ok(RealmRequest::GetChildOutputDictionary {
4825                            child: req.child,
4826
4827                            responder: RealmGetChildOutputDictionaryResponder {
4828                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4829                                tx_id: header.tx_id,
4830                            },
4831                        })
4832                    }
4833                    _ => Err(fidl::Error::UnknownOrdinal {
4834                        ordinal: header.ordinal,
4835                        protocol_name:
4836                            <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4837                    }),
4838                }))
4839            },
4840        )
4841    }
4842}
4843
4844/// A protocol used by a component instance to manage its own realm, such as for
4845/// binding to its children.
4846///
4847/// Requests to this protocol are processed in the order they are received.
4848/// Clients that wish to send requests in parallel should open multiple
4849/// connections.
4850///
4851/// The component framework provides this service to components that use
4852/// `fuchsia.component.Realm`.
4853#[derive(Debug)]
4854pub enum RealmRequest {
4855    /// Operate on a child component. See documentation for [`Controller`].
4856    ///
4857    /// Errors:
4858    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4859    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4860    /// - `INSTANCE_DIED`: This realm no longer exists.
4861    OpenController {
4862        child: fdomain_fuchsia_component_decl::ChildRef,
4863        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4864        responder: RealmOpenControllerResponder,
4865    },
4866    /// Opens the exposed directory of a child component. When this function
4867    /// successfully returns, `exposed_dir` is bound to a directory that
4868    /// contains the capabilities which the child exposed to its realm via
4869    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
4870    /// component's manifest). The child component will not start as a result of
4871    /// this call.
4872    ///
4873    /// `exposed_dir` is open as long as `child` exists.
4874    ///
4875    /// Errors:
4876    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4877    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4878    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
4879    /// - `INSTANCE_DIED`: This realm no longer exists.
4880    OpenExposedDir {
4881        child: fdomain_fuchsia_component_decl::ChildRef,
4882        exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4883        responder: RealmOpenExposedDirResponder,
4884    },
4885    /// Creates a child component instance dynamically. When this function
4886    /// returns successfully, the instance exists, but it may not be running.
4887    ///
4888    /// The environment of the child instance is determined by the environment
4889    /// of the collection. `decl` must not set `environment`.
4890    ///
4891    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
4892    /// [CreateChild] will start the component and return once the component is
4893    /// started. Otherwise, [CreateChild] will return immediately after creating
4894    /// the component and will not start or resolve it.
4895    ///
4896    /// Errors:
4897    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
4898    ///   is not a valid declaration.
4899    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4900    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
4901    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
4902    ///   in a `SingleRun` collection.
4903    /// - `NO_SPACE`: Could not allocate storage for the new instance.
4904    /// - `INSTANCE_DIED`: This realm no longer exists.
4905    CreateChild {
4906        collection: fdomain_fuchsia_component_decl::CollectionRef,
4907        decl: fdomain_fuchsia_component_decl::Child,
4908        args: CreateChildArgs,
4909        responder: RealmCreateChildResponder,
4910    },
4911    /// Destroys a dynamically-created component instance. When this function
4912    /// returns, the instance is destroyed and has stopped running.  However,
4913    /// cleanup of the component's resources (such as its isolated storage) may
4914    /// happen in the background after this function returns.
4915    ///
4916    /// Errors:
4917    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
4918    ///   to a dynamic instance.
4919    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4920    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4921    /// - `INSTANCE_DIED`: This realm no longer exists.
4922    DestroyChild {
4923        child: fdomain_fuchsia_component_decl::ChildRef,
4924        responder: RealmDestroyChildResponder,
4925    },
4926    /// Returns an iterator that lists all instances in a collection.
4927    ///
4928    /// NOTE: The results are not guaranteed to be consistent. Instances may be
4929    /// created or destroyed while the iterator is live, but those changes
4930    /// won't be observed by the iterator after this method returns.
4931    ///
4932    /// Errors:
4933    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
4934    /// does not have `ZX_RIGHT_WAIT`.
4935    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4936    /// - `INSTANCE_DIED`: This realm no longer exists.
4937    /// - If `iter` does not have standard channel rights, this function may
4938    ///   return `ACCESS_DENIED` or component manager may close `iter`.
4939    ListChildren {
4940        collection: fdomain_fuchsia_component_decl::CollectionRef,
4941        iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4942        responder: RealmListChildrenResponder,
4943    },
4944    /// Returns the set of information that was given to the component framework
4945    /// by this component's resolver.
4946    GetResolvedInfo { responder: RealmGetResolvedInfoResponder },
4947    GetChildOutputDictionaryDeprecated {
4948        child: fdomain_fuchsia_component_decl::ChildRef,
4949        responder: RealmGetChildOutputDictionaryDeprecatedResponder,
4950    },
4951    /// Returns a reference to a child's output dictionary, which may be
4952    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
4953    GetChildOutputDictionary {
4954        child: fdomain_fuchsia_component_decl::ChildRef,
4955        responder: RealmGetChildOutputDictionaryResponder,
4956    },
4957}
4958
4959impl RealmRequest {
4960    #[allow(irrefutable_let_patterns)]
4961    pub fn into_open_controller(
4962        self,
4963    ) -> Option<(
4964        fdomain_fuchsia_component_decl::ChildRef,
4965        fdomain_client::fidl::ServerEnd<ControllerMarker>,
4966        RealmOpenControllerResponder,
4967    )> {
4968        if let RealmRequest::OpenController { child, controller, responder } = self {
4969            Some((child, controller, responder))
4970        } else {
4971            None
4972        }
4973    }
4974
4975    #[allow(irrefutable_let_patterns)]
4976    pub fn into_open_exposed_dir(
4977        self,
4978    ) -> Option<(
4979        fdomain_fuchsia_component_decl::ChildRef,
4980        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4981        RealmOpenExposedDirResponder,
4982    )> {
4983        if let RealmRequest::OpenExposedDir { child, exposed_dir, responder } = self {
4984            Some((child, exposed_dir, responder))
4985        } else {
4986            None
4987        }
4988    }
4989
4990    #[allow(irrefutable_let_patterns)]
4991    pub fn into_create_child(
4992        self,
4993    ) -> Option<(
4994        fdomain_fuchsia_component_decl::CollectionRef,
4995        fdomain_fuchsia_component_decl::Child,
4996        CreateChildArgs,
4997        RealmCreateChildResponder,
4998    )> {
4999        if let RealmRequest::CreateChild { collection, decl, args, responder } = self {
5000            Some((collection, decl, args, responder))
5001        } else {
5002            None
5003        }
5004    }
5005
5006    #[allow(irrefutable_let_patterns)]
5007    pub fn into_destroy_child(
5008        self,
5009    ) -> Option<(fdomain_fuchsia_component_decl::ChildRef, RealmDestroyChildResponder)> {
5010        if let RealmRequest::DestroyChild { child, responder } = self {
5011            Some((child, responder))
5012        } else {
5013            None
5014        }
5015    }
5016
5017    #[allow(irrefutable_let_patterns)]
5018    pub fn into_list_children(
5019        self,
5020    ) -> Option<(
5021        fdomain_fuchsia_component_decl::CollectionRef,
5022        fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
5023        RealmListChildrenResponder,
5024    )> {
5025        if let RealmRequest::ListChildren { collection, iter, responder } = self {
5026            Some((collection, iter, responder))
5027        } else {
5028            None
5029        }
5030    }
5031
5032    #[allow(irrefutable_let_patterns)]
5033    pub fn into_get_resolved_info(self) -> Option<(RealmGetResolvedInfoResponder)> {
5034        if let RealmRequest::GetResolvedInfo { responder } = self {
5035            Some((responder))
5036        } else {
5037            None
5038        }
5039    }
5040
5041    #[allow(irrefutable_let_patterns)]
5042    pub fn into_get_child_output_dictionary_deprecated(
5043        self,
5044    ) -> Option<(
5045        fdomain_fuchsia_component_decl::ChildRef,
5046        RealmGetChildOutputDictionaryDeprecatedResponder,
5047    )> {
5048        if let RealmRequest::GetChildOutputDictionaryDeprecated { child, responder } = self {
5049            Some((child, responder))
5050        } else {
5051            None
5052        }
5053    }
5054
5055    #[allow(irrefutable_let_patterns)]
5056    pub fn into_get_child_output_dictionary(
5057        self,
5058    ) -> Option<(fdomain_fuchsia_component_decl::ChildRef, RealmGetChildOutputDictionaryResponder)>
5059    {
5060        if let RealmRequest::GetChildOutputDictionary { child, responder } = self {
5061            Some((child, responder))
5062        } else {
5063            None
5064        }
5065    }
5066
5067    /// Name of the method defined in FIDL
5068    pub fn method_name(&self) -> &'static str {
5069        match *self {
5070            RealmRequest::OpenController { .. } => "open_controller",
5071            RealmRequest::OpenExposedDir { .. } => "open_exposed_dir",
5072            RealmRequest::CreateChild { .. } => "create_child",
5073            RealmRequest::DestroyChild { .. } => "destroy_child",
5074            RealmRequest::ListChildren { .. } => "list_children",
5075            RealmRequest::GetResolvedInfo { .. } => "get_resolved_info",
5076            RealmRequest::GetChildOutputDictionaryDeprecated { .. } => {
5077                "get_child_output_dictionary_deprecated"
5078            }
5079            RealmRequest::GetChildOutputDictionary { .. } => "get_child_output_dictionary",
5080        }
5081    }
5082}
5083
5084#[derive(Debug, Clone)]
5085pub struct RealmControlHandle {
5086    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5087}
5088
5089impl fdomain_client::fidl::ControlHandle for RealmControlHandle {
5090    fn shutdown(&self) {
5091        self.inner.shutdown()
5092    }
5093
5094    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5095        self.inner.shutdown_with_epitaph(status)
5096    }
5097
5098    fn is_closed(&self) -> bool {
5099        self.inner.channel().is_closed()
5100    }
5101    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5102        self.inner.channel().on_closed()
5103    }
5104}
5105
5106impl RealmControlHandle {}
5107
5108#[must_use = "FIDL methods require a response to be sent"]
5109#[derive(Debug)]
5110pub struct RealmOpenControllerResponder {
5111    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5112    tx_id: u32,
5113}
5114
5115/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5116/// if the responder is dropped without sending a response, so that the client
5117/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5118impl std::ops::Drop for RealmOpenControllerResponder {
5119    fn drop(&mut self) {
5120        self.control_handle.shutdown();
5121        // Safety: drops once, never accessed again
5122        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5123    }
5124}
5125
5126impl fdomain_client::fidl::Responder for RealmOpenControllerResponder {
5127    type ControlHandle = RealmControlHandle;
5128
5129    fn control_handle(&self) -> &RealmControlHandle {
5130        &self.control_handle
5131    }
5132
5133    fn drop_without_shutdown(mut self) {
5134        // Safety: drops once, never accessed again due to mem::forget
5135        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5136        // Prevent Drop from running (which would shut down the channel)
5137        std::mem::forget(self);
5138    }
5139}
5140
5141impl RealmOpenControllerResponder {
5142    /// Sends a response to the FIDL transaction.
5143    ///
5144    /// Sets the channel to shutdown if an error occurs.
5145    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5146        let _result = self.send_raw(result);
5147        if _result.is_err() {
5148            self.control_handle.shutdown();
5149        }
5150        self.drop_without_shutdown();
5151        _result
5152    }
5153
5154    /// Similar to "send" but does not shutdown the channel if an error occurs.
5155    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5156        let _result = self.send_raw(result);
5157        self.drop_without_shutdown();
5158        _result
5159    }
5160
5161    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5162        self.control_handle
5163            .inner
5164            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5165                result,
5166                self.tx_id,
5167                0x7150b7898d1b1180,
5168                fidl::encoding::DynamicFlags::empty(),
5169            )
5170    }
5171}
5172
5173#[must_use = "FIDL methods require a response to be sent"]
5174#[derive(Debug)]
5175pub struct RealmOpenExposedDirResponder {
5176    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5177    tx_id: u32,
5178}
5179
5180/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5181/// if the responder is dropped without sending a response, so that the client
5182/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5183impl std::ops::Drop for RealmOpenExposedDirResponder {
5184    fn drop(&mut self) {
5185        self.control_handle.shutdown();
5186        // Safety: drops once, never accessed again
5187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5188    }
5189}
5190
5191impl fdomain_client::fidl::Responder for RealmOpenExposedDirResponder {
5192    type ControlHandle = RealmControlHandle;
5193
5194    fn control_handle(&self) -> &RealmControlHandle {
5195        &self.control_handle
5196    }
5197
5198    fn drop_without_shutdown(mut self) {
5199        // Safety: drops once, never accessed again due to mem::forget
5200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5201        // Prevent Drop from running (which would shut down the channel)
5202        std::mem::forget(self);
5203    }
5204}
5205
5206impl RealmOpenExposedDirResponder {
5207    /// Sends a response to the FIDL transaction.
5208    ///
5209    /// Sets the channel to shutdown if an error occurs.
5210    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5211        let _result = self.send_raw(result);
5212        if _result.is_err() {
5213            self.control_handle.shutdown();
5214        }
5215        self.drop_without_shutdown();
5216        _result
5217    }
5218
5219    /// Similar to "send" but does not shutdown the channel if an error occurs.
5220    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5221        let _result = self.send_raw(result);
5222        self.drop_without_shutdown();
5223        _result
5224    }
5225
5226    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5227        self.control_handle
5228            .inner
5229            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5230                result,
5231                self.tx_id,
5232                0x7f993235ca59f92c,
5233                fidl::encoding::DynamicFlags::empty(),
5234            )
5235    }
5236}
5237
5238#[must_use = "FIDL methods require a response to be sent"]
5239#[derive(Debug)]
5240pub struct RealmCreateChildResponder {
5241    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5242    tx_id: u32,
5243}
5244
5245/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5246/// if the responder is dropped without sending a response, so that the client
5247/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5248impl std::ops::Drop for RealmCreateChildResponder {
5249    fn drop(&mut self) {
5250        self.control_handle.shutdown();
5251        // Safety: drops once, never accessed again
5252        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5253    }
5254}
5255
5256impl fdomain_client::fidl::Responder for RealmCreateChildResponder {
5257    type ControlHandle = RealmControlHandle;
5258
5259    fn control_handle(&self) -> &RealmControlHandle {
5260        &self.control_handle
5261    }
5262
5263    fn drop_without_shutdown(mut self) {
5264        // Safety: drops once, never accessed again due to mem::forget
5265        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5266        // Prevent Drop from running (which would shut down the channel)
5267        std::mem::forget(self);
5268    }
5269}
5270
5271impl RealmCreateChildResponder {
5272    /// Sends a response to the FIDL transaction.
5273    ///
5274    /// Sets the channel to shutdown if an error occurs.
5275    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5276        let _result = self.send_raw(result);
5277        if _result.is_err() {
5278            self.control_handle.shutdown();
5279        }
5280        self.drop_without_shutdown();
5281        _result
5282    }
5283
5284    /// Similar to "send" but does not shutdown the channel if an error occurs.
5285    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5286        let _result = self.send_raw(result);
5287        self.drop_without_shutdown();
5288        _result
5289    }
5290
5291    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5292        self.control_handle
5293            .inner
5294            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5295                result,
5296                self.tx_id,
5297                0x43e48ce8483d7560,
5298                fidl::encoding::DynamicFlags::empty(),
5299            )
5300    }
5301}
5302
5303#[must_use = "FIDL methods require a response to be sent"]
5304#[derive(Debug)]
5305pub struct RealmDestroyChildResponder {
5306    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5307    tx_id: u32,
5308}
5309
5310/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5311/// if the responder is dropped without sending a response, so that the client
5312/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5313impl std::ops::Drop for RealmDestroyChildResponder {
5314    fn drop(&mut self) {
5315        self.control_handle.shutdown();
5316        // Safety: drops once, never accessed again
5317        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5318    }
5319}
5320
5321impl fdomain_client::fidl::Responder for RealmDestroyChildResponder {
5322    type ControlHandle = RealmControlHandle;
5323
5324    fn control_handle(&self) -> &RealmControlHandle {
5325        &self.control_handle
5326    }
5327
5328    fn drop_without_shutdown(mut self) {
5329        // Safety: drops once, never accessed again due to mem::forget
5330        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5331        // Prevent Drop from running (which would shut down the channel)
5332        std::mem::forget(self);
5333    }
5334}
5335
5336impl RealmDestroyChildResponder {
5337    /// Sends a response to the FIDL transaction.
5338    ///
5339    /// Sets the channel to shutdown if an error occurs.
5340    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5341        let _result = self.send_raw(result);
5342        if _result.is_err() {
5343            self.control_handle.shutdown();
5344        }
5345        self.drop_without_shutdown();
5346        _result
5347    }
5348
5349    /// Similar to "send" but does not shutdown the channel if an error occurs.
5350    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5351        let _result = self.send_raw(result);
5352        self.drop_without_shutdown();
5353        _result
5354    }
5355
5356    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5357        self.control_handle
5358            .inner
5359            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5360                result,
5361                self.tx_id,
5362                0x71d8caf8850c9222,
5363                fidl::encoding::DynamicFlags::empty(),
5364            )
5365    }
5366}
5367
5368#[must_use = "FIDL methods require a response to be sent"]
5369#[derive(Debug)]
5370pub struct RealmListChildrenResponder {
5371    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5372    tx_id: u32,
5373}
5374
5375/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5376/// if the responder is dropped without sending a response, so that the client
5377/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5378impl std::ops::Drop for RealmListChildrenResponder {
5379    fn drop(&mut self) {
5380        self.control_handle.shutdown();
5381        // Safety: drops once, never accessed again
5382        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5383    }
5384}
5385
5386impl fdomain_client::fidl::Responder for RealmListChildrenResponder {
5387    type ControlHandle = RealmControlHandle;
5388
5389    fn control_handle(&self) -> &RealmControlHandle {
5390        &self.control_handle
5391    }
5392
5393    fn drop_without_shutdown(mut self) {
5394        // Safety: drops once, never accessed again due to mem::forget
5395        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5396        // Prevent Drop from running (which would shut down the channel)
5397        std::mem::forget(self);
5398    }
5399}
5400
5401impl RealmListChildrenResponder {
5402    /// Sends a response to the FIDL transaction.
5403    ///
5404    /// Sets the channel to shutdown if an error occurs.
5405    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5406        let _result = self.send_raw(result);
5407        if _result.is_err() {
5408            self.control_handle.shutdown();
5409        }
5410        self.drop_without_shutdown();
5411        _result
5412    }
5413
5414    /// Similar to "send" but does not shutdown the channel if an error occurs.
5415    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5416        let _result = self.send_raw(result);
5417        self.drop_without_shutdown();
5418        _result
5419    }
5420
5421    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5422        self.control_handle
5423            .inner
5424            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5425                result,
5426                self.tx_id,
5427                0x6888a76683efc0a1,
5428                fidl::encoding::DynamicFlags::empty(),
5429            )
5430    }
5431}
5432
5433#[must_use = "FIDL methods require a response to be sent"]
5434#[derive(Debug)]
5435pub struct RealmGetResolvedInfoResponder {
5436    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5437    tx_id: u32,
5438}
5439
5440/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5441/// if the responder is dropped without sending a response, so that the client
5442/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5443impl std::ops::Drop for RealmGetResolvedInfoResponder {
5444    fn drop(&mut self) {
5445        self.control_handle.shutdown();
5446        // Safety: drops once, never accessed again
5447        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5448    }
5449}
5450
5451impl fdomain_client::fidl::Responder for RealmGetResolvedInfoResponder {
5452    type ControlHandle = RealmControlHandle;
5453
5454    fn control_handle(&self) -> &RealmControlHandle {
5455        &self.control_handle
5456    }
5457
5458    fn drop_without_shutdown(mut self) {
5459        // Safety: drops once, never accessed again due to mem::forget
5460        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5461        // Prevent Drop from running (which would shut down the channel)
5462        std::mem::forget(self);
5463    }
5464}
5465
5466impl RealmGetResolvedInfoResponder {
5467    /// Sends a response to the FIDL transaction.
5468    ///
5469    /// Sets the channel to shutdown if an error occurs.
5470    pub fn send(
5471        self,
5472        mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
5473    ) -> Result<(), fidl::Error> {
5474        let _result = self.send_raw(result);
5475        if _result.is_err() {
5476            self.control_handle.shutdown();
5477        }
5478        self.drop_without_shutdown();
5479        _result
5480    }
5481
5482    /// Similar to "send" but does not shutdown the channel if an error occurs.
5483    pub fn send_no_shutdown_on_err(
5484        self,
5485        mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
5486    ) -> Result<(), fidl::Error> {
5487        let _result = self.send_raw(result);
5488        self.drop_without_shutdown();
5489        _result
5490    }
5491
5492    fn send_raw(
5493        &self,
5494        mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
5495    ) -> Result<(), fidl::Error> {
5496        self.control_handle
5497            .inner
5498            .send::<fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>>(
5499                result.as_mut().map_err(|e| *e).map(|resolved_info| (resolved_info,)),
5500                self.tx_id,
5501                0x734f744cb7d210a2,
5502                fidl::encoding::DynamicFlags::empty(),
5503            )
5504    }
5505}
5506
5507#[must_use = "FIDL methods require a response to be sent"]
5508#[derive(Debug)]
5509pub struct RealmGetChildOutputDictionaryDeprecatedResponder {
5510    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5511    tx_id: u32,
5512}
5513
5514/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5515/// if the responder is dropped without sending a response, so that the client
5516/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5517impl std::ops::Drop for RealmGetChildOutputDictionaryDeprecatedResponder {
5518    fn drop(&mut self) {
5519        self.control_handle.shutdown();
5520        // Safety: drops once, never accessed again
5521        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5522    }
5523}
5524
5525impl fdomain_client::fidl::Responder for RealmGetChildOutputDictionaryDeprecatedResponder {
5526    type ControlHandle = RealmControlHandle;
5527
5528    fn control_handle(&self) -> &RealmControlHandle {
5529        &self.control_handle
5530    }
5531
5532    fn drop_without_shutdown(mut self) {
5533        // Safety: drops once, never accessed again due to mem::forget
5534        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5535        // Prevent Drop from running (which would shut down the channel)
5536        std::mem::forget(self);
5537    }
5538}
5539
5540impl RealmGetChildOutputDictionaryDeprecatedResponder {
5541    /// Sends a response to the FIDL transaction.
5542    ///
5543    /// Sets the channel to shutdown if an error occurs.
5544    pub fn send(
5545        self,
5546        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
5547    ) -> Result<(), fidl::Error> {
5548        let _result = self.send_raw(result);
5549        if _result.is_err() {
5550            self.control_handle.shutdown();
5551        }
5552        self.drop_without_shutdown();
5553        _result
5554    }
5555
5556    /// Similar to "send" but does not shutdown the channel if an error occurs.
5557    pub fn send_no_shutdown_on_err(
5558        self,
5559        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
5560    ) -> Result<(), fidl::Error> {
5561        let _result = self.send_raw(result);
5562        self.drop_without_shutdown();
5563        _result
5564    }
5565
5566    fn send_raw(
5567        &self,
5568        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
5569    ) -> Result<(), fidl::Error> {
5570        self.control_handle.inner.send::<fidl::encoding::ResultType<
5571            RealmGetChildOutputDictionaryDeprecatedResponse,
5572            Error,
5573        >>(
5574            result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
5575            self.tx_id,
5576            0x39245b02aba94364,
5577            fidl::encoding::DynamicFlags::empty(),
5578        )
5579    }
5580}
5581
5582#[must_use = "FIDL methods require a response to be sent"]
5583#[derive(Debug)]
5584pub struct RealmGetChildOutputDictionaryResponder {
5585    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
5586    tx_id: u32,
5587}
5588
5589/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
5590/// if the responder is dropped without sending a response, so that the client
5591/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5592impl std::ops::Drop for RealmGetChildOutputDictionaryResponder {
5593    fn drop(&mut self) {
5594        self.control_handle.shutdown();
5595        // Safety: drops once, never accessed again
5596        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5597    }
5598}
5599
5600impl fdomain_client::fidl::Responder for RealmGetChildOutputDictionaryResponder {
5601    type ControlHandle = RealmControlHandle;
5602
5603    fn control_handle(&self) -> &RealmControlHandle {
5604        &self.control_handle
5605    }
5606
5607    fn drop_without_shutdown(mut self) {
5608        // Safety: drops once, never accessed again due to mem::forget
5609        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5610        // Prevent Drop from running (which would shut down the channel)
5611        std::mem::forget(self);
5612    }
5613}
5614
5615impl RealmGetChildOutputDictionaryResponder {
5616    /// Sends a response to the FIDL transaction.
5617    ///
5618    /// Sets the channel to shutdown if an error occurs.
5619    pub fn send(
5620        self,
5621        mut result: Result<fdomain_client::EventPair, Error>,
5622    ) -> Result<(), fidl::Error> {
5623        let _result = self.send_raw(result);
5624        if _result.is_err() {
5625            self.control_handle.shutdown();
5626        }
5627        self.drop_without_shutdown();
5628        _result
5629    }
5630
5631    /// Similar to "send" but does not shutdown the channel if an error occurs.
5632    pub fn send_no_shutdown_on_err(
5633        self,
5634        mut result: Result<fdomain_client::EventPair, Error>,
5635    ) -> Result<(), fidl::Error> {
5636        let _result = self.send_raw(result);
5637        self.drop_without_shutdown();
5638        _result
5639    }
5640
5641    fn send_raw(
5642        &self,
5643        mut result: Result<fdomain_client::EventPair, Error>,
5644    ) -> Result<(), fidl::Error> {
5645        self.control_handle.inner.send::<fidl::encoding::ResultType<
5646            RealmGetChildOutputDictionaryResponse,
5647            Error,
5648        >>(
5649            result.map(|dictionary| (dictionary,)),
5650            self.tx_id,
5651            0x4259d08d261d5610,
5652            fidl::encoding::DynamicFlags::empty(),
5653        )
5654    }
5655}
5656
5657#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5658pub struct StorageAdminMarker;
5659
5660impl fdomain_client::fidl::ProtocolMarker for StorageAdminMarker {
5661    type Proxy = StorageAdminProxy;
5662    type RequestStream = StorageAdminRequestStream;
5663
5664    const DEBUG_NAME: &'static str = "fuchsia.component.StorageAdmin";
5665}
5666impl fdomain_client::fidl::DiscoverableProtocolMarker for StorageAdminMarker {}
5667pub type StorageAdminOpenStorageResult = Result<(), Error>;
5668pub type StorageAdminListStorageInRealmResult = Result<(), Error>;
5669pub type StorageAdminOpenComponentStorageByIdResult = Result<(), Error>;
5670pub type StorageAdminDeleteComponentStorageResult = Result<(), Error>;
5671pub type StorageAdminGetStatusResult = Result<StorageStatus, StatusError>;
5672pub type StorageAdminDeleteAllStorageContentsResult = Result<(), DeletionError>;
5673
5674pub trait StorageAdminProxyInterface: Send + Sync {
5675    type OpenStorageResponseFut: std::future::Future<Output = Result<StorageAdminOpenStorageResult, fidl::Error>>
5676        + Send;
5677    fn r#open_storage(
5678        &self,
5679        relative_moniker: &str,
5680        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5681    ) -> Self::OpenStorageResponseFut;
5682    type ListStorageInRealmResponseFut: std::future::Future<Output = Result<StorageAdminListStorageInRealmResult, fidl::Error>>
5683        + Send;
5684    fn r#list_storage_in_realm(
5685        &self,
5686        relative_moniker: &str,
5687        iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
5688    ) -> Self::ListStorageInRealmResponseFut;
5689    type OpenComponentStorageByIdResponseFut: std::future::Future<
5690            Output = Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error>,
5691        > + Send;
5692    fn r#open_component_storage_by_id(
5693        &self,
5694        id: &str,
5695        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5696    ) -> Self::OpenComponentStorageByIdResponseFut;
5697    type DeleteComponentStorageResponseFut: std::future::Future<Output = Result<StorageAdminDeleteComponentStorageResult, fidl::Error>>
5698        + Send;
5699    fn r#delete_component_storage(
5700        &self,
5701        relative_moniker: &str,
5702    ) -> Self::DeleteComponentStorageResponseFut;
5703    type GetStatusResponseFut: std::future::Future<Output = Result<StorageAdminGetStatusResult, fidl::Error>>
5704        + Send;
5705    fn r#get_status(&self) -> Self::GetStatusResponseFut;
5706    type DeleteAllStorageContentsResponseFut: std::future::Future<
5707            Output = Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error>,
5708        > + Send;
5709    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut;
5710}
5711
5712#[derive(Debug, Clone)]
5713pub struct StorageAdminProxy {
5714    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
5715}
5716
5717impl fdomain_client::fidl::Proxy for StorageAdminProxy {
5718    type Protocol = StorageAdminMarker;
5719
5720    fn from_channel(inner: fdomain_client::Channel) -> Self {
5721        Self::new(inner)
5722    }
5723
5724    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
5725        self.client.into_channel().map_err(|client| Self { client })
5726    }
5727
5728    fn as_channel(&self) -> &fdomain_client::Channel {
5729        self.client.as_channel()
5730    }
5731}
5732
5733impl StorageAdminProxy {
5734    /// Create a new Proxy for fuchsia.component/StorageAdmin.
5735    pub fn new(channel: fdomain_client::Channel) -> Self {
5736        let protocol_name =
5737            <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5738        Self { client: fidl::client::Client::new(channel, protocol_name) }
5739    }
5740
5741    /// Get a Stream of events from the remote end of the protocol.
5742    ///
5743    /// # Panics
5744    ///
5745    /// Panics if the event stream was already taken.
5746    pub fn take_event_stream(&self) -> StorageAdminEventStream {
5747        StorageAdminEventStream { event_receiver: self.client.take_event_receiver() }
5748    }
5749
5750    /// Opens the isolated directory for the given component. The provided
5751    /// moniker is relative to the component that declares the storage
5752    /// capability. Creates the backing sub-directory for this storage if it
5753    /// hasn't yet been created.
5754    pub fn r#open_storage(
5755        &self,
5756        mut relative_moniker: &str,
5757        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5758    ) -> fidl::client::QueryResponseFut<
5759        StorageAdminOpenStorageResult,
5760        fdomain_client::fidl::FDomainResourceDialect,
5761    > {
5762        StorageAdminProxyInterface::r#open_storage(self, relative_moniker, object)
5763    }
5764
5765    /// Lists the descendant components under the specified realm that use the
5766    /// storage capability. The provided moniker is relative to the component
5767    /// that declares the storage capability.
5768    ///
5769    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
5770    /// if |relative_moniker| is malformed.
5771    pub fn r#list_storage_in_realm(
5772        &self,
5773        mut relative_moniker: &str,
5774        mut iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
5775    ) -> fidl::client::QueryResponseFut<
5776        StorageAdminListStorageInRealmResult,
5777        fdomain_client::fidl::FDomainResourceDialect,
5778    > {
5779        StorageAdminProxyInterface::r#list_storage_in_realm(self, relative_moniker, iterator)
5780    }
5781
5782    /// Opens the isolated directory for the given storage ID. Creates the
5783    /// backing sub-directory for this storage if it hasn't yet been created.
5784    pub fn r#open_component_storage_by_id(
5785        &self,
5786        mut id: &str,
5787        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5788    ) -> fidl::client::QueryResponseFut<
5789        StorageAdminOpenComponentStorageByIdResult,
5790        fdomain_client::fidl::FDomainResourceDialect,
5791    > {
5792        StorageAdminProxyInterface::r#open_component_storage_by_id(self, id, object)
5793    }
5794
5795    /// Deletes the contents of the storage for this component. Preserves the
5796    /// component's subdirectory itself within the storage backing directory.
5797    /// The provided moniker is relative to the component that declares the
5798    /// storage capability.
5799    pub fn r#delete_component_storage(
5800        &self,
5801        mut relative_moniker: &str,
5802    ) -> fidl::client::QueryResponseFut<
5803        StorageAdminDeleteComponentStorageResult,
5804        fdomain_client::fidl::FDomainResourceDialect,
5805    > {
5806        StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
5807    }
5808
5809    /// Get the current status of the storage.
5810    pub fn r#get_status(
5811        &self,
5812    ) -> fidl::client::QueryResponseFut<
5813        StorageAdminGetStatusResult,
5814        fdomain_client::fidl::FDomainResourceDialect,
5815    > {
5816        StorageAdminProxyInterface::r#get_status(self)
5817    }
5818
5819    /// Deletes the contents of all the storage. Storage directories are
5820    /// retained so any components using storage will be able to continue using
5821    /// it to create new files and directories.
5822    ///
5823    /// Returns Error::INTERNAL only if no storage at all could be cleared.
5824    /// Returns successfully even if some errors happen during the deletion
5825    /// progress.
5826    pub fn r#delete_all_storage_contents(
5827        &self,
5828    ) -> fidl::client::QueryResponseFut<
5829        StorageAdminDeleteAllStorageContentsResult,
5830        fdomain_client::fidl::FDomainResourceDialect,
5831    > {
5832        StorageAdminProxyInterface::r#delete_all_storage_contents(self)
5833    }
5834}
5835
5836impl StorageAdminProxyInterface for StorageAdminProxy {
5837    type OpenStorageResponseFut = fidl::client::QueryResponseFut<
5838        StorageAdminOpenStorageResult,
5839        fdomain_client::fidl::FDomainResourceDialect,
5840    >;
5841    fn r#open_storage(
5842        &self,
5843        mut relative_moniker: &str,
5844        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5845    ) -> Self::OpenStorageResponseFut {
5846        fn _decode(
5847            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5848        ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
5849            let _response = fidl::client::decode_transaction_body::<
5850                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5851                fdomain_client::fidl::FDomainResourceDialect,
5852                0x6ceaa5904cfe4377,
5853            >(_buf?)?;
5854            Ok(_response.map(|x| x))
5855        }
5856        self.client
5857            .send_query_and_decode::<StorageAdminOpenStorageRequest, StorageAdminOpenStorageResult>(
5858                (relative_moniker, object),
5859                0x6ceaa5904cfe4377,
5860                fidl::encoding::DynamicFlags::empty(),
5861                _decode,
5862            )
5863    }
5864
5865    type ListStorageInRealmResponseFut = fidl::client::QueryResponseFut<
5866        StorageAdminListStorageInRealmResult,
5867        fdomain_client::fidl::FDomainResourceDialect,
5868    >;
5869    fn r#list_storage_in_realm(
5870        &self,
5871        mut relative_moniker: &str,
5872        mut iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
5873    ) -> Self::ListStorageInRealmResponseFut {
5874        fn _decode(
5875            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5876        ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
5877            let _response = fidl::client::decode_transaction_body::<
5878                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5879                fdomain_client::fidl::FDomainResourceDialect,
5880                0x764f6d1f083e8bfb,
5881            >(_buf?)?;
5882            Ok(_response.map(|x| x))
5883        }
5884        self.client.send_query_and_decode::<
5885            StorageAdminListStorageInRealmRequest,
5886            StorageAdminListStorageInRealmResult,
5887        >(
5888            (relative_moniker, iterator,),
5889            0x764f6d1f083e8bfb,
5890            fidl::encoding::DynamicFlags::empty(),
5891            _decode,
5892        )
5893    }
5894
5895    type OpenComponentStorageByIdResponseFut = fidl::client::QueryResponseFut<
5896        StorageAdminOpenComponentStorageByIdResult,
5897        fdomain_client::fidl::FDomainResourceDialect,
5898    >;
5899    fn r#open_component_storage_by_id(
5900        &self,
5901        mut id: &str,
5902        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5903    ) -> Self::OpenComponentStorageByIdResponseFut {
5904        fn _decode(
5905            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5906        ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
5907            let _response = fidl::client::decode_transaction_body::<
5908                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5909                fdomain_client::fidl::FDomainResourceDialect,
5910                0x4802102cc55d5df1,
5911            >(_buf?)?;
5912            Ok(_response.map(|x| x))
5913        }
5914        self.client.send_query_and_decode::<
5915            StorageAdminOpenComponentStorageByIdRequest,
5916            StorageAdminOpenComponentStorageByIdResult,
5917        >(
5918            (id, object,),
5919            0x4802102cc55d5df1,
5920            fidl::encoding::DynamicFlags::empty(),
5921            _decode,
5922        )
5923    }
5924
5925    type DeleteComponentStorageResponseFut = fidl::client::QueryResponseFut<
5926        StorageAdminDeleteComponentStorageResult,
5927        fdomain_client::fidl::FDomainResourceDialect,
5928    >;
5929    fn r#delete_component_storage(
5930        &self,
5931        mut relative_moniker: &str,
5932    ) -> Self::DeleteComponentStorageResponseFut {
5933        fn _decode(
5934            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5935        ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
5936            let _response = fidl::client::decode_transaction_body::<
5937                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5938                fdomain_client::fidl::FDomainResourceDialect,
5939                0x1677c1cdfcdbf45a,
5940            >(_buf?)?;
5941            Ok(_response.map(|x| x))
5942        }
5943        self.client.send_query_and_decode::<
5944            StorageAdminDeleteComponentStorageRequest,
5945            StorageAdminDeleteComponentStorageResult,
5946        >(
5947            (relative_moniker,),
5948            0x1677c1cdfcdbf45a,
5949            fidl::encoding::DynamicFlags::empty(),
5950            _decode,
5951        )
5952    }
5953
5954    type GetStatusResponseFut = fidl::client::QueryResponseFut<
5955        StorageAdminGetStatusResult,
5956        fdomain_client::fidl::FDomainResourceDialect,
5957    >;
5958    fn r#get_status(&self) -> Self::GetStatusResponseFut {
5959        fn _decode(
5960            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5961        ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
5962            let _response = fidl::client::decode_transaction_body::<
5963                fidl::encoding::ResultType<StorageStatus, StatusError>,
5964                fdomain_client::fidl::FDomainResourceDialect,
5965                0x7729e325a6c526c8,
5966            >(_buf?)?;
5967            Ok(_response.map(|x| x))
5968        }
5969        self.client
5970            .send_query_and_decode::<fidl::encoding::EmptyPayload, StorageAdminGetStatusResult>(
5971                (),
5972                0x7729e325a6c526c8,
5973                fidl::encoding::DynamicFlags::empty(),
5974                _decode,
5975            )
5976    }
5977
5978    type DeleteAllStorageContentsResponseFut = fidl::client::QueryResponseFut<
5979        StorageAdminDeleteAllStorageContentsResult,
5980        fdomain_client::fidl::FDomainResourceDialect,
5981    >;
5982    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
5983        fn _decode(
5984            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5985        ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
5986            let _response = fidl::client::decode_transaction_body::<
5987                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
5988                fdomain_client::fidl::FDomainResourceDialect,
5989                0x2ee980b4b2d24adb,
5990            >(_buf?)?;
5991            Ok(_response.map(|x| x))
5992        }
5993        self.client.send_query_and_decode::<
5994            fidl::encoding::EmptyPayload,
5995            StorageAdminDeleteAllStorageContentsResult,
5996        >(
5997            (),
5998            0x2ee980b4b2d24adb,
5999            fidl::encoding::DynamicFlags::empty(),
6000            _decode,
6001        )
6002    }
6003}
6004
6005pub struct StorageAdminEventStream {
6006    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6007}
6008
6009impl std::marker::Unpin for StorageAdminEventStream {}
6010
6011impl futures::stream::FusedStream for StorageAdminEventStream {
6012    fn is_terminated(&self) -> bool {
6013        self.event_receiver.is_terminated()
6014    }
6015}
6016
6017impl futures::Stream for StorageAdminEventStream {
6018    type Item = Result<StorageAdminEvent, fidl::Error>;
6019
6020    fn poll_next(
6021        mut self: std::pin::Pin<&mut Self>,
6022        cx: &mut std::task::Context<'_>,
6023    ) -> std::task::Poll<Option<Self::Item>> {
6024        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6025            &mut self.event_receiver,
6026            cx
6027        )?) {
6028            Some(buf) => std::task::Poll::Ready(Some(StorageAdminEvent::decode(buf))),
6029            None => std::task::Poll::Ready(None),
6030        }
6031    }
6032}
6033
6034#[derive(Debug)]
6035pub enum StorageAdminEvent {}
6036
6037impl StorageAdminEvent {
6038    /// Decodes a message buffer as a [`StorageAdminEvent`].
6039    fn decode(
6040        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6041    ) -> Result<StorageAdminEvent, fidl::Error> {
6042        let (bytes, _handles) = buf.split_mut();
6043        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6044        debug_assert_eq!(tx_header.tx_id, 0);
6045        match tx_header.ordinal {
6046            _ => Err(fidl::Error::UnknownOrdinal {
6047                ordinal: tx_header.ordinal,
6048                protocol_name:
6049                    <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6050            }),
6051        }
6052    }
6053}
6054
6055/// A Stream of incoming requests for fuchsia.component/StorageAdmin.
6056pub struct StorageAdminRequestStream {
6057    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6058    is_terminated: bool,
6059}
6060
6061impl std::marker::Unpin for StorageAdminRequestStream {}
6062
6063impl futures::stream::FusedStream for StorageAdminRequestStream {
6064    fn is_terminated(&self) -> bool {
6065        self.is_terminated
6066    }
6067}
6068
6069impl fdomain_client::fidl::RequestStream for StorageAdminRequestStream {
6070    type Protocol = StorageAdminMarker;
6071    type ControlHandle = StorageAdminControlHandle;
6072
6073    fn from_channel(channel: fdomain_client::Channel) -> Self {
6074        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6075    }
6076
6077    fn control_handle(&self) -> Self::ControlHandle {
6078        StorageAdminControlHandle { inner: self.inner.clone() }
6079    }
6080
6081    fn into_inner(
6082        self,
6083    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6084    {
6085        (self.inner, self.is_terminated)
6086    }
6087
6088    fn from_inner(
6089        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6090        is_terminated: bool,
6091    ) -> Self {
6092        Self { inner, is_terminated }
6093    }
6094}
6095
6096impl futures::Stream for StorageAdminRequestStream {
6097    type Item = Result<StorageAdminRequest, fidl::Error>;
6098
6099    fn poll_next(
6100        mut self: std::pin::Pin<&mut Self>,
6101        cx: &mut std::task::Context<'_>,
6102    ) -> std::task::Poll<Option<Self::Item>> {
6103        let this = &mut *self;
6104        if this.inner.check_shutdown(cx) {
6105            this.is_terminated = true;
6106            return std::task::Poll::Ready(None);
6107        }
6108        if this.is_terminated {
6109            panic!("polled StorageAdminRequestStream after completion");
6110        }
6111        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6112            |bytes, handles| {
6113                match this.inner.channel().read_etc(cx, bytes, handles) {
6114                    std::task::Poll::Ready(Ok(())) => {}
6115                    std::task::Poll::Pending => return std::task::Poll::Pending,
6116                    std::task::Poll::Ready(Err(None)) => {
6117                        this.is_terminated = true;
6118                        return std::task::Poll::Ready(None);
6119                    }
6120                    std::task::Poll::Ready(Err(Some(e))) => {
6121                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6122                            e.into(),
6123                        ))));
6124                    }
6125                }
6126
6127                // A message has been received from the channel
6128                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6129
6130                std::task::Poll::Ready(Some(match header.ordinal {
6131                    0x6ceaa5904cfe4377 => {
6132                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6133                        let mut req = fidl::new_empty!(
6134                            StorageAdminOpenStorageRequest,
6135                            fdomain_client::fidl::FDomainResourceDialect
6136                        );
6137                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminOpenStorageRequest>(&header, _body_bytes, handles, &mut req)?;
6138                        let control_handle =
6139                            StorageAdminControlHandle { inner: this.inner.clone() };
6140                        Ok(StorageAdminRequest::OpenStorage {
6141                            relative_moniker: req.relative_moniker,
6142                            object: req.object,
6143
6144                            responder: StorageAdminOpenStorageResponder {
6145                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6146                                tx_id: header.tx_id,
6147                            },
6148                        })
6149                    }
6150                    0x764f6d1f083e8bfb => {
6151                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6152                        let mut req = fidl::new_empty!(
6153                            StorageAdminListStorageInRealmRequest,
6154                            fdomain_client::fidl::FDomainResourceDialect
6155                        );
6156                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminListStorageInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
6157                        let control_handle =
6158                            StorageAdminControlHandle { inner: this.inner.clone() };
6159                        Ok(StorageAdminRequest::ListStorageInRealm {
6160                            relative_moniker: req.relative_moniker,
6161                            iterator: req.iterator,
6162
6163                            responder: StorageAdminListStorageInRealmResponder {
6164                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6165                                tx_id: header.tx_id,
6166                            },
6167                        })
6168                    }
6169                    0x4802102cc55d5df1 => {
6170                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6171                        let mut req = fidl::new_empty!(
6172                            StorageAdminOpenComponentStorageByIdRequest,
6173                            fdomain_client::fidl::FDomainResourceDialect
6174                        );
6175                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminOpenComponentStorageByIdRequest>(&header, _body_bytes, handles, &mut req)?;
6176                        let control_handle =
6177                            StorageAdminControlHandle { inner: this.inner.clone() };
6178                        Ok(StorageAdminRequest::OpenComponentStorageById {
6179                            id: req.id,
6180                            object: req.object,
6181
6182                            responder: StorageAdminOpenComponentStorageByIdResponder {
6183                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6184                                tx_id: header.tx_id,
6185                            },
6186                        })
6187                    }
6188                    0x1677c1cdfcdbf45a => {
6189                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6190                        let mut req = fidl::new_empty!(
6191                            StorageAdminDeleteComponentStorageRequest,
6192                            fdomain_client::fidl::FDomainResourceDialect
6193                        );
6194                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminDeleteComponentStorageRequest>(&header, _body_bytes, handles, &mut req)?;
6195                        let control_handle =
6196                            StorageAdminControlHandle { inner: this.inner.clone() };
6197                        Ok(StorageAdminRequest::DeleteComponentStorage {
6198                            relative_moniker: req.relative_moniker,
6199
6200                            responder: StorageAdminDeleteComponentStorageResponder {
6201                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6202                                tx_id: header.tx_id,
6203                            },
6204                        })
6205                    }
6206                    0x7729e325a6c526c8 => {
6207                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6208                        let mut req = fidl::new_empty!(
6209                            fidl::encoding::EmptyPayload,
6210                            fdomain_client::fidl::FDomainResourceDialect
6211                        );
6212                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6213                        let control_handle =
6214                            StorageAdminControlHandle { inner: this.inner.clone() };
6215                        Ok(StorageAdminRequest::GetStatus {
6216                            responder: StorageAdminGetStatusResponder {
6217                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6218                                tx_id: header.tx_id,
6219                            },
6220                        })
6221                    }
6222                    0x2ee980b4b2d24adb => {
6223                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6224                        let mut req = fidl::new_empty!(
6225                            fidl::encoding::EmptyPayload,
6226                            fdomain_client::fidl::FDomainResourceDialect
6227                        );
6228                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6229                        let control_handle =
6230                            StorageAdminControlHandle { inner: this.inner.clone() };
6231                        Ok(StorageAdminRequest::DeleteAllStorageContents {
6232                            responder: StorageAdminDeleteAllStorageContentsResponder {
6233                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6234                                tx_id: header.tx_id,
6235                            },
6236                        })
6237                    }
6238                    _ => Err(fidl::Error::UnknownOrdinal {
6239                        ordinal: header.ordinal,
6240                        protocol_name:
6241                            <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6242                    }),
6243                }))
6244            },
6245        )
6246    }
6247}
6248
6249#[derive(Debug)]
6250pub enum StorageAdminRequest {
6251    /// Opens the isolated directory for the given component. The provided
6252    /// moniker is relative to the component that declares the storage
6253    /// capability. Creates the backing sub-directory for this storage if it
6254    /// hasn't yet been created.
6255    OpenStorage {
6256        relative_moniker: String,
6257        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6258        responder: StorageAdminOpenStorageResponder,
6259    },
6260    /// Lists the descendant components under the specified realm that use the
6261    /// storage capability. The provided moniker is relative to the component
6262    /// that declares the storage capability.
6263    ///
6264    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
6265    /// if |relative_moniker| is malformed.
6266    ListStorageInRealm {
6267        relative_moniker: String,
6268        iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
6269        responder: StorageAdminListStorageInRealmResponder,
6270    },
6271    /// Opens the isolated directory for the given storage ID. Creates the
6272    /// backing sub-directory for this storage if it hasn't yet been created.
6273    OpenComponentStorageById {
6274        id: String,
6275        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6276        responder: StorageAdminOpenComponentStorageByIdResponder,
6277    },
6278    /// Deletes the contents of the storage for this component. Preserves the
6279    /// component's subdirectory itself within the storage backing directory.
6280    /// The provided moniker is relative to the component that declares the
6281    /// storage capability.
6282    DeleteComponentStorage {
6283        relative_moniker: String,
6284        responder: StorageAdminDeleteComponentStorageResponder,
6285    },
6286    /// Get the current status of the storage.
6287    GetStatus { responder: StorageAdminGetStatusResponder },
6288    /// Deletes the contents of all the storage. Storage directories are
6289    /// retained so any components using storage will be able to continue using
6290    /// it to create new files and directories.
6291    ///
6292    /// Returns Error::INTERNAL only if no storage at all could be cleared.
6293    /// Returns successfully even if some errors happen during the deletion
6294    /// progress.
6295    DeleteAllStorageContents { responder: StorageAdminDeleteAllStorageContentsResponder },
6296}
6297
6298impl StorageAdminRequest {
6299    #[allow(irrefutable_let_patterns)]
6300    pub fn into_open_storage(
6301        self,
6302    ) -> Option<(
6303        String,
6304        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6305        StorageAdminOpenStorageResponder,
6306    )> {
6307        if let StorageAdminRequest::OpenStorage { relative_moniker, object, responder } = self {
6308            Some((relative_moniker, object, responder))
6309        } else {
6310            None
6311        }
6312    }
6313
6314    #[allow(irrefutable_let_patterns)]
6315    pub fn into_list_storage_in_realm(
6316        self,
6317    ) -> Option<(
6318        String,
6319        fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
6320        StorageAdminListStorageInRealmResponder,
6321    )> {
6322        if let StorageAdminRequest::ListStorageInRealm { relative_moniker, iterator, responder } =
6323            self
6324        {
6325            Some((relative_moniker, iterator, responder))
6326        } else {
6327            None
6328        }
6329    }
6330
6331    #[allow(irrefutable_let_patterns)]
6332    pub fn into_open_component_storage_by_id(
6333        self,
6334    ) -> Option<(
6335        String,
6336        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
6337        StorageAdminOpenComponentStorageByIdResponder,
6338    )> {
6339        if let StorageAdminRequest::OpenComponentStorageById { id, object, responder } = self {
6340            Some((id, object, responder))
6341        } else {
6342            None
6343        }
6344    }
6345
6346    #[allow(irrefutable_let_patterns)]
6347    pub fn into_delete_component_storage(
6348        self,
6349    ) -> Option<(String, StorageAdminDeleteComponentStorageResponder)> {
6350        if let StorageAdminRequest::DeleteComponentStorage { relative_moniker, responder } = self {
6351            Some((relative_moniker, responder))
6352        } else {
6353            None
6354        }
6355    }
6356
6357    #[allow(irrefutable_let_patterns)]
6358    pub fn into_get_status(self) -> Option<(StorageAdminGetStatusResponder)> {
6359        if let StorageAdminRequest::GetStatus { responder } = self {
6360            Some((responder))
6361        } else {
6362            None
6363        }
6364    }
6365
6366    #[allow(irrefutable_let_patterns)]
6367    pub fn into_delete_all_storage_contents(
6368        self,
6369    ) -> Option<(StorageAdminDeleteAllStorageContentsResponder)> {
6370        if let StorageAdminRequest::DeleteAllStorageContents { responder } = self {
6371            Some((responder))
6372        } else {
6373            None
6374        }
6375    }
6376
6377    /// Name of the method defined in FIDL
6378    pub fn method_name(&self) -> &'static str {
6379        match *self {
6380            StorageAdminRequest::OpenStorage { .. } => "open_storage",
6381            StorageAdminRequest::ListStorageInRealm { .. } => "list_storage_in_realm",
6382            StorageAdminRequest::OpenComponentStorageById { .. } => "open_component_storage_by_id",
6383            StorageAdminRequest::DeleteComponentStorage { .. } => "delete_component_storage",
6384            StorageAdminRequest::GetStatus { .. } => "get_status",
6385            StorageAdminRequest::DeleteAllStorageContents { .. } => "delete_all_storage_contents",
6386        }
6387    }
6388}
6389
6390#[derive(Debug, Clone)]
6391pub struct StorageAdminControlHandle {
6392    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6393}
6394
6395impl fdomain_client::fidl::ControlHandle for StorageAdminControlHandle {
6396    fn shutdown(&self) {
6397        self.inner.shutdown()
6398    }
6399
6400    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6401        self.inner.shutdown_with_epitaph(status)
6402    }
6403
6404    fn is_closed(&self) -> bool {
6405        self.inner.channel().is_closed()
6406    }
6407    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6408        self.inner.channel().on_closed()
6409    }
6410}
6411
6412impl StorageAdminControlHandle {}
6413
6414#[must_use = "FIDL methods require a response to be sent"]
6415#[derive(Debug)]
6416pub struct StorageAdminOpenStorageResponder {
6417    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6418    tx_id: u32,
6419}
6420
6421/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
6422/// if the responder is dropped without sending a response, so that the client
6423/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6424impl std::ops::Drop for StorageAdminOpenStorageResponder {
6425    fn drop(&mut self) {
6426        self.control_handle.shutdown();
6427        // Safety: drops once, never accessed again
6428        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6429    }
6430}
6431
6432impl fdomain_client::fidl::Responder for StorageAdminOpenStorageResponder {
6433    type ControlHandle = StorageAdminControlHandle;
6434
6435    fn control_handle(&self) -> &StorageAdminControlHandle {
6436        &self.control_handle
6437    }
6438
6439    fn drop_without_shutdown(mut self) {
6440        // Safety: drops once, never accessed again due to mem::forget
6441        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6442        // Prevent Drop from running (which would shut down the channel)
6443        std::mem::forget(self);
6444    }
6445}
6446
6447impl StorageAdminOpenStorageResponder {
6448    /// Sends a response to the FIDL transaction.
6449    ///
6450    /// Sets the channel to shutdown if an error occurs.
6451    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6452        let _result = self.send_raw(result);
6453        if _result.is_err() {
6454            self.control_handle.shutdown();
6455        }
6456        self.drop_without_shutdown();
6457        _result
6458    }
6459
6460    /// Similar to "send" but does not shutdown the channel if an error occurs.
6461    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6462        let _result = self.send_raw(result);
6463        self.drop_without_shutdown();
6464        _result
6465    }
6466
6467    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6468        self.control_handle
6469            .inner
6470            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6471                result,
6472                self.tx_id,
6473                0x6ceaa5904cfe4377,
6474                fidl::encoding::DynamicFlags::empty(),
6475            )
6476    }
6477}
6478
6479#[must_use = "FIDL methods require a response to be sent"]
6480#[derive(Debug)]
6481pub struct StorageAdminListStorageInRealmResponder {
6482    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6483    tx_id: u32,
6484}
6485
6486/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
6487/// if the responder is dropped without sending a response, so that the client
6488/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6489impl std::ops::Drop for StorageAdminListStorageInRealmResponder {
6490    fn drop(&mut self) {
6491        self.control_handle.shutdown();
6492        // Safety: drops once, never accessed again
6493        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6494    }
6495}
6496
6497impl fdomain_client::fidl::Responder for StorageAdminListStorageInRealmResponder {
6498    type ControlHandle = StorageAdminControlHandle;
6499
6500    fn control_handle(&self) -> &StorageAdminControlHandle {
6501        &self.control_handle
6502    }
6503
6504    fn drop_without_shutdown(mut self) {
6505        // Safety: drops once, never accessed again due to mem::forget
6506        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6507        // Prevent Drop from running (which would shut down the channel)
6508        std::mem::forget(self);
6509    }
6510}
6511
6512impl StorageAdminListStorageInRealmResponder {
6513    /// Sends a response to the FIDL transaction.
6514    ///
6515    /// Sets the channel to shutdown if an error occurs.
6516    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6517        let _result = self.send_raw(result);
6518        if _result.is_err() {
6519            self.control_handle.shutdown();
6520        }
6521        self.drop_without_shutdown();
6522        _result
6523    }
6524
6525    /// Similar to "send" but does not shutdown the channel if an error occurs.
6526    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6527        let _result = self.send_raw(result);
6528        self.drop_without_shutdown();
6529        _result
6530    }
6531
6532    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6533        self.control_handle
6534            .inner
6535            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6536                result,
6537                self.tx_id,
6538                0x764f6d1f083e8bfb,
6539                fidl::encoding::DynamicFlags::empty(),
6540            )
6541    }
6542}
6543
6544#[must_use = "FIDL methods require a response to be sent"]
6545#[derive(Debug)]
6546pub struct StorageAdminOpenComponentStorageByIdResponder {
6547    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6548    tx_id: u32,
6549}
6550
6551/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
6552/// if the responder is dropped without sending a response, so that the client
6553/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6554impl std::ops::Drop for StorageAdminOpenComponentStorageByIdResponder {
6555    fn drop(&mut self) {
6556        self.control_handle.shutdown();
6557        // Safety: drops once, never accessed again
6558        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6559    }
6560}
6561
6562impl fdomain_client::fidl::Responder for StorageAdminOpenComponentStorageByIdResponder {
6563    type ControlHandle = StorageAdminControlHandle;
6564
6565    fn control_handle(&self) -> &StorageAdminControlHandle {
6566        &self.control_handle
6567    }
6568
6569    fn drop_without_shutdown(mut self) {
6570        // Safety: drops once, never accessed again due to mem::forget
6571        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6572        // Prevent Drop from running (which would shut down the channel)
6573        std::mem::forget(self);
6574    }
6575}
6576
6577impl StorageAdminOpenComponentStorageByIdResponder {
6578    /// Sends a response to the FIDL transaction.
6579    ///
6580    /// Sets the channel to shutdown if an error occurs.
6581    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6582        let _result = self.send_raw(result);
6583        if _result.is_err() {
6584            self.control_handle.shutdown();
6585        }
6586        self.drop_without_shutdown();
6587        _result
6588    }
6589
6590    /// Similar to "send" but does not shutdown the channel if an error occurs.
6591    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6592        let _result = self.send_raw(result);
6593        self.drop_without_shutdown();
6594        _result
6595    }
6596
6597    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6598        self.control_handle
6599            .inner
6600            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6601                result,
6602                self.tx_id,
6603                0x4802102cc55d5df1,
6604                fidl::encoding::DynamicFlags::empty(),
6605            )
6606    }
6607}
6608
6609#[must_use = "FIDL methods require a response to be sent"]
6610#[derive(Debug)]
6611pub struct StorageAdminDeleteComponentStorageResponder {
6612    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6613    tx_id: u32,
6614}
6615
6616/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
6617/// if the responder is dropped without sending a response, so that the client
6618/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6619impl std::ops::Drop for StorageAdminDeleteComponentStorageResponder {
6620    fn drop(&mut self) {
6621        self.control_handle.shutdown();
6622        // Safety: drops once, never accessed again
6623        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6624    }
6625}
6626
6627impl fdomain_client::fidl::Responder for StorageAdminDeleteComponentStorageResponder {
6628    type ControlHandle = StorageAdminControlHandle;
6629
6630    fn control_handle(&self) -> &StorageAdminControlHandle {
6631        &self.control_handle
6632    }
6633
6634    fn drop_without_shutdown(mut self) {
6635        // Safety: drops once, never accessed again due to mem::forget
6636        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6637        // Prevent Drop from running (which would shut down the channel)
6638        std::mem::forget(self);
6639    }
6640}
6641
6642impl StorageAdminDeleteComponentStorageResponder {
6643    /// Sends a response to the FIDL transaction.
6644    ///
6645    /// Sets the channel to shutdown if an error occurs.
6646    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6647        let _result = self.send_raw(result);
6648        if _result.is_err() {
6649            self.control_handle.shutdown();
6650        }
6651        self.drop_without_shutdown();
6652        _result
6653    }
6654
6655    /// Similar to "send" but does not shutdown the channel if an error occurs.
6656    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6657        let _result = self.send_raw(result);
6658        self.drop_without_shutdown();
6659        _result
6660    }
6661
6662    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6663        self.control_handle
6664            .inner
6665            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6666                result,
6667                self.tx_id,
6668                0x1677c1cdfcdbf45a,
6669                fidl::encoding::DynamicFlags::empty(),
6670            )
6671    }
6672}
6673
6674#[must_use = "FIDL methods require a response to be sent"]
6675#[derive(Debug)]
6676pub struct StorageAdminGetStatusResponder {
6677    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6678    tx_id: u32,
6679}
6680
6681/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
6682/// if the responder is dropped without sending a response, so that the client
6683/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6684impl std::ops::Drop for StorageAdminGetStatusResponder {
6685    fn drop(&mut self) {
6686        self.control_handle.shutdown();
6687        // Safety: drops once, never accessed again
6688        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6689    }
6690}
6691
6692impl fdomain_client::fidl::Responder for StorageAdminGetStatusResponder {
6693    type ControlHandle = StorageAdminControlHandle;
6694
6695    fn control_handle(&self) -> &StorageAdminControlHandle {
6696        &self.control_handle
6697    }
6698
6699    fn drop_without_shutdown(mut self) {
6700        // Safety: drops once, never accessed again due to mem::forget
6701        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6702        // Prevent Drop from running (which would shut down the channel)
6703        std::mem::forget(self);
6704    }
6705}
6706
6707impl StorageAdminGetStatusResponder {
6708    /// Sends a response to the FIDL transaction.
6709    ///
6710    /// Sets the channel to shutdown if an error occurs.
6711    pub fn send(self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
6712        let _result = self.send_raw(result);
6713        if _result.is_err() {
6714            self.control_handle.shutdown();
6715        }
6716        self.drop_without_shutdown();
6717        _result
6718    }
6719
6720    /// Similar to "send" but does not shutdown the channel if an error occurs.
6721    pub fn send_no_shutdown_on_err(
6722        self,
6723        mut result: Result<&StorageStatus, StatusError>,
6724    ) -> Result<(), fidl::Error> {
6725        let _result = self.send_raw(result);
6726        self.drop_without_shutdown();
6727        _result
6728    }
6729
6730    fn send_raw(&self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
6731        self.control_handle.inner.send::<fidl::encoding::ResultType<StorageStatus, StatusError>>(
6732            result,
6733            self.tx_id,
6734            0x7729e325a6c526c8,
6735            fidl::encoding::DynamicFlags::empty(),
6736        )
6737    }
6738}
6739
6740#[must_use = "FIDL methods require a response to be sent"]
6741#[derive(Debug)]
6742pub struct StorageAdminDeleteAllStorageContentsResponder {
6743    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6744    tx_id: u32,
6745}
6746
6747/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
6748/// if the responder is dropped without sending a response, so that the client
6749/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6750impl std::ops::Drop for StorageAdminDeleteAllStorageContentsResponder {
6751    fn drop(&mut self) {
6752        self.control_handle.shutdown();
6753        // Safety: drops once, never accessed again
6754        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6755    }
6756}
6757
6758impl fdomain_client::fidl::Responder for StorageAdminDeleteAllStorageContentsResponder {
6759    type ControlHandle = StorageAdminControlHandle;
6760
6761    fn control_handle(&self) -> &StorageAdminControlHandle {
6762        &self.control_handle
6763    }
6764
6765    fn drop_without_shutdown(mut self) {
6766        // Safety: drops once, never accessed again due to mem::forget
6767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6768        // Prevent Drop from running (which would shut down the channel)
6769        std::mem::forget(self);
6770    }
6771}
6772
6773impl StorageAdminDeleteAllStorageContentsResponder {
6774    /// Sends a response to the FIDL transaction.
6775    ///
6776    /// Sets the channel to shutdown if an error occurs.
6777    pub fn send(self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
6778        let _result = self.send_raw(result);
6779        if _result.is_err() {
6780            self.control_handle.shutdown();
6781        }
6782        self.drop_without_shutdown();
6783        _result
6784    }
6785
6786    /// Similar to "send" but does not shutdown the channel if an error occurs.
6787    pub fn send_no_shutdown_on_err(
6788        self,
6789        mut result: Result<(), DeletionError>,
6790    ) -> Result<(), fidl::Error> {
6791        let _result = self.send_raw(result);
6792        self.drop_without_shutdown();
6793        _result
6794    }
6795
6796    fn send_raw(&self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
6797        self.control_handle.inner.send::<fidl::encoding::ResultType<
6798            fidl::encoding::EmptyStruct,
6799            DeletionError,
6800        >>(
6801            result,
6802            self.tx_id,
6803            0x2ee980b4b2d24adb,
6804            fidl::encoding::DynamicFlags::empty(),
6805        )
6806    }
6807}
6808
6809#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6810pub struct StorageIteratorMarker;
6811
6812impl fdomain_client::fidl::ProtocolMarker for StorageIteratorMarker {
6813    type Proxy = StorageIteratorProxy;
6814    type RequestStream = StorageIteratorRequestStream;
6815
6816    const DEBUG_NAME: &'static str = "(anonymous) StorageIterator";
6817}
6818
6819pub trait StorageIteratorProxyInterface: Send + Sync {
6820    type NextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6821    fn r#next(&self) -> Self::NextResponseFut;
6822}
6823
6824#[derive(Debug, Clone)]
6825pub struct StorageIteratorProxy {
6826    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6827}
6828
6829impl fdomain_client::fidl::Proxy for StorageIteratorProxy {
6830    type Protocol = StorageIteratorMarker;
6831
6832    fn from_channel(inner: fdomain_client::Channel) -> Self {
6833        Self::new(inner)
6834    }
6835
6836    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6837        self.client.into_channel().map_err(|client| Self { client })
6838    }
6839
6840    fn as_channel(&self) -> &fdomain_client::Channel {
6841        self.client.as_channel()
6842    }
6843}
6844
6845impl StorageIteratorProxy {
6846    /// Create a new Proxy for fuchsia.component/StorageIterator.
6847    pub fn new(channel: fdomain_client::Channel) -> Self {
6848        let protocol_name =
6849            <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6850        Self { client: fidl::client::Client::new(channel, protocol_name) }
6851    }
6852
6853    /// Get a Stream of events from the remote end of the protocol.
6854    ///
6855    /// # Panics
6856    ///
6857    /// Panics if the event stream was already taken.
6858    pub fn take_event_stream(&self) -> StorageIteratorEventStream {
6859        StorageIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6860    }
6861
6862    /// Retrieve the next set of components using the storage capability. The
6863    /// returned monikers are relative to the component that declares the
6864    /// storage capability. Returns an empty vector after all components have
6865    /// been returned.
6866    pub fn r#next(
6867        &self,
6868    ) -> fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>
6869    {
6870        StorageIteratorProxyInterface::r#next(self)
6871    }
6872}
6873
6874impl StorageIteratorProxyInterface for StorageIteratorProxy {
6875    type NextResponseFut =
6876        fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>;
6877    fn r#next(&self) -> Self::NextResponseFut {
6878        fn _decode(
6879            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6880        ) -> Result<Vec<String>, fidl::Error> {
6881            let _response = fidl::client::decode_transaction_body::<
6882                StorageIteratorNextResponse,
6883                fdomain_client::fidl::FDomainResourceDialect,
6884                0x7a6b21f15fd01b72,
6885            >(_buf?)?;
6886            Ok(_response.relative_monikers)
6887        }
6888        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6889            (),
6890            0x7a6b21f15fd01b72,
6891            fidl::encoding::DynamicFlags::empty(),
6892            _decode,
6893        )
6894    }
6895}
6896
6897pub struct StorageIteratorEventStream {
6898    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6899}
6900
6901impl std::marker::Unpin for StorageIteratorEventStream {}
6902
6903impl futures::stream::FusedStream for StorageIteratorEventStream {
6904    fn is_terminated(&self) -> bool {
6905        self.event_receiver.is_terminated()
6906    }
6907}
6908
6909impl futures::Stream for StorageIteratorEventStream {
6910    type Item = Result<StorageIteratorEvent, fidl::Error>;
6911
6912    fn poll_next(
6913        mut self: std::pin::Pin<&mut Self>,
6914        cx: &mut std::task::Context<'_>,
6915    ) -> std::task::Poll<Option<Self::Item>> {
6916        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6917            &mut self.event_receiver,
6918            cx
6919        )?) {
6920            Some(buf) => std::task::Poll::Ready(Some(StorageIteratorEvent::decode(buf))),
6921            None => std::task::Poll::Ready(None),
6922        }
6923    }
6924}
6925
6926#[derive(Debug)]
6927pub enum StorageIteratorEvent {}
6928
6929impl StorageIteratorEvent {
6930    /// Decodes a message buffer as a [`StorageIteratorEvent`].
6931    fn decode(
6932        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6933    ) -> Result<StorageIteratorEvent, fidl::Error> {
6934        let (bytes, _handles) = buf.split_mut();
6935        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6936        debug_assert_eq!(tx_header.tx_id, 0);
6937        match tx_header.ordinal {
6938            _ => Err(fidl::Error::UnknownOrdinal {
6939                ordinal: tx_header.ordinal,
6940                protocol_name:
6941                    <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6942            }),
6943        }
6944    }
6945}
6946
6947/// A Stream of incoming requests for fuchsia.component/StorageIterator.
6948pub struct StorageIteratorRequestStream {
6949    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6950    is_terminated: bool,
6951}
6952
6953impl std::marker::Unpin for StorageIteratorRequestStream {}
6954
6955impl futures::stream::FusedStream for StorageIteratorRequestStream {
6956    fn is_terminated(&self) -> bool {
6957        self.is_terminated
6958    }
6959}
6960
6961impl fdomain_client::fidl::RequestStream for StorageIteratorRequestStream {
6962    type Protocol = StorageIteratorMarker;
6963    type ControlHandle = StorageIteratorControlHandle;
6964
6965    fn from_channel(channel: fdomain_client::Channel) -> Self {
6966        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6967    }
6968
6969    fn control_handle(&self) -> Self::ControlHandle {
6970        StorageIteratorControlHandle { inner: self.inner.clone() }
6971    }
6972
6973    fn into_inner(
6974        self,
6975    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6976    {
6977        (self.inner, self.is_terminated)
6978    }
6979
6980    fn from_inner(
6981        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6982        is_terminated: bool,
6983    ) -> Self {
6984        Self { inner, is_terminated }
6985    }
6986}
6987
6988impl futures::Stream for StorageIteratorRequestStream {
6989    type Item = Result<StorageIteratorRequest, fidl::Error>;
6990
6991    fn poll_next(
6992        mut self: std::pin::Pin<&mut Self>,
6993        cx: &mut std::task::Context<'_>,
6994    ) -> std::task::Poll<Option<Self::Item>> {
6995        let this = &mut *self;
6996        if this.inner.check_shutdown(cx) {
6997            this.is_terminated = true;
6998            return std::task::Poll::Ready(None);
6999        }
7000        if this.is_terminated {
7001            panic!("polled StorageIteratorRequestStream after completion");
7002        }
7003        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
7004            |bytes, handles| {
7005                match this.inner.channel().read_etc(cx, bytes, handles) {
7006                    std::task::Poll::Ready(Ok(())) => {}
7007                    std::task::Poll::Pending => return std::task::Poll::Pending,
7008                    std::task::Poll::Ready(Err(None)) => {
7009                        this.is_terminated = true;
7010                        return std::task::Poll::Ready(None);
7011                    }
7012                    std::task::Poll::Ready(Err(Some(e))) => {
7013                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7014                            e.into(),
7015                        ))));
7016                    }
7017                }
7018
7019                // A message has been received from the channel
7020                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7021
7022                std::task::Poll::Ready(Some(match header.ordinal {
7023                0x7a6b21f15fd01b72 => {
7024                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7025                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
7026                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7027                    let control_handle = StorageIteratorControlHandle {
7028                        inner: this.inner.clone(),
7029                    };
7030                    Ok(StorageIteratorRequest::Next {
7031                        responder: StorageIteratorNextResponder {
7032                            control_handle: std::mem::ManuallyDrop::new(control_handle),
7033                            tx_id: header.tx_id,
7034                        },
7035                    })
7036                }
7037                _ => Err(fidl::Error::UnknownOrdinal {
7038                    ordinal: header.ordinal,
7039                    protocol_name: <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
7040                }),
7041            }))
7042            },
7043        )
7044    }
7045}
7046
7047/// An iterator protocol for returning a set of components using a storage
7048/// capability. See |StorageAdmin.ListStorageInRealm| for more information.
7049#[derive(Debug)]
7050pub enum StorageIteratorRequest {
7051    /// Retrieve the next set of components using the storage capability. The
7052    /// returned monikers are relative to the component that declares the
7053    /// storage capability. Returns an empty vector after all components have
7054    /// been returned.
7055    Next { responder: StorageIteratorNextResponder },
7056}
7057
7058impl StorageIteratorRequest {
7059    #[allow(irrefutable_let_patterns)]
7060    pub fn into_next(self) -> Option<(StorageIteratorNextResponder)> {
7061        if let StorageIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
7062    }
7063
7064    /// Name of the method defined in FIDL
7065    pub fn method_name(&self) -> &'static str {
7066        match *self {
7067            StorageIteratorRequest::Next { .. } => "next",
7068        }
7069    }
7070}
7071
7072#[derive(Debug, Clone)]
7073pub struct StorageIteratorControlHandle {
7074    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
7075}
7076
7077impl fdomain_client::fidl::ControlHandle for StorageIteratorControlHandle {
7078    fn shutdown(&self) {
7079        self.inner.shutdown()
7080    }
7081
7082    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7083        self.inner.shutdown_with_epitaph(status)
7084    }
7085
7086    fn is_closed(&self) -> bool {
7087        self.inner.channel().is_closed()
7088    }
7089    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
7090        self.inner.channel().on_closed()
7091    }
7092}
7093
7094impl StorageIteratorControlHandle {}
7095
7096#[must_use = "FIDL methods require a response to be sent"]
7097#[derive(Debug)]
7098pub struct StorageIteratorNextResponder {
7099    control_handle: std::mem::ManuallyDrop<StorageIteratorControlHandle>,
7100    tx_id: u32,
7101}
7102
7103/// Set the the channel to be shutdown (see [`StorageIteratorControlHandle::shutdown`])
7104/// if the responder is dropped without sending a response, so that the client
7105/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7106impl std::ops::Drop for StorageIteratorNextResponder {
7107    fn drop(&mut self) {
7108        self.control_handle.shutdown();
7109        // Safety: drops once, never accessed again
7110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7111    }
7112}
7113
7114impl fdomain_client::fidl::Responder for StorageIteratorNextResponder {
7115    type ControlHandle = StorageIteratorControlHandle;
7116
7117    fn control_handle(&self) -> &StorageIteratorControlHandle {
7118        &self.control_handle
7119    }
7120
7121    fn drop_without_shutdown(mut self) {
7122        // Safety: drops once, never accessed again due to mem::forget
7123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7124        // Prevent Drop from running (which would shut down the channel)
7125        std::mem::forget(self);
7126    }
7127}
7128
7129impl StorageIteratorNextResponder {
7130    /// Sends a response to the FIDL transaction.
7131    ///
7132    /// Sets the channel to shutdown if an error occurs.
7133    pub fn send(self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
7134        let _result = self.send_raw(relative_monikers);
7135        if _result.is_err() {
7136            self.control_handle.shutdown();
7137        }
7138        self.drop_without_shutdown();
7139        _result
7140    }
7141
7142    /// Similar to "send" but does not shutdown the channel if an error occurs.
7143    pub fn send_no_shutdown_on_err(
7144        self,
7145        mut relative_monikers: &[String],
7146    ) -> Result<(), fidl::Error> {
7147        let _result = self.send_raw(relative_monikers);
7148        self.drop_without_shutdown();
7149        _result
7150    }
7151
7152    fn send_raw(&self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
7153        self.control_handle.inner.send::<StorageIteratorNextResponse>(
7154            (relative_monikers,),
7155            self.tx_id,
7156            0x7a6b21f15fd01b72,
7157            fidl::encoding::DynamicFlags::empty(),
7158        )
7159    }
7160}
7161
7162mod internal {
7163    use super::*;
7164
7165    impl fidl::encoding::ResourceTypeMarker for ControllerOpenExposedDirRequest {
7166        type Borrowed<'a> = &'a mut Self;
7167        fn take_or_borrow<'a>(
7168            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7169        ) -> Self::Borrowed<'a> {
7170            value
7171        }
7172    }
7173
7174    unsafe impl fidl::encoding::TypeMarker for ControllerOpenExposedDirRequest {
7175        type Owned = Self;
7176
7177        #[inline(always)]
7178        fn inline_align(_context: fidl::encoding::Context) -> usize {
7179            4
7180        }
7181
7182        #[inline(always)]
7183        fn inline_size(_context: fidl::encoding::Context) -> usize {
7184            4
7185        }
7186    }
7187
7188    unsafe impl
7189        fidl::encoding::Encode<
7190            ControllerOpenExposedDirRequest,
7191            fdomain_client::fidl::FDomainResourceDialect,
7192        > for &mut ControllerOpenExposedDirRequest
7193    {
7194        #[inline]
7195        unsafe fn encode(
7196            self,
7197            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7198            offset: usize,
7199            _depth: fidl::encoding::Depth,
7200        ) -> fidl::Result<()> {
7201            encoder.debug_check_bounds::<ControllerOpenExposedDirRequest>(offset);
7202            // Delegate to tuple encoding.
7203            fidl::encoding::Encode::<
7204                ControllerOpenExposedDirRequest,
7205                fdomain_client::fidl::FDomainResourceDialect,
7206            >::encode(
7207                (<fidl::encoding::Endpoint<
7208                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7209                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7210                    &mut self.exposed_dir
7211                ),),
7212                encoder,
7213                offset,
7214                _depth,
7215            )
7216        }
7217    }
7218    unsafe impl<
7219        T0: fidl::encoding::Encode<
7220                fidl::encoding::Endpoint<
7221                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7222                >,
7223                fdomain_client::fidl::FDomainResourceDialect,
7224            >,
7225    >
7226        fidl::encoding::Encode<
7227            ControllerOpenExposedDirRequest,
7228            fdomain_client::fidl::FDomainResourceDialect,
7229        > for (T0,)
7230    {
7231        #[inline]
7232        unsafe fn encode(
7233            self,
7234            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7235            offset: usize,
7236            depth: fidl::encoding::Depth,
7237        ) -> fidl::Result<()> {
7238            encoder.debug_check_bounds::<ControllerOpenExposedDirRequest>(offset);
7239            // Zero out padding regions. There's no need to apply masks
7240            // because the unmasked parts will be overwritten by fields.
7241            // Write the fields.
7242            self.0.encode(encoder, offset + 0, depth)?;
7243            Ok(())
7244        }
7245    }
7246
7247    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7248        for ControllerOpenExposedDirRequest
7249    {
7250        #[inline(always)]
7251        fn new_empty() -> Self {
7252            Self {
7253                exposed_dir: fidl::new_empty!(
7254                    fidl::encoding::Endpoint<
7255                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7256                    >,
7257                    fdomain_client::fidl::FDomainResourceDialect
7258                ),
7259            }
7260        }
7261
7262        #[inline]
7263        unsafe fn decode(
7264            &mut self,
7265            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7266            offset: usize,
7267            _depth: fidl::encoding::Depth,
7268        ) -> fidl::Result<()> {
7269            decoder.debug_check_bounds::<Self>(offset);
7270            // Verify that padding bytes are zero.
7271            fidl::decode!(
7272                fidl::encoding::Endpoint<
7273                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7274                >,
7275                fdomain_client::fidl::FDomainResourceDialect,
7276                &mut self.exposed_dir,
7277                decoder,
7278                offset + 0,
7279                _depth
7280            )?;
7281            Ok(())
7282        }
7283    }
7284
7285    impl fidl::encoding::ResourceTypeMarker for ControllerStartRequest {
7286        type Borrowed<'a> = &'a mut Self;
7287        fn take_or_borrow<'a>(
7288            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7289        ) -> Self::Borrowed<'a> {
7290            value
7291        }
7292    }
7293
7294    unsafe impl fidl::encoding::TypeMarker for ControllerStartRequest {
7295        type Owned = Self;
7296
7297        #[inline(always)]
7298        fn inline_align(_context: fidl::encoding::Context) -> usize {
7299            8
7300        }
7301
7302        #[inline(always)]
7303        fn inline_size(_context: fidl::encoding::Context) -> usize {
7304            24
7305        }
7306    }
7307
7308    unsafe impl
7309        fidl::encoding::Encode<ControllerStartRequest, fdomain_client::fidl::FDomainResourceDialect>
7310        for &mut ControllerStartRequest
7311    {
7312        #[inline]
7313        unsafe fn encode(
7314            self,
7315            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7316            offset: usize,
7317            _depth: fidl::encoding::Depth,
7318        ) -> fidl::Result<()> {
7319            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
7320            // Delegate to tuple encoding.
7321            fidl::encoding::Encode::<
7322                ControllerStartRequest,
7323                fdomain_client::fidl::FDomainResourceDialect,
7324            >::encode(
7325                (
7326                    <StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7327                        &mut self.args,
7328                    ),
7329                    <fidl::encoding::Endpoint<
7330                        fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
7331                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7332                        &mut self.execution_controller,
7333                    ),
7334                ),
7335                encoder,
7336                offset,
7337                _depth,
7338            )
7339        }
7340    }
7341    unsafe impl<
7342        T0: fidl::encoding::Encode<StartChildArgs, fdomain_client::fidl::FDomainResourceDialect>,
7343        T1: fidl::encoding::Encode<
7344                fidl::encoding::Endpoint<
7345                    fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
7346                >,
7347                fdomain_client::fidl::FDomainResourceDialect,
7348            >,
7349    >
7350        fidl::encoding::Encode<ControllerStartRequest, fdomain_client::fidl::FDomainResourceDialect>
7351        for (T0, T1)
7352    {
7353        #[inline]
7354        unsafe fn encode(
7355            self,
7356            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7357            offset: usize,
7358            depth: fidl::encoding::Depth,
7359        ) -> fidl::Result<()> {
7360            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
7361            // Zero out padding regions. There's no need to apply masks
7362            // because the unmasked parts will be overwritten by fields.
7363            unsafe {
7364                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7365                (ptr as *mut u64).write_unaligned(0);
7366            }
7367            // Write the fields.
7368            self.0.encode(encoder, offset + 0, depth)?;
7369            self.1.encode(encoder, offset + 16, depth)?;
7370            Ok(())
7371        }
7372    }
7373
7374    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7375        for ControllerStartRequest
7376    {
7377        #[inline(always)]
7378        fn new_empty() -> Self {
7379            Self {
7380                args: fidl::new_empty!(
7381                    StartChildArgs,
7382                    fdomain_client::fidl::FDomainResourceDialect
7383                ),
7384                execution_controller: fidl::new_empty!(
7385                    fidl::encoding::Endpoint<
7386                        fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
7387                    >,
7388                    fdomain_client::fidl::FDomainResourceDialect
7389                ),
7390            }
7391        }
7392
7393        #[inline]
7394        unsafe fn decode(
7395            &mut self,
7396            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7397            offset: usize,
7398            _depth: fidl::encoding::Depth,
7399        ) -> fidl::Result<()> {
7400            decoder.debug_check_bounds::<Self>(offset);
7401            // Verify that padding bytes are zero.
7402            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7403            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7404            let mask = 0xffffffff00000000u64;
7405            let maskedval = padval & mask;
7406            if maskedval != 0 {
7407                return Err(fidl::Error::NonZeroPadding {
7408                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7409                });
7410            }
7411            fidl::decode!(
7412                StartChildArgs,
7413                fdomain_client::fidl::FDomainResourceDialect,
7414                &mut self.args,
7415                decoder,
7416                offset + 0,
7417                _depth
7418            )?;
7419            fidl::decode!(
7420                fidl::encoding::Endpoint<
7421                    fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
7422                >,
7423                fdomain_client::fidl::FDomainResourceDialect,
7424                &mut self.execution_controller,
7425                decoder,
7426                offset + 16,
7427                _depth
7428            )?;
7429            Ok(())
7430        }
7431    }
7432
7433    impl fidl::encoding::ResourceTypeMarker for ControllerGetExposedDictionaryResponse {
7434        type Borrowed<'a> = &'a mut Self;
7435        fn take_or_borrow<'a>(
7436            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7437        ) -> Self::Borrowed<'a> {
7438            value
7439        }
7440    }
7441
7442    unsafe impl fidl::encoding::TypeMarker for ControllerGetExposedDictionaryResponse {
7443        type Owned = Self;
7444
7445        #[inline(always)]
7446        fn inline_align(_context: fidl::encoding::Context) -> usize {
7447            4
7448        }
7449
7450        #[inline(always)]
7451        fn inline_size(_context: fidl::encoding::Context) -> usize {
7452            4
7453        }
7454    }
7455
7456    unsafe impl
7457        fidl::encoding::Encode<
7458            ControllerGetExposedDictionaryResponse,
7459            fdomain_client::fidl::FDomainResourceDialect,
7460        > for &mut ControllerGetExposedDictionaryResponse
7461    {
7462        #[inline]
7463        unsafe fn encode(
7464            self,
7465            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7466            offset: usize,
7467            _depth: fidl::encoding::Depth,
7468        ) -> fidl::Result<()> {
7469            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
7470            // Delegate to tuple encoding.
7471            fidl::encoding::Encode::<ControllerGetExposedDictionaryResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
7472                (
7473                    <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
7474                ),
7475                encoder, offset, _depth
7476            )
7477        }
7478    }
7479    unsafe impl<
7480        T0: fidl::encoding::Encode<
7481                fdomain_fuchsia_component_sandbox::DictionaryRef,
7482                fdomain_client::fidl::FDomainResourceDialect,
7483            >,
7484    >
7485        fidl::encoding::Encode<
7486            ControllerGetExposedDictionaryResponse,
7487            fdomain_client::fidl::FDomainResourceDialect,
7488        > for (T0,)
7489    {
7490        #[inline]
7491        unsafe fn encode(
7492            self,
7493            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7494            offset: usize,
7495            depth: fidl::encoding::Depth,
7496        ) -> fidl::Result<()> {
7497            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
7498            // Zero out padding regions. There's no need to apply masks
7499            // because the unmasked parts will be overwritten by fields.
7500            // Write the fields.
7501            self.0.encode(encoder, offset + 0, depth)?;
7502            Ok(())
7503        }
7504    }
7505
7506    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7507        for ControllerGetExposedDictionaryResponse
7508    {
7509        #[inline(always)]
7510        fn new_empty() -> Self {
7511            Self {
7512                dictionary: fidl::new_empty!(
7513                    fdomain_fuchsia_component_sandbox::DictionaryRef,
7514                    fdomain_client::fidl::FDomainResourceDialect
7515                ),
7516            }
7517        }
7518
7519        #[inline]
7520        unsafe fn decode(
7521            &mut self,
7522            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7523            offset: usize,
7524            _depth: fidl::encoding::Depth,
7525        ) -> fidl::Result<()> {
7526            decoder.debug_check_bounds::<Self>(offset);
7527            // Verify that padding bytes are zero.
7528            fidl::decode!(
7529                fdomain_fuchsia_component_sandbox::DictionaryRef,
7530                fdomain_client::fidl::FDomainResourceDialect,
7531                &mut self.dictionary,
7532                decoder,
7533                offset + 0,
7534                _depth
7535            )?;
7536            Ok(())
7537        }
7538    }
7539
7540    impl fidl::encoding::ResourceTypeMarker for ControllerGetOutputDictionaryResponse {
7541        type Borrowed<'a> = &'a mut Self;
7542        fn take_or_borrow<'a>(
7543            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7544        ) -> Self::Borrowed<'a> {
7545            value
7546        }
7547    }
7548
7549    unsafe impl fidl::encoding::TypeMarker for ControllerGetOutputDictionaryResponse {
7550        type Owned = Self;
7551
7552        #[inline(always)]
7553        fn inline_align(_context: fidl::encoding::Context) -> usize {
7554            4
7555        }
7556
7557        #[inline(always)]
7558        fn inline_size(_context: fidl::encoding::Context) -> usize {
7559            4
7560        }
7561    }
7562
7563    unsafe impl
7564        fidl::encoding::Encode<
7565            ControllerGetOutputDictionaryResponse,
7566            fdomain_client::fidl::FDomainResourceDialect,
7567        > for &mut ControllerGetOutputDictionaryResponse
7568    {
7569        #[inline]
7570        unsafe fn encode(
7571            self,
7572            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7573            offset: usize,
7574            _depth: fidl::encoding::Depth,
7575        ) -> fidl::Result<()> {
7576            encoder.debug_check_bounds::<ControllerGetOutputDictionaryResponse>(offset);
7577            // Delegate to tuple encoding.
7578            fidl::encoding::Encode::<
7579                ControllerGetOutputDictionaryResponse,
7580                fdomain_client::fidl::FDomainResourceDialect,
7581            >::encode(
7582                (<fidl::encoding::HandleType<
7583                    fdomain_client::EventPair,
7584                    { fidl::ObjectType::EVENTPAIR.into_raw() },
7585                    2147483648,
7586                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7587                    &mut self.dictionary
7588                ),),
7589                encoder,
7590                offset,
7591                _depth,
7592            )
7593        }
7594    }
7595    unsafe impl<
7596        T0: fidl::encoding::Encode<
7597                fidl::encoding::HandleType<
7598                    fdomain_client::EventPair,
7599                    { fidl::ObjectType::EVENTPAIR.into_raw() },
7600                    2147483648,
7601                >,
7602                fdomain_client::fidl::FDomainResourceDialect,
7603            >,
7604    >
7605        fidl::encoding::Encode<
7606            ControllerGetOutputDictionaryResponse,
7607            fdomain_client::fidl::FDomainResourceDialect,
7608        > for (T0,)
7609    {
7610        #[inline]
7611        unsafe fn encode(
7612            self,
7613            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7614            offset: usize,
7615            depth: fidl::encoding::Depth,
7616        ) -> fidl::Result<()> {
7617            encoder.debug_check_bounds::<ControllerGetOutputDictionaryResponse>(offset);
7618            // Zero out padding regions. There's no need to apply masks
7619            // because the unmasked parts will be overwritten by fields.
7620            // Write the fields.
7621            self.0.encode(encoder, offset + 0, depth)?;
7622            Ok(())
7623        }
7624    }
7625
7626    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7627        for ControllerGetOutputDictionaryResponse
7628    {
7629        #[inline(always)]
7630        fn new_empty() -> Self {
7631            Self {
7632                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
7633            }
7634        }
7635
7636        #[inline]
7637        unsafe fn decode(
7638            &mut self,
7639            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7640            offset: usize,
7641            _depth: fidl::encoding::Depth,
7642        ) -> fidl::Result<()> {
7643            decoder.debug_check_bounds::<Self>(offset);
7644            // Verify that padding bytes are zero.
7645            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
7646            Ok(())
7647        }
7648    }
7649
7650    impl fidl::encoding::ResourceTypeMarker for ControllerIsStartedResponse {
7651        type Borrowed<'a> = &'a mut Self;
7652        fn take_or_borrow<'a>(
7653            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7654        ) -> Self::Borrowed<'a> {
7655            value
7656        }
7657    }
7658
7659    unsafe impl fidl::encoding::TypeMarker for ControllerIsStartedResponse {
7660        type Owned = Self;
7661
7662        #[inline(always)]
7663        fn inline_align(_context: fidl::encoding::Context) -> usize {
7664            1
7665        }
7666
7667        #[inline(always)]
7668        fn inline_size(_context: fidl::encoding::Context) -> usize {
7669            1
7670        }
7671    }
7672
7673    unsafe impl
7674        fidl::encoding::Encode<
7675            ControllerIsStartedResponse,
7676            fdomain_client::fidl::FDomainResourceDialect,
7677        > for &mut ControllerIsStartedResponse
7678    {
7679        #[inline]
7680        unsafe fn encode(
7681            self,
7682            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7683            offset: usize,
7684            _depth: fidl::encoding::Depth,
7685        ) -> fidl::Result<()> {
7686            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
7687            // Delegate to tuple encoding.
7688            fidl::encoding::Encode::<
7689                ControllerIsStartedResponse,
7690                fdomain_client::fidl::FDomainResourceDialect,
7691            >::encode(
7692                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_started),),
7693                encoder,
7694                offset,
7695                _depth,
7696            )
7697        }
7698    }
7699    unsafe impl<T0: fidl::encoding::Encode<bool, fdomain_client::fidl::FDomainResourceDialect>>
7700        fidl::encoding::Encode<
7701            ControllerIsStartedResponse,
7702            fdomain_client::fidl::FDomainResourceDialect,
7703        > for (T0,)
7704    {
7705        #[inline]
7706        unsafe fn encode(
7707            self,
7708            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7709            offset: usize,
7710            depth: fidl::encoding::Depth,
7711        ) -> fidl::Result<()> {
7712            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
7713            // Zero out padding regions. There's no need to apply masks
7714            // because the unmasked parts will be overwritten by fields.
7715            // Write the fields.
7716            self.0.encode(encoder, offset + 0, depth)?;
7717            Ok(())
7718        }
7719    }
7720
7721    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7722        for ControllerIsStartedResponse
7723    {
7724        #[inline(always)]
7725        fn new_empty() -> Self {
7726            Self {
7727                is_started: fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect),
7728            }
7729        }
7730
7731        #[inline]
7732        unsafe fn decode(
7733            &mut self,
7734            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7735            offset: usize,
7736            _depth: fidl::encoding::Depth,
7737        ) -> fidl::Result<()> {
7738            decoder.debug_check_bounds::<Self>(offset);
7739            // Verify that padding bytes are zero.
7740            fidl::decode!(
7741                bool,
7742                fdomain_client::fidl::FDomainResourceDialect,
7743                &mut self.is_started,
7744                decoder,
7745                offset + 0,
7746                _depth
7747            )?;
7748            Ok(())
7749        }
7750    }
7751
7752    impl fidl::encoding::ResourceTypeMarker for EventStreamGetNextResponse {
7753        type Borrowed<'a> = &'a mut Self;
7754        fn take_or_borrow<'a>(
7755            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7756        ) -> Self::Borrowed<'a> {
7757            value
7758        }
7759    }
7760
7761    unsafe impl fidl::encoding::TypeMarker for EventStreamGetNextResponse {
7762        type Owned = Self;
7763
7764        #[inline(always)]
7765        fn inline_align(_context: fidl::encoding::Context) -> usize {
7766            8
7767        }
7768
7769        #[inline(always)]
7770        fn inline_size(_context: fidl::encoding::Context) -> usize {
7771            16
7772        }
7773    }
7774
7775    unsafe impl
7776        fidl::encoding::Encode<
7777            EventStreamGetNextResponse,
7778            fdomain_client::fidl::FDomainResourceDialect,
7779        > for &mut EventStreamGetNextResponse
7780    {
7781        #[inline]
7782        unsafe fn encode(
7783            self,
7784            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7785            offset: usize,
7786            _depth: fidl::encoding::Depth,
7787        ) -> fidl::Result<()> {
7788            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
7789            // Delegate to tuple encoding.
7790            fidl::encoding::Encode::<EventStreamGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
7791                (
7792                    <fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
7793                ),
7794                encoder, offset, _depth
7795            )
7796        }
7797    }
7798    unsafe impl<
7799        T0: fidl::encoding::Encode<
7800                fidl::encoding::UnboundedVector<Event>,
7801                fdomain_client::fidl::FDomainResourceDialect,
7802            >,
7803    >
7804        fidl::encoding::Encode<
7805            EventStreamGetNextResponse,
7806            fdomain_client::fidl::FDomainResourceDialect,
7807        > for (T0,)
7808    {
7809        #[inline]
7810        unsafe fn encode(
7811            self,
7812            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7813            offset: usize,
7814            depth: fidl::encoding::Depth,
7815        ) -> fidl::Result<()> {
7816            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
7817            // Zero out padding regions. There's no need to apply masks
7818            // because the unmasked parts will be overwritten by fields.
7819            // Write the fields.
7820            self.0.encode(encoder, offset + 0, depth)?;
7821            Ok(())
7822        }
7823    }
7824
7825    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7826        for EventStreamGetNextResponse
7827    {
7828        #[inline(always)]
7829        fn new_empty() -> Self {
7830            Self {
7831                events: fidl::new_empty!(
7832                    fidl::encoding::UnboundedVector<Event>,
7833                    fdomain_client::fidl::FDomainResourceDialect
7834                ),
7835            }
7836        }
7837
7838        #[inline]
7839        unsafe fn decode(
7840            &mut self,
7841            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7842            offset: usize,
7843            _depth: fidl::encoding::Depth,
7844        ) -> fidl::Result<()> {
7845            decoder.debug_check_bounds::<Self>(offset);
7846            // Verify that padding bytes are zero.
7847            fidl::decode!(
7848                fidl::encoding::UnboundedVector<Event>,
7849                fdomain_client::fidl::FDomainResourceDialect,
7850                &mut self.events,
7851                decoder,
7852                offset + 0,
7853                _depth
7854            )?;
7855            Ok(())
7856        }
7857    }
7858
7859    impl fidl::encoding::ResourceTypeMarker for IntrospectorGetMonikerRequest {
7860        type Borrowed<'a> = &'a mut Self;
7861        fn take_or_borrow<'a>(
7862            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7863        ) -> Self::Borrowed<'a> {
7864            value
7865        }
7866    }
7867
7868    unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerRequest {
7869        type Owned = Self;
7870
7871        #[inline(always)]
7872        fn inline_align(_context: fidl::encoding::Context) -> usize {
7873            4
7874        }
7875
7876        #[inline(always)]
7877        fn inline_size(_context: fidl::encoding::Context) -> usize {
7878            4
7879        }
7880    }
7881
7882    unsafe impl
7883        fidl::encoding::Encode<
7884            IntrospectorGetMonikerRequest,
7885            fdomain_client::fidl::FDomainResourceDialect,
7886        > for &mut IntrospectorGetMonikerRequest
7887    {
7888        #[inline]
7889        unsafe fn encode(
7890            self,
7891            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7892            offset: usize,
7893            _depth: fidl::encoding::Depth,
7894        ) -> fidl::Result<()> {
7895            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
7896            // Delegate to tuple encoding.
7897            fidl::encoding::Encode::<
7898                IntrospectorGetMonikerRequest,
7899                fdomain_client::fidl::FDomainResourceDialect,
7900            >::encode(
7901                (<fidl::encoding::HandleType<
7902                    fdomain_client::Event,
7903                    { fidl::ObjectType::EVENT.into_raw() },
7904                    2147483648,
7905                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
7906                    &mut self.component_instance,
7907                ),),
7908                encoder,
7909                offset,
7910                _depth,
7911            )
7912        }
7913    }
7914    unsafe impl<
7915        T0: fidl::encoding::Encode<
7916                fidl::encoding::HandleType<
7917                    fdomain_client::Event,
7918                    { fidl::ObjectType::EVENT.into_raw() },
7919                    2147483648,
7920                >,
7921                fdomain_client::fidl::FDomainResourceDialect,
7922            >,
7923    >
7924        fidl::encoding::Encode<
7925            IntrospectorGetMonikerRequest,
7926            fdomain_client::fidl::FDomainResourceDialect,
7927        > for (T0,)
7928    {
7929        #[inline]
7930        unsafe fn encode(
7931            self,
7932            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7933            offset: usize,
7934            depth: fidl::encoding::Depth,
7935        ) -> fidl::Result<()> {
7936            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
7937            // Zero out padding regions. There's no need to apply masks
7938            // because the unmasked parts will be overwritten by fields.
7939            // Write the fields.
7940            self.0.encode(encoder, offset + 0, depth)?;
7941            Ok(())
7942        }
7943    }
7944
7945    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7946        for IntrospectorGetMonikerRequest
7947    {
7948        #[inline(always)]
7949        fn new_empty() -> Self {
7950            Self {
7951                component_instance: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
7952            }
7953        }
7954
7955        #[inline]
7956        unsafe fn decode(
7957            &mut self,
7958            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7959            offset: usize,
7960            _depth: fidl::encoding::Depth,
7961        ) -> fidl::Result<()> {
7962            decoder.debug_check_bounds::<Self>(offset);
7963            // Verify that padding bytes are zero.
7964            fidl::decode!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.component_instance, decoder, offset + 0, _depth)?;
7965            Ok(())
7966        }
7967    }
7968
7969    impl fidl::encoding::ResourceTypeMarker for NamespaceCreate2Request {
7970        type Borrowed<'a> = &'a mut Self;
7971        fn take_or_borrow<'a>(
7972            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7973        ) -> Self::Borrowed<'a> {
7974            value
7975        }
7976    }
7977
7978    unsafe impl fidl::encoding::TypeMarker for NamespaceCreate2Request {
7979        type Owned = Self;
7980
7981        #[inline(always)]
7982        fn inline_align(_context: fidl::encoding::Context) -> usize {
7983            8
7984        }
7985
7986        #[inline(always)]
7987        fn inline_size(_context: fidl::encoding::Context) -> usize {
7988            16
7989        }
7990    }
7991
7992    unsafe impl
7993        fidl::encoding::Encode<
7994            NamespaceCreate2Request,
7995            fdomain_client::fidl::FDomainResourceDialect,
7996        > for &mut NamespaceCreate2Request
7997    {
7998        #[inline]
7999        unsafe fn encode(
8000            self,
8001            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8002            offset: usize,
8003            _depth: fidl::encoding::Depth,
8004        ) -> fidl::Result<()> {
8005            encoder.debug_check_bounds::<NamespaceCreate2Request>(offset);
8006            // Delegate to tuple encoding.
8007            fidl::encoding::Encode::<NamespaceCreate2Request, fdomain_client::fidl::FDomainResourceDialect>::encode(
8008                (
8009                    <fidl::encoding::UnboundedVector<NamespaceInputEntry2> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
8010                ),
8011                encoder, offset, _depth
8012            )
8013        }
8014    }
8015    unsafe impl<
8016        T0: fidl::encoding::Encode<
8017                fidl::encoding::UnboundedVector<NamespaceInputEntry2>,
8018                fdomain_client::fidl::FDomainResourceDialect,
8019            >,
8020    >
8021        fidl::encoding::Encode<
8022            NamespaceCreate2Request,
8023            fdomain_client::fidl::FDomainResourceDialect,
8024        > for (T0,)
8025    {
8026        #[inline]
8027        unsafe fn encode(
8028            self,
8029            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8030            offset: usize,
8031            depth: fidl::encoding::Depth,
8032        ) -> fidl::Result<()> {
8033            encoder.debug_check_bounds::<NamespaceCreate2Request>(offset);
8034            // Zero out padding regions. There's no need to apply masks
8035            // because the unmasked parts will be overwritten by fields.
8036            // Write the fields.
8037            self.0.encode(encoder, offset + 0, depth)?;
8038            Ok(())
8039        }
8040    }
8041
8042    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8043        for NamespaceCreate2Request
8044    {
8045        #[inline(always)]
8046        fn new_empty() -> Self {
8047            Self {
8048                entries: fidl::new_empty!(
8049                    fidl::encoding::UnboundedVector<NamespaceInputEntry2>,
8050                    fdomain_client::fidl::FDomainResourceDialect
8051                ),
8052            }
8053        }
8054
8055        #[inline]
8056        unsafe fn decode(
8057            &mut self,
8058            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8059            offset: usize,
8060            _depth: fidl::encoding::Depth,
8061        ) -> fidl::Result<()> {
8062            decoder.debug_check_bounds::<Self>(offset);
8063            // Verify that padding bytes are zero.
8064            fidl::decode!(
8065                fidl::encoding::UnboundedVector<NamespaceInputEntry2>,
8066                fdomain_client::fidl::FDomainResourceDialect,
8067                &mut self.entries,
8068                decoder,
8069                offset + 0,
8070                _depth
8071            )?;
8072            Ok(())
8073        }
8074    }
8075
8076    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateRequest {
8077        type Borrowed<'a> = &'a mut Self;
8078        fn take_or_borrow<'a>(
8079            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8080        ) -> Self::Borrowed<'a> {
8081            value
8082        }
8083    }
8084
8085    unsafe impl fidl::encoding::TypeMarker for NamespaceCreateRequest {
8086        type Owned = Self;
8087
8088        #[inline(always)]
8089        fn inline_align(_context: fidl::encoding::Context) -> usize {
8090            8
8091        }
8092
8093        #[inline(always)]
8094        fn inline_size(_context: fidl::encoding::Context) -> usize {
8095            16
8096        }
8097    }
8098
8099    unsafe impl
8100        fidl::encoding::Encode<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>
8101        for &mut NamespaceCreateRequest
8102    {
8103        #[inline]
8104        unsafe fn encode(
8105            self,
8106            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8107            offset: usize,
8108            _depth: fidl::encoding::Depth,
8109        ) -> fidl::Result<()> {
8110            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
8111            // Delegate to tuple encoding.
8112            fidl::encoding::Encode::<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8113                (
8114                    <fidl::encoding::UnboundedVector<NamespaceInputEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
8115                ),
8116                encoder, offset, _depth
8117            )
8118        }
8119    }
8120    unsafe impl<
8121        T0: fidl::encoding::Encode<
8122                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
8123                fdomain_client::fidl::FDomainResourceDialect,
8124            >,
8125    >
8126        fidl::encoding::Encode<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>
8127        for (T0,)
8128    {
8129        #[inline]
8130        unsafe fn encode(
8131            self,
8132            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8133            offset: usize,
8134            depth: fidl::encoding::Depth,
8135        ) -> fidl::Result<()> {
8136            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
8137            // Zero out padding regions. There's no need to apply masks
8138            // because the unmasked parts will be overwritten by fields.
8139            // Write the fields.
8140            self.0.encode(encoder, offset + 0, depth)?;
8141            Ok(())
8142        }
8143    }
8144
8145    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8146        for NamespaceCreateRequest
8147    {
8148        #[inline(always)]
8149        fn new_empty() -> Self {
8150            Self {
8151                entries: fidl::new_empty!(
8152                    fidl::encoding::UnboundedVector<NamespaceInputEntry>,
8153                    fdomain_client::fidl::FDomainResourceDialect
8154                ),
8155            }
8156        }
8157
8158        #[inline]
8159        unsafe fn decode(
8160            &mut self,
8161            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8162            offset: usize,
8163            _depth: fidl::encoding::Depth,
8164        ) -> fidl::Result<()> {
8165            decoder.debug_check_bounds::<Self>(offset);
8166            // Verify that padding bytes are zero.
8167            fidl::decode!(
8168                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
8169                fdomain_client::fidl::FDomainResourceDialect,
8170                &mut self.entries,
8171                decoder,
8172                offset + 0,
8173                _depth
8174            )?;
8175            Ok(())
8176        }
8177    }
8178
8179    impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry {
8180        type Borrowed<'a> = &'a mut Self;
8181        fn take_or_borrow<'a>(
8182            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8183        ) -> Self::Borrowed<'a> {
8184            value
8185        }
8186    }
8187
8188    unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry {
8189        type Owned = Self;
8190
8191        #[inline(always)]
8192        fn inline_align(_context: fidl::encoding::Context) -> usize {
8193            8
8194        }
8195
8196        #[inline(always)]
8197        fn inline_size(_context: fidl::encoding::Context) -> usize {
8198            24
8199        }
8200    }
8201
8202    unsafe impl
8203        fidl::encoding::Encode<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>
8204        for &mut NamespaceInputEntry
8205    {
8206        #[inline]
8207        unsafe fn encode(
8208            self,
8209            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8210            offset: usize,
8211            _depth: fidl::encoding::Depth,
8212        ) -> fidl::Result<()> {
8213            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
8214            // Delegate to tuple encoding.
8215            fidl::encoding::Encode::<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>::encode(
8216                (
8217                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
8218                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_component_sandbox::DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
8219                ),
8220                encoder, offset, _depth
8221            )
8222        }
8223    }
8224    unsafe impl<
8225        T0: fidl::encoding::Encode<
8226                fidl::encoding::BoundedString<4095>,
8227                fdomain_client::fidl::FDomainResourceDialect,
8228            >,
8229        T1: fidl::encoding::Encode<
8230                fidl::encoding::Endpoint<
8231                    fdomain_client::fidl::ClientEnd<
8232                        fdomain_fuchsia_component_sandbox::DictionaryMarker,
8233                    >,
8234                >,
8235                fdomain_client::fidl::FDomainResourceDialect,
8236            >,
8237    > fidl::encoding::Encode<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>
8238        for (T0, T1)
8239    {
8240        #[inline]
8241        unsafe fn encode(
8242            self,
8243            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8244            offset: usize,
8245            depth: fidl::encoding::Depth,
8246        ) -> fidl::Result<()> {
8247            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
8248            // Zero out padding regions. There's no need to apply masks
8249            // because the unmasked parts will be overwritten by fields.
8250            unsafe {
8251                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8252                (ptr as *mut u64).write_unaligned(0);
8253            }
8254            // Write the fields.
8255            self.0.encode(encoder, offset + 0, depth)?;
8256            self.1.encode(encoder, offset + 16, depth)?;
8257            Ok(())
8258        }
8259    }
8260
8261    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8262        for NamespaceInputEntry
8263    {
8264        #[inline(always)]
8265        fn new_empty() -> Self {
8266            Self {
8267                path: fidl::new_empty!(
8268                    fidl::encoding::BoundedString<4095>,
8269                    fdomain_client::fidl::FDomainResourceDialect
8270                ),
8271                dictionary: fidl::new_empty!(
8272                    fidl::encoding::Endpoint<
8273                        fdomain_client::fidl::ClientEnd<
8274                            fdomain_fuchsia_component_sandbox::DictionaryMarker,
8275                        >,
8276                    >,
8277                    fdomain_client::fidl::FDomainResourceDialect
8278                ),
8279            }
8280        }
8281
8282        #[inline]
8283        unsafe fn decode(
8284            &mut self,
8285            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8286            offset: usize,
8287            _depth: fidl::encoding::Depth,
8288        ) -> fidl::Result<()> {
8289            decoder.debug_check_bounds::<Self>(offset);
8290            // Verify that padding bytes are zero.
8291            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8292            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8293            let mask = 0xffffffff00000000u64;
8294            let maskedval = padval & mask;
8295            if maskedval != 0 {
8296                return Err(fidl::Error::NonZeroPadding {
8297                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8298                });
8299            }
8300            fidl::decode!(
8301                fidl::encoding::BoundedString<4095>,
8302                fdomain_client::fidl::FDomainResourceDialect,
8303                &mut self.path,
8304                decoder,
8305                offset + 0,
8306                _depth
8307            )?;
8308            fidl::decode!(
8309                fidl::encoding::Endpoint<
8310                    fdomain_client::fidl::ClientEnd<
8311                        fdomain_fuchsia_component_sandbox::DictionaryMarker,
8312                    >,
8313                >,
8314                fdomain_client::fidl::FDomainResourceDialect,
8315                &mut self.dictionary,
8316                decoder,
8317                offset + 16,
8318                _depth
8319            )?;
8320            Ok(())
8321        }
8322    }
8323
8324    impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry2 {
8325        type Borrowed<'a> = &'a mut Self;
8326        fn take_or_borrow<'a>(
8327            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8328        ) -> Self::Borrowed<'a> {
8329            value
8330        }
8331    }
8332
8333    unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry2 {
8334        type Owned = Self;
8335
8336        #[inline(always)]
8337        fn inline_align(_context: fidl::encoding::Context) -> usize {
8338            8
8339        }
8340
8341        #[inline(always)]
8342        fn inline_size(_context: fidl::encoding::Context) -> usize {
8343            24
8344        }
8345    }
8346
8347    unsafe impl
8348        fidl::encoding::Encode<NamespaceInputEntry2, fdomain_client::fidl::FDomainResourceDialect>
8349        for &mut NamespaceInputEntry2
8350    {
8351        #[inline]
8352        unsafe fn encode(
8353            self,
8354            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8355            offset: usize,
8356            _depth: fidl::encoding::Depth,
8357        ) -> fidl::Result<()> {
8358            encoder.debug_check_bounds::<NamespaceInputEntry2>(offset);
8359            // Delegate to tuple encoding.
8360            fidl::encoding::Encode::<NamespaceInputEntry2, fdomain_client::fidl::FDomainResourceDialect>::encode(
8361                (
8362                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
8363                    <fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.capability),
8364                ),
8365                encoder, offset, _depth
8366            )
8367        }
8368    }
8369    unsafe impl<
8370        T0: fidl::encoding::Encode<
8371                fidl::encoding::BoundedString<4095>,
8372                fdomain_client::fidl::FDomainResourceDialect,
8373            >,
8374        T1: fidl::encoding::Encode<
8375                fidl::encoding::HandleType<
8376                    fdomain_client::EventPair,
8377                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8378                    2147483648,
8379                >,
8380                fdomain_client::fidl::FDomainResourceDialect,
8381            >,
8382    > fidl::encoding::Encode<NamespaceInputEntry2, fdomain_client::fidl::FDomainResourceDialect>
8383        for (T0, T1)
8384    {
8385        #[inline]
8386        unsafe fn encode(
8387            self,
8388            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8389            offset: usize,
8390            depth: fidl::encoding::Depth,
8391        ) -> fidl::Result<()> {
8392            encoder.debug_check_bounds::<NamespaceInputEntry2>(offset);
8393            // Zero out padding regions. There's no need to apply masks
8394            // because the unmasked parts will be overwritten by fields.
8395            unsafe {
8396                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8397                (ptr as *mut u64).write_unaligned(0);
8398            }
8399            // Write the fields.
8400            self.0.encode(encoder, offset + 0, depth)?;
8401            self.1.encode(encoder, offset + 16, depth)?;
8402            Ok(())
8403        }
8404    }
8405
8406    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8407        for NamespaceInputEntry2
8408    {
8409        #[inline(always)]
8410        fn new_empty() -> Self {
8411            Self {
8412                path: fidl::new_empty!(
8413                    fidl::encoding::BoundedString<4095>,
8414                    fdomain_client::fidl::FDomainResourceDialect
8415                ),
8416                capability: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
8417            }
8418        }
8419
8420        #[inline]
8421        unsafe fn decode(
8422            &mut self,
8423            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8424            offset: usize,
8425            _depth: fidl::encoding::Depth,
8426        ) -> fidl::Result<()> {
8427            decoder.debug_check_bounds::<Self>(offset);
8428            // Verify that padding bytes are zero.
8429            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8430            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8431            let mask = 0xffffffff00000000u64;
8432            let maskedval = padval & mask;
8433            if maskedval != 0 {
8434                return Err(fidl::Error::NonZeroPadding {
8435                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8436                });
8437            }
8438            fidl::decode!(
8439                fidl::encoding::BoundedString<4095>,
8440                fdomain_client::fidl::FDomainResourceDialect,
8441                &mut self.path,
8442                decoder,
8443                offset + 0,
8444                _depth
8445            )?;
8446            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.capability, decoder, offset + 16, _depth)?;
8447            Ok(())
8448        }
8449    }
8450
8451    impl fidl::encoding::ResourceTypeMarker for NamespaceCreate2Response {
8452        type Borrowed<'a> = &'a mut Self;
8453        fn take_or_borrow<'a>(
8454            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8455        ) -> Self::Borrowed<'a> {
8456            value
8457        }
8458    }
8459
8460    unsafe impl fidl::encoding::TypeMarker for NamespaceCreate2Response {
8461        type Owned = Self;
8462
8463        #[inline(always)]
8464        fn inline_align(_context: fidl::encoding::Context) -> usize {
8465            8
8466        }
8467
8468        #[inline(always)]
8469        fn inline_size(_context: fidl::encoding::Context) -> usize {
8470            16
8471        }
8472    }
8473
8474    unsafe impl
8475        fidl::encoding::Encode<
8476            NamespaceCreate2Response,
8477            fdomain_client::fidl::FDomainResourceDialect,
8478        > for &mut NamespaceCreate2Response
8479    {
8480        #[inline]
8481        unsafe fn encode(
8482            self,
8483            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8484            offset: usize,
8485            _depth: fidl::encoding::Depth,
8486        ) -> fidl::Result<()> {
8487            encoder.debug_check_bounds::<NamespaceCreate2Response>(offset);
8488            // Delegate to tuple encoding.
8489            fidl::encoding::Encode::<NamespaceCreate2Response, fdomain_client::fidl::FDomainResourceDialect>::encode(
8490                (
8491                    <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
8492                ),
8493                encoder, offset, _depth
8494            )
8495        }
8496    }
8497    unsafe impl<
8498        T0: fidl::encoding::Encode<
8499                fidl::encoding::UnboundedVector<NamespaceEntry>,
8500                fdomain_client::fidl::FDomainResourceDialect,
8501            >,
8502    >
8503        fidl::encoding::Encode<
8504            NamespaceCreate2Response,
8505            fdomain_client::fidl::FDomainResourceDialect,
8506        > for (T0,)
8507    {
8508        #[inline]
8509        unsafe fn encode(
8510            self,
8511            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8512            offset: usize,
8513            depth: fidl::encoding::Depth,
8514        ) -> fidl::Result<()> {
8515            encoder.debug_check_bounds::<NamespaceCreate2Response>(offset);
8516            // Zero out padding regions. There's no need to apply masks
8517            // because the unmasked parts will be overwritten by fields.
8518            // Write the fields.
8519            self.0.encode(encoder, offset + 0, depth)?;
8520            Ok(())
8521        }
8522    }
8523
8524    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8525        for NamespaceCreate2Response
8526    {
8527        #[inline(always)]
8528        fn new_empty() -> Self {
8529            Self {
8530                entries: fidl::new_empty!(
8531                    fidl::encoding::UnboundedVector<NamespaceEntry>,
8532                    fdomain_client::fidl::FDomainResourceDialect
8533                ),
8534            }
8535        }
8536
8537        #[inline]
8538        unsafe fn decode(
8539            &mut self,
8540            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8541            offset: usize,
8542            _depth: fidl::encoding::Depth,
8543        ) -> fidl::Result<()> {
8544            decoder.debug_check_bounds::<Self>(offset);
8545            // Verify that padding bytes are zero.
8546            fidl::decode!(
8547                fidl::encoding::UnboundedVector<NamespaceEntry>,
8548                fdomain_client::fidl::FDomainResourceDialect,
8549                &mut self.entries,
8550                decoder,
8551                offset + 0,
8552                _depth
8553            )?;
8554            Ok(())
8555        }
8556    }
8557
8558    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateResponse {
8559        type Borrowed<'a> = &'a mut Self;
8560        fn take_or_borrow<'a>(
8561            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8562        ) -> Self::Borrowed<'a> {
8563            value
8564        }
8565    }
8566
8567    unsafe impl fidl::encoding::TypeMarker for NamespaceCreateResponse {
8568        type Owned = Self;
8569
8570        #[inline(always)]
8571        fn inline_align(_context: fidl::encoding::Context) -> usize {
8572            8
8573        }
8574
8575        #[inline(always)]
8576        fn inline_size(_context: fidl::encoding::Context) -> usize {
8577            16
8578        }
8579    }
8580
8581    unsafe impl
8582        fidl::encoding::Encode<
8583            NamespaceCreateResponse,
8584            fdomain_client::fidl::FDomainResourceDialect,
8585        > for &mut NamespaceCreateResponse
8586    {
8587        #[inline]
8588        unsafe fn encode(
8589            self,
8590            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8591            offset: usize,
8592            _depth: fidl::encoding::Depth,
8593        ) -> fidl::Result<()> {
8594            encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
8595            // Delegate to tuple encoding.
8596            fidl::encoding::Encode::<NamespaceCreateResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
8597                (
8598                    <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
8599                ),
8600                encoder, offset, _depth
8601            )
8602        }
8603    }
8604    unsafe impl<
8605        T0: fidl::encoding::Encode<
8606                fidl::encoding::UnboundedVector<NamespaceEntry>,
8607                fdomain_client::fidl::FDomainResourceDialect,
8608            >,
8609    >
8610        fidl::encoding::Encode<
8611            NamespaceCreateResponse,
8612            fdomain_client::fidl::FDomainResourceDialect,
8613        > for (T0,)
8614    {
8615        #[inline]
8616        unsafe fn encode(
8617            self,
8618            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8619            offset: usize,
8620            depth: fidl::encoding::Depth,
8621        ) -> fidl::Result<()> {
8622            encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
8623            // Zero out padding regions. There's no need to apply masks
8624            // because the unmasked parts will be overwritten by fields.
8625            // Write the fields.
8626            self.0.encode(encoder, offset + 0, depth)?;
8627            Ok(())
8628        }
8629    }
8630
8631    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8632        for NamespaceCreateResponse
8633    {
8634        #[inline(always)]
8635        fn new_empty() -> Self {
8636            Self {
8637                entries: fidl::new_empty!(
8638                    fidl::encoding::UnboundedVector<NamespaceEntry>,
8639                    fdomain_client::fidl::FDomainResourceDialect
8640                ),
8641            }
8642        }
8643
8644        #[inline]
8645        unsafe fn decode(
8646            &mut self,
8647            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8648            offset: usize,
8649            _depth: fidl::encoding::Depth,
8650        ) -> fidl::Result<()> {
8651            decoder.debug_check_bounds::<Self>(offset);
8652            // Verify that padding bytes are zero.
8653            fidl::decode!(
8654                fidl::encoding::UnboundedVector<NamespaceEntry>,
8655                fdomain_client::fidl::FDomainResourceDialect,
8656                &mut self.entries,
8657                decoder,
8658                offset + 0,
8659                _depth
8660            )?;
8661            Ok(())
8662        }
8663    }
8664
8665    impl fidl::encoding::ResourceTypeMarker for RealmCreateChildRequest {
8666        type Borrowed<'a> = &'a mut Self;
8667        fn take_or_borrow<'a>(
8668            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8669        ) -> Self::Borrowed<'a> {
8670            value
8671        }
8672    }
8673
8674    unsafe impl fidl::encoding::TypeMarker for RealmCreateChildRequest {
8675        type Owned = Self;
8676
8677        #[inline(always)]
8678        fn inline_align(_context: fidl::encoding::Context) -> usize {
8679            8
8680        }
8681
8682        #[inline(always)]
8683        fn inline_size(_context: fidl::encoding::Context) -> usize {
8684            48
8685        }
8686    }
8687
8688    unsafe impl
8689        fidl::encoding::Encode<
8690            RealmCreateChildRequest,
8691            fdomain_client::fidl::FDomainResourceDialect,
8692        > for &mut RealmCreateChildRequest
8693    {
8694        #[inline]
8695        unsafe fn encode(
8696            self,
8697            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8698            offset: usize,
8699            _depth: fidl::encoding::Depth,
8700        ) -> fidl::Result<()> {
8701            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
8702            // Delegate to tuple encoding.
8703            fidl::encoding::Encode::<RealmCreateChildRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8704                (
8705                    <fdomain_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
8706                    <fdomain_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
8707                    <CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
8708                ),
8709                encoder, offset, _depth
8710            )
8711        }
8712    }
8713    unsafe impl<
8714        T0: fidl::encoding::Encode<
8715                fdomain_fuchsia_component_decl::CollectionRef,
8716                fdomain_client::fidl::FDomainResourceDialect,
8717            >,
8718        T1: fidl::encoding::Encode<
8719                fdomain_fuchsia_component_decl::Child,
8720                fdomain_client::fidl::FDomainResourceDialect,
8721            >,
8722        T2: fidl::encoding::Encode<CreateChildArgs, fdomain_client::fidl::FDomainResourceDialect>,
8723    >
8724        fidl::encoding::Encode<
8725            RealmCreateChildRequest,
8726            fdomain_client::fidl::FDomainResourceDialect,
8727        > for (T0, T1, T2)
8728    {
8729        #[inline]
8730        unsafe fn encode(
8731            self,
8732            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8733            offset: usize,
8734            depth: fidl::encoding::Depth,
8735        ) -> fidl::Result<()> {
8736            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
8737            // Zero out padding regions. There's no need to apply masks
8738            // because the unmasked parts will be overwritten by fields.
8739            // Write the fields.
8740            self.0.encode(encoder, offset + 0, depth)?;
8741            self.1.encode(encoder, offset + 16, depth)?;
8742            self.2.encode(encoder, offset + 32, depth)?;
8743            Ok(())
8744        }
8745    }
8746
8747    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8748        for RealmCreateChildRequest
8749    {
8750        #[inline(always)]
8751        fn new_empty() -> Self {
8752            Self {
8753                collection: fidl::new_empty!(
8754                    fdomain_fuchsia_component_decl::CollectionRef,
8755                    fdomain_client::fidl::FDomainResourceDialect
8756                ),
8757                decl: fidl::new_empty!(
8758                    fdomain_fuchsia_component_decl::Child,
8759                    fdomain_client::fidl::FDomainResourceDialect
8760                ),
8761                args: fidl::new_empty!(
8762                    CreateChildArgs,
8763                    fdomain_client::fidl::FDomainResourceDialect
8764                ),
8765            }
8766        }
8767
8768        #[inline]
8769        unsafe fn decode(
8770            &mut self,
8771            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8772            offset: usize,
8773            _depth: fidl::encoding::Depth,
8774        ) -> fidl::Result<()> {
8775            decoder.debug_check_bounds::<Self>(offset);
8776            // Verify that padding bytes are zero.
8777            fidl::decode!(
8778                fdomain_fuchsia_component_decl::CollectionRef,
8779                fdomain_client::fidl::FDomainResourceDialect,
8780                &mut self.collection,
8781                decoder,
8782                offset + 0,
8783                _depth
8784            )?;
8785            fidl::decode!(
8786                fdomain_fuchsia_component_decl::Child,
8787                fdomain_client::fidl::FDomainResourceDialect,
8788                &mut self.decl,
8789                decoder,
8790                offset + 16,
8791                _depth
8792            )?;
8793            fidl::decode!(
8794                CreateChildArgs,
8795                fdomain_client::fidl::FDomainResourceDialect,
8796                &mut self.args,
8797                decoder,
8798                offset + 32,
8799                _depth
8800            )?;
8801            Ok(())
8802        }
8803    }
8804
8805    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryDeprecatedRequest {
8806        type Borrowed<'a> = &'a mut Self;
8807        fn take_or_borrow<'a>(
8808            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8809        ) -> Self::Borrowed<'a> {
8810            value
8811        }
8812    }
8813
8814    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryDeprecatedRequest {
8815        type Owned = Self;
8816
8817        #[inline(always)]
8818        fn inline_align(_context: fidl::encoding::Context) -> usize {
8819            8
8820        }
8821
8822        #[inline(always)]
8823        fn inline_size(_context: fidl::encoding::Context) -> usize {
8824            32
8825        }
8826    }
8827
8828    unsafe impl
8829        fidl::encoding::Encode<
8830            RealmGetChildOutputDictionaryDeprecatedRequest,
8831            fdomain_client::fidl::FDomainResourceDialect,
8832        > for &mut RealmGetChildOutputDictionaryDeprecatedRequest
8833    {
8834        #[inline]
8835        unsafe fn encode(
8836            self,
8837            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8838            offset: usize,
8839            _depth: fidl::encoding::Depth,
8840        ) -> fidl::Result<()> {
8841            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedRequest>(offset);
8842            // Delegate to tuple encoding.
8843            fidl::encoding::Encode::<RealmGetChildOutputDictionaryDeprecatedRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8844                (
8845                    <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
8846                ),
8847                encoder, offset, _depth
8848            )
8849        }
8850    }
8851    unsafe impl<
8852        T0: fidl::encoding::Encode<
8853                fdomain_fuchsia_component_decl::ChildRef,
8854                fdomain_client::fidl::FDomainResourceDialect,
8855            >,
8856    >
8857        fidl::encoding::Encode<
8858            RealmGetChildOutputDictionaryDeprecatedRequest,
8859            fdomain_client::fidl::FDomainResourceDialect,
8860        > for (T0,)
8861    {
8862        #[inline]
8863        unsafe fn encode(
8864            self,
8865            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8866            offset: usize,
8867            depth: fidl::encoding::Depth,
8868        ) -> fidl::Result<()> {
8869            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedRequest>(offset);
8870            // Zero out padding regions. There's no need to apply masks
8871            // because the unmasked parts will be overwritten by fields.
8872            // Write the fields.
8873            self.0.encode(encoder, offset + 0, depth)?;
8874            Ok(())
8875        }
8876    }
8877
8878    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8879        for RealmGetChildOutputDictionaryDeprecatedRequest
8880    {
8881        #[inline(always)]
8882        fn new_empty() -> Self {
8883            Self {
8884                child: fidl::new_empty!(
8885                    fdomain_fuchsia_component_decl::ChildRef,
8886                    fdomain_client::fidl::FDomainResourceDialect
8887                ),
8888            }
8889        }
8890
8891        #[inline]
8892        unsafe fn decode(
8893            &mut self,
8894            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8895            offset: usize,
8896            _depth: fidl::encoding::Depth,
8897        ) -> fidl::Result<()> {
8898            decoder.debug_check_bounds::<Self>(offset);
8899            // Verify that padding bytes are zero.
8900            fidl::decode!(
8901                fdomain_fuchsia_component_decl::ChildRef,
8902                fdomain_client::fidl::FDomainResourceDialect,
8903                &mut self.child,
8904                decoder,
8905                offset + 0,
8906                _depth
8907            )?;
8908            Ok(())
8909        }
8910    }
8911
8912    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryRequest {
8913        type Borrowed<'a> = &'a mut Self;
8914        fn take_or_borrow<'a>(
8915            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8916        ) -> Self::Borrowed<'a> {
8917            value
8918        }
8919    }
8920
8921    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryRequest {
8922        type Owned = Self;
8923
8924        #[inline(always)]
8925        fn inline_align(_context: fidl::encoding::Context) -> usize {
8926            8
8927        }
8928
8929        #[inline(always)]
8930        fn inline_size(_context: fidl::encoding::Context) -> usize {
8931            32
8932        }
8933    }
8934
8935    unsafe impl
8936        fidl::encoding::Encode<
8937            RealmGetChildOutputDictionaryRequest,
8938            fdomain_client::fidl::FDomainResourceDialect,
8939        > for &mut RealmGetChildOutputDictionaryRequest
8940    {
8941        #[inline]
8942        unsafe fn encode(
8943            self,
8944            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8945            offset: usize,
8946            _depth: fidl::encoding::Depth,
8947        ) -> fidl::Result<()> {
8948            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
8949            // Delegate to tuple encoding.
8950            fidl::encoding::Encode::<RealmGetChildOutputDictionaryRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8951                (
8952                    <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
8953                ),
8954                encoder, offset, _depth
8955            )
8956        }
8957    }
8958    unsafe impl<
8959        T0: fidl::encoding::Encode<
8960                fdomain_fuchsia_component_decl::ChildRef,
8961                fdomain_client::fidl::FDomainResourceDialect,
8962            >,
8963    >
8964        fidl::encoding::Encode<
8965            RealmGetChildOutputDictionaryRequest,
8966            fdomain_client::fidl::FDomainResourceDialect,
8967        > for (T0,)
8968    {
8969        #[inline]
8970        unsafe fn encode(
8971            self,
8972            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8973            offset: usize,
8974            depth: fidl::encoding::Depth,
8975        ) -> fidl::Result<()> {
8976            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
8977            // Zero out padding regions. There's no need to apply masks
8978            // because the unmasked parts will be overwritten by fields.
8979            // Write the fields.
8980            self.0.encode(encoder, offset + 0, depth)?;
8981            Ok(())
8982        }
8983    }
8984
8985    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8986        for RealmGetChildOutputDictionaryRequest
8987    {
8988        #[inline(always)]
8989        fn new_empty() -> Self {
8990            Self {
8991                child: fidl::new_empty!(
8992                    fdomain_fuchsia_component_decl::ChildRef,
8993                    fdomain_client::fidl::FDomainResourceDialect
8994                ),
8995            }
8996        }
8997
8998        #[inline]
8999        unsafe fn decode(
9000            &mut self,
9001            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9002            offset: usize,
9003            _depth: fidl::encoding::Depth,
9004        ) -> fidl::Result<()> {
9005            decoder.debug_check_bounds::<Self>(offset);
9006            // Verify that padding bytes are zero.
9007            fidl::decode!(
9008                fdomain_fuchsia_component_decl::ChildRef,
9009                fdomain_client::fidl::FDomainResourceDialect,
9010                &mut self.child,
9011                decoder,
9012                offset + 0,
9013                _depth
9014            )?;
9015            Ok(())
9016        }
9017    }
9018
9019    impl fidl::encoding::ResourceTypeMarker for RealmListChildrenRequest {
9020        type Borrowed<'a> = &'a mut Self;
9021        fn take_or_borrow<'a>(
9022            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9023        ) -> Self::Borrowed<'a> {
9024            value
9025        }
9026    }
9027
9028    unsafe impl fidl::encoding::TypeMarker for RealmListChildrenRequest {
9029        type Owned = Self;
9030
9031        #[inline(always)]
9032        fn inline_align(_context: fidl::encoding::Context) -> usize {
9033            8
9034        }
9035
9036        #[inline(always)]
9037        fn inline_size(_context: fidl::encoding::Context) -> usize {
9038            24
9039        }
9040    }
9041
9042    unsafe impl
9043        fidl::encoding::Encode<
9044            RealmListChildrenRequest,
9045            fdomain_client::fidl::FDomainResourceDialect,
9046        > for &mut RealmListChildrenRequest
9047    {
9048        #[inline]
9049        unsafe fn encode(
9050            self,
9051            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9052            offset: usize,
9053            _depth: fidl::encoding::Depth,
9054        ) -> fidl::Result<()> {
9055            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
9056            // Delegate to tuple encoding.
9057            fidl::encoding::Encode::<RealmListChildrenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9058                (
9059                    <fdomain_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
9060                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iter),
9061                ),
9062                encoder, offset, _depth
9063            )
9064        }
9065    }
9066    unsafe impl<
9067        T0: fidl::encoding::Encode<
9068                fdomain_fuchsia_component_decl::CollectionRef,
9069                fdomain_client::fidl::FDomainResourceDialect,
9070            >,
9071        T1: fidl::encoding::Encode<
9072                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
9073                fdomain_client::fidl::FDomainResourceDialect,
9074            >,
9075    >
9076        fidl::encoding::Encode<
9077            RealmListChildrenRequest,
9078            fdomain_client::fidl::FDomainResourceDialect,
9079        > for (T0, T1)
9080    {
9081        #[inline]
9082        unsafe fn encode(
9083            self,
9084            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9085            offset: usize,
9086            depth: fidl::encoding::Depth,
9087        ) -> fidl::Result<()> {
9088            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
9089            // Zero out padding regions. There's no need to apply masks
9090            // because the unmasked parts will be overwritten by fields.
9091            unsafe {
9092                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9093                (ptr as *mut u64).write_unaligned(0);
9094            }
9095            // Write the fields.
9096            self.0.encode(encoder, offset + 0, depth)?;
9097            self.1.encode(encoder, offset + 16, depth)?;
9098            Ok(())
9099        }
9100    }
9101
9102    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9103        for RealmListChildrenRequest
9104    {
9105        #[inline(always)]
9106        fn new_empty() -> Self {
9107            Self {
9108                collection: fidl::new_empty!(
9109                    fdomain_fuchsia_component_decl::CollectionRef,
9110                    fdomain_client::fidl::FDomainResourceDialect
9111                ),
9112                iter: fidl::new_empty!(
9113                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
9114                    fdomain_client::fidl::FDomainResourceDialect
9115                ),
9116            }
9117        }
9118
9119        #[inline]
9120        unsafe fn decode(
9121            &mut self,
9122            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9123            offset: usize,
9124            _depth: fidl::encoding::Depth,
9125        ) -> fidl::Result<()> {
9126            decoder.debug_check_bounds::<Self>(offset);
9127            // Verify that padding bytes are zero.
9128            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9129            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9130            let mask = 0xffffffff00000000u64;
9131            let maskedval = padval & mask;
9132            if maskedval != 0 {
9133                return Err(fidl::Error::NonZeroPadding {
9134                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9135                });
9136            }
9137            fidl::decode!(
9138                fdomain_fuchsia_component_decl::CollectionRef,
9139                fdomain_client::fidl::FDomainResourceDialect,
9140                &mut self.collection,
9141                decoder,
9142                offset + 0,
9143                _depth
9144            )?;
9145            fidl::decode!(
9146                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
9147                fdomain_client::fidl::FDomainResourceDialect,
9148                &mut self.iter,
9149                decoder,
9150                offset + 16,
9151                _depth
9152            )?;
9153            Ok(())
9154        }
9155    }
9156
9157    impl fidl::encoding::ResourceTypeMarker for RealmOpenControllerRequest {
9158        type Borrowed<'a> = &'a mut Self;
9159        fn take_or_borrow<'a>(
9160            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9161        ) -> Self::Borrowed<'a> {
9162            value
9163        }
9164    }
9165
9166    unsafe impl fidl::encoding::TypeMarker for RealmOpenControllerRequest {
9167        type Owned = Self;
9168
9169        #[inline(always)]
9170        fn inline_align(_context: fidl::encoding::Context) -> usize {
9171            8
9172        }
9173
9174        #[inline(always)]
9175        fn inline_size(_context: fidl::encoding::Context) -> usize {
9176            40
9177        }
9178    }
9179
9180    unsafe impl
9181        fidl::encoding::Encode<
9182            RealmOpenControllerRequest,
9183            fdomain_client::fidl::FDomainResourceDialect,
9184        > for &mut RealmOpenControllerRequest
9185    {
9186        #[inline]
9187        unsafe fn encode(
9188            self,
9189            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9190            offset: usize,
9191            _depth: fidl::encoding::Depth,
9192        ) -> fidl::Result<()> {
9193            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
9194            // Delegate to tuple encoding.
9195            fidl::encoding::Encode::<RealmOpenControllerRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9196                (
9197                    <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
9198                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
9199                ),
9200                encoder, offset, _depth
9201            )
9202        }
9203    }
9204    unsafe impl<
9205        T0: fidl::encoding::Encode<
9206                fdomain_fuchsia_component_decl::ChildRef,
9207                fdomain_client::fidl::FDomainResourceDialect,
9208            >,
9209        T1: fidl::encoding::Encode<
9210                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9211                fdomain_client::fidl::FDomainResourceDialect,
9212            >,
9213    >
9214        fidl::encoding::Encode<
9215            RealmOpenControllerRequest,
9216            fdomain_client::fidl::FDomainResourceDialect,
9217        > for (T0, T1)
9218    {
9219        #[inline]
9220        unsafe fn encode(
9221            self,
9222            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9223            offset: usize,
9224            depth: fidl::encoding::Depth,
9225        ) -> fidl::Result<()> {
9226            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
9227            // Zero out padding regions. There's no need to apply masks
9228            // because the unmasked parts will be overwritten by fields.
9229            unsafe {
9230                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
9231                (ptr as *mut u64).write_unaligned(0);
9232            }
9233            // Write the fields.
9234            self.0.encode(encoder, offset + 0, depth)?;
9235            self.1.encode(encoder, offset + 32, depth)?;
9236            Ok(())
9237        }
9238    }
9239
9240    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9241        for RealmOpenControllerRequest
9242    {
9243        #[inline(always)]
9244        fn new_empty() -> Self {
9245            Self {
9246                child: fidl::new_empty!(
9247                    fdomain_fuchsia_component_decl::ChildRef,
9248                    fdomain_client::fidl::FDomainResourceDialect
9249                ),
9250                controller: fidl::new_empty!(
9251                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9252                    fdomain_client::fidl::FDomainResourceDialect
9253                ),
9254            }
9255        }
9256
9257        #[inline]
9258        unsafe fn decode(
9259            &mut self,
9260            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9261            offset: usize,
9262            _depth: fidl::encoding::Depth,
9263        ) -> fidl::Result<()> {
9264            decoder.debug_check_bounds::<Self>(offset);
9265            // Verify that padding bytes are zero.
9266            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
9267            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9268            let mask = 0xffffffff00000000u64;
9269            let maskedval = padval & mask;
9270            if maskedval != 0 {
9271                return Err(fidl::Error::NonZeroPadding {
9272                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
9273                });
9274            }
9275            fidl::decode!(
9276                fdomain_fuchsia_component_decl::ChildRef,
9277                fdomain_client::fidl::FDomainResourceDialect,
9278                &mut self.child,
9279                decoder,
9280                offset + 0,
9281                _depth
9282            )?;
9283            fidl::decode!(
9284                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9285                fdomain_client::fidl::FDomainResourceDialect,
9286                &mut self.controller,
9287                decoder,
9288                offset + 32,
9289                _depth
9290            )?;
9291            Ok(())
9292        }
9293    }
9294
9295    impl fidl::encoding::ResourceTypeMarker for RealmOpenExposedDirRequest {
9296        type Borrowed<'a> = &'a mut Self;
9297        fn take_or_borrow<'a>(
9298            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9299        ) -> Self::Borrowed<'a> {
9300            value
9301        }
9302    }
9303
9304    unsafe impl fidl::encoding::TypeMarker for RealmOpenExposedDirRequest {
9305        type Owned = Self;
9306
9307        #[inline(always)]
9308        fn inline_align(_context: fidl::encoding::Context) -> usize {
9309            8
9310        }
9311
9312        #[inline(always)]
9313        fn inline_size(_context: fidl::encoding::Context) -> usize {
9314            40
9315        }
9316    }
9317
9318    unsafe impl
9319        fidl::encoding::Encode<
9320            RealmOpenExposedDirRequest,
9321            fdomain_client::fidl::FDomainResourceDialect,
9322        > for &mut RealmOpenExposedDirRequest
9323    {
9324        #[inline]
9325        unsafe fn encode(
9326            self,
9327            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9328            offset: usize,
9329            _depth: fidl::encoding::Depth,
9330        ) -> fidl::Result<()> {
9331            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
9332            // Delegate to tuple encoding.
9333            fidl::encoding::Encode::<RealmOpenExposedDirRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9334                (
9335                    <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
9336                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.exposed_dir),
9337                ),
9338                encoder, offset, _depth
9339            )
9340        }
9341    }
9342    unsafe impl<
9343        T0: fidl::encoding::Encode<
9344                fdomain_fuchsia_component_decl::ChildRef,
9345                fdomain_client::fidl::FDomainResourceDialect,
9346            >,
9347        T1: fidl::encoding::Encode<
9348                fidl::encoding::Endpoint<
9349                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
9350                >,
9351                fdomain_client::fidl::FDomainResourceDialect,
9352            >,
9353    >
9354        fidl::encoding::Encode<
9355            RealmOpenExposedDirRequest,
9356            fdomain_client::fidl::FDomainResourceDialect,
9357        > for (T0, T1)
9358    {
9359        #[inline]
9360        unsafe fn encode(
9361            self,
9362            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9363            offset: usize,
9364            depth: fidl::encoding::Depth,
9365        ) -> fidl::Result<()> {
9366            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
9367            // Zero out padding regions. There's no need to apply masks
9368            // because the unmasked parts will be overwritten by fields.
9369            unsafe {
9370                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
9371                (ptr as *mut u64).write_unaligned(0);
9372            }
9373            // Write the fields.
9374            self.0.encode(encoder, offset + 0, depth)?;
9375            self.1.encode(encoder, offset + 32, depth)?;
9376            Ok(())
9377        }
9378    }
9379
9380    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9381        for RealmOpenExposedDirRequest
9382    {
9383        #[inline(always)]
9384        fn new_empty() -> Self {
9385            Self {
9386                child: fidl::new_empty!(
9387                    fdomain_fuchsia_component_decl::ChildRef,
9388                    fdomain_client::fidl::FDomainResourceDialect
9389                ),
9390                exposed_dir: fidl::new_empty!(
9391                    fidl::encoding::Endpoint<
9392                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
9393                    >,
9394                    fdomain_client::fidl::FDomainResourceDialect
9395                ),
9396            }
9397        }
9398
9399        #[inline]
9400        unsafe fn decode(
9401            &mut self,
9402            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9403            offset: usize,
9404            _depth: fidl::encoding::Depth,
9405        ) -> fidl::Result<()> {
9406            decoder.debug_check_bounds::<Self>(offset);
9407            // Verify that padding bytes are zero.
9408            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
9409            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9410            let mask = 0xffffffff00000000u64;
9411            let maskedval = padval & mask;
9412            if maskedval != 0 {
9413                return Err(fidl::Error::NonZeroPadding {
9414                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
9415                });
9416            }
9417            fidl::decode!(
9418                fdomain_fuchsia_component_decl::ChildRef,
9419                fdomain_client::fidl::FDomainResourceDialect,
9420                &mut self.child,
9421                decoder,
9422                offset + 0,
9423                _depth
9424            )?;
9425            fidl::decode!(
9426                fidl::encoding::Endpoint<
9427                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
9428                >,
9429                fdomain_client::fidl::FDomainResourceDialect,
9430                &mut self.exposed_dir,
9431                decoder,
9432                offset + 32,
9433                _depth
9434            )?;
9435            Ok(())
9436        }
9437    }
9438
9439    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryDeprecatedResponse {
9440        type Borrowed<'a> = &'a mut Self;
9441        fn take_or_borrow<'a>(
9442            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9443        ) -> Self::Borrowed<'a> {
9444            value
9445        }
9446    }
9447
9448    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryDeprecatedResponse {
9449        type Owned = Self;
9450
9451        #[inline(always)]
9452        fn inline_align(_context: fidl::encoding::Context) -> usize {
9453            4
9454        }
9455
9456        #[inline(always)]
9457        fn inline_size(_context: fidl::encoding::Context) -> usize {
9458            4
9459        }
9460    }
9461
9462    unsafe impl
9463        fidl::encoding::Encode<
9464            RealmGetChildOutputDictionaryDeprecatedResponse,
9465            fdomain_client::fidl::FDomainResourceDialect,
9466        > for &mut RealmGetChildOutputDictionaryDeprecatedResponse
9467    {
9468        #[inline]
9469        unsafe fn encode(
9470            self,
9471            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9472            offset: usize,
9473            _depth: fidl::encoding::Depth,
9474        ) -> fidl::Result<()> {
9475            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedResponse>(offset);
9476            // Delegate to tuple encoding.
9477            fidl::encoding::Encode::<RealmGetChildOutputDictionaryDeprecatedResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
9478                (
9479                    <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
9480                ),
9481                encoder, offset, _depth
9482            )
9483        }
9484    }
9485    unsafe impl<
9486        T0: fidl::encoding::Encode<
9487                fdomain_fuchsia_component_sandbox::DictionaryRef,
9488                fdomain_client::fidl::FDomainResourceDialect,
9489            >,
9490    >
9491        fidl::encoding::Encode<
9492            RealmGetChildOutputDictionaryDeprecatedResponse,
9493            fdomain_client::fidl::FDomainResourceDialect,
9494        > for (T0,)
9495    {
9496        #[inline]
9497        unsafe fn encode(
9498            self,
9499            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9500            offset: usize,
9501            depth: fidl::encoding::Depth,
9502        ) -> fidl::Result<()> {
9503            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedResponse>(offset);
9504            // Zero out padding regions. There's no need to apply masks
9505            // because the unmasked parts will be overwritten by fields.
9506            // Write the fields.
9507            self.0.encode(encoder, offset + 0, depth)?;
9508            Ok(())
9509        }
9510    }
9511
9512    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9513        for RealmGetChildOutputDictionaryDeprecatedResponse
9514    {
9515        #[inline(always)]
9516        fn new_empty() -> Self {
9517            Self {
9518                dictionary: fidl::new_empty!(
9519                    fdomain_fuchsia_component_sandbox::DictionaryRef,
9520                    fdomain_client::fidl::FDomainResourceDialect
9521                ),
9522            }
9523        }
9524
9525        #[inline]
9526        unsafe fn decode(
9527            &mut self,
9528            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9529            offset: usize,
9530            _depth: fidl::encoding::Depth,
9531        ) -> fidl::Result<()> {
9532            decoder.debug_check_bounds::<Self>(offset);
9533            // Verify that padding bytes are zero.
9534            fidl::decode!(
9535                fdomain_fuchsia_component_sandbox::DictionaryRef,
9536                fdomain_client::fidl::FDomainResourceDialect,
9537                &mut self.dictionary,
9538                decoder,
9539                offset + 0,
9540                _depth
9541            )?;
9542            Ok(())
9543        }
9544    }
9545
9546    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryResponse {
9547        type Borrowed<'a> = &'a mut Self;
9548        fn take_or_borrow<'a>(
9549            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9550        ) -> Self::Borrowed<'a> {
9551            value
9552        }
9553    }
9554
9555    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryResponse {
9556        type Owned = Self;
9557
9558        #[inline(always)]
9559        fn inline_align(_context: fidl::encoding::Context) -> usize {
9560            4
9561        }
9562
9563        #[inline(always)]
9564        fn inline_size(_context: fidl::encoding::Context) -> usize {
9565            4
9566        }
9567    }
9568
9569    unsafe impl
9570        fidl::encoding::Encode<
9571            RealmGetChildOutputDictionaryResponse,
9572            fdomain_client::fidl::FDomainResourceDialect,
9573        > for &mut RealmGetChildOutputDictionaryResponse
9574    {
9575        #[inline]
9576        unsafe fn encode(
9577            self,
9578            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9579            offset: usize,
9580            _depth: fidl::encoding::Depth,
9581        ) -> fidl::Result<()> {
9582            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
9583            // Delegate to tuple encoding.
9584            fidl::encoding::Encode::<
9585                RealmGetChildOutputDictionaryResponse,
9586                fdomain_client::fidl::FDomainResourceDialect,
9587            >::encode(
9588                (<fidl::encoding::HandleType<
9589                    fdomain_client::EventPair,
9590                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9591                    2147483648,
9592                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9593                    &mut self.dictionary
9594                ),),
9595                encoder,
9596                offset,
9597                _depth,
9598            )
9599        }
9600    }
9601    unsafe impl<
9602        T0: fidl::encoding::Encode<
9603                fidl::encoding::HandleType<
9604                    fdomain_client::EventPair,
9605                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9606                    2147483648,
9607                >,
9608                fdomain_client::fidl::FDomainResourceDialect,
9609            >,
9610    >
9611        fidl::encoding::Encode<
9612            RealmGetChildOutputDictionaryResponse,
9613            fdomain_client::fidl::FDomainResourceDialect,
9614        > for (T0,)
9615    {
9616        #[inline]
9617        unsafe fn encode(
9618            self,
9619            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9620            offset: usize,
9621            depth: fidl::encoding::Depth,
9622        ) -> fidl::Result<()> {
9623            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
9624            // Zero out padding regions. There's no need to apply masks
9625            // because the unmasked parts will be overwritten by fields.
9626            // Write the fields.
9627            self.0.encode(encoder, offset + 0, depth)?;
9628            Ok(())
9629        }
9630    }
9631
9632    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9633        for RealmGetChildOutputDictionaryResponse
9634    {
9635        #[inline(always)]
9636        fn new_empty() -> Self {
9637            Self {
9638                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
9639            }
9640        }
9641
9642        #[inline]
9643        unsafe fn decode(
9644            &mut self,
9645            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9646            offset: usize,
9647            _depth: fidl::encoding::Depth,
9648        ) -> fidl::Result<()> {
9649            decoder.debug_check_bounds::<Self>(offset);
9650            // Verify that padding bytes are zero.
9651            fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
9652            Ok(())
9653        }
9654    }
9655
9656    impl fidl::encoding::ResourceTypeMarker for RealmGetResolvedInfoResponse {
9657        type Borrowed<'a> = &'a mut Self;
9658        fn take_or_borrow<'a>(
9659            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9660        ) -> Self::Borrowed<'a> {
9661            value
9662        }
9663    }
9664
9665    unsafe impl fidl::encoding::TypeMarker for RealmGetResolvedInfoResponse {
9666        type Owned = Self;
9667
9668        #[inline(always)]
9669        fn inline_align(_context: fidl::encoding::Context) -> usize {
9670            8
9671        }
9672
9673        #[inline(always)]
9674        fn inline_size(_context: fidl::encoding::Context) -> usize {
9675            16
9676        }
9677    }
9678
9679    unsafe impl
9680        fidl::encoding::Encode<
9681            RealmGetResolvedInfoResponse,
9682            fdomain_client::fidl::FDomainResourceDialect,
9683        > for &mut RealmGetResolvedInfoResponse
9684    {
9685        #[inline]
9686        unsafe fn encode(
9687            self,
9688            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9689            offset: usize,
9690            _depth: fidl::encoding::Depth,
9691        ) -> fidl::Result<()> {
9692            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
9693            // Delegate to tuple encoding.
9694            fidl::encoding::Encode::<RealmGetResolvedInfoResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
9695                (
9696                    <fdomain_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resolved_info),
9697                ),
9698                encoder, offset, _depth
9699            )
9700        }
9701    }
9702    unsafe impl<
9703        T0: fidl::encoding::Encode<
9704                fdomain_fuchsia_component_resolution::Component,
9705                fdomain_client::fidl::FDomainResourceDialect,
9706            >,
9707    >
9708        fidl::encoding::Encode<
9709            RealmGetResolvedInfoResponse,
9710            fdomain_client::fidl::FDomainResourceDialect,
9711        > for (T0,)
9712    {
9713        #[inline]
9714        unsafe fn encode(
9715            self,
9716            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9717            offset: usize,
9718            depth: fidl::encoding::Depth,
9719        ) -> fidl::Result<()> {
9720            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
9721            // Zero out padding regions. There's no need to apply masks
9722            // because the unmasked parts will be overwritten by fields.
9723            // Write the fields.
9724            self.0.encode(encoder, offset + 0, depth)?;
9725            Ok(())
9726        }
9727    }
9728
9729    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9730        for RealmGetResolvedInfoResponse
9731    {
9732        #[inline(always)]
9733        fn new_empty() -> Self {
9734            Self {
9735                resolved_info: fidl::new_empty!(
9736                    fdomain_fuchsia_component_resolution::Component,
9737                    fdomain_client::fidl::FDomainResourceDialect
9738                ),
9739            }
9740        }
9741
9742        #[inline]
9743        unsafe fn decode(
9744            &mut self,
9745            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9746            offset: usize,
9747            _depth: fidl::encoding::Depth,
9748        ) -> fidl::Result<()> {
9749            decoder.debug_check_bounds::<Self>(offset);
9750            // Verify that padding bytes are zero.
9751            fidl::decode!(
9752                fdomain_fuchsia_component_resolution::Component,
9753                fdomain_client::fidl::FDomainResourceDialect,
9754                &mut self.resolved_info,
9755                decoder,
9756                offset + 0,
9757                _depth
9758            )?;
9759            Ok(())
9760        }
9761    }
9762
9763    impl fidl::encoding::ResourceTypeMarker for StorageAdminListStorageInRealmRequest {
9764        type Borrowed<'a> = &'a mut Self;
9765        fn take_or_borrow<'a>(
9766            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9767        ) -> Self::Borrowed<'a> {
9768            value
9769        }
9770    }
9771
9772    unsafe impl fidl::encoding::TypeMarker for StorageAdminListStorageInRealmRequest {
9773        type Owned = Self;
9774
9775        #[inline(always)]
9776        fn inline_align(_context: fidl::encoding::Context) -> usize {
9777            8
9778        }
9779
9780        #[inline(always)]
9781        fn inline_size(_context: fidl::encoding::Context) -> usize {
9782            24
9783        }
9784    }
9785
9786    unsafe impl
9787        fidl::encoding::Encode<
9788            StorageAdminListStorageInRealmRequest,
9789            fdomain_client::fidl::FDomainResourceDialect,
9790        > for &mut StorageAdminListStorageInRealmRequest
9791    {
9792        #[inline]
9793        unsafe fn encode(
9794            self,
9795            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9796            offset: usize,
9797            _depth: fidl::encoding::Depth,
9798        ) -> fidl::Result<()> {
9799            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
9800            // Delegate to tuple encoding.
9801            fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
9802                (
9803                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
9804                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
9805                ),
9806                encoder, offset, _depth
9807            )
9808        }
9809    }
9810    unsafe impl<
9811        T0: fidl::encoding::Encode<
9812                fidl::encoding::BoundedString<4096>,
9813                fdomain_client::fidl::FDomainResourceDialect,
9814            >,
9815        T1: fidl::encoding::Encode<
9816                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>>,
9817                fdomain_client::fidl::FDomainResourceDialect,
9818            >,
9819    >
9820        fidl::encoding::Encode<
9821            StorageAdminListStorageInRealmRequest,
9822            fdomain_client::fidl::FDomainResourceDialect,
9823        > for (T0, T1)
9824    {
9825        #[inline]
9826        unsafe fn encode(
9827            self,
9828            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9829            offset: usize,
9830            depth: fidl::encoding::Depth,
9831        ) -> fidl::Result<()> {
9832            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
9833            // Zero out padding regions. There's no need to apply masks
9834            // because the unmasked parts will be overwritten by fields.
9835            unsafe {
9836                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9837                (ptr as *mut u64).write_unaligned(0);
9838            }
9839            // Write the fields.
9840            self.0.encode(encoder, offset + 0, depth)?;
9841            self.1.encode(encoder, offset + 16, depth)?;
9842            Ok(())
9843        }
9844    }
9845
9846    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9847        for StorageAdminListStorageInRealmRequest
9848    {
9849        #[inline(always)]
9850        fn new_empty() -> Self {
9851            Self {
9852                relative_moniker: fidl::new_empty!(
9853                    fidl::encoding::BoundedString<4096>,
9854                    fdomain_client::fidl::FDomainResourceDialect
9855                ),
9856                iterator: fidl::new_empty!(
9857                    fidl::encoding::Endpoint<
9858                        fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
9859                    >,
9860                    fdomain_client::fidl::FDomainResourceDialect
9861                ),
9862            }
9863        }
9864
9865        #[inline]
9866        unsafe fn decode(
9867            &mut self,
9868            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9869            offset: usize,
9870            _depth: fidl::encoding::Depth,
9871        ) -> fidl::Result<()> {
9872            decoder.debug_check_bounds::<Self>(offset);
9873            // Verify that padding bytes are zero.
9874            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9875            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9876            let mask = 0xffffffff00000000u64;
9877            let maskedval = padval & mask;
9878            if maskedval != 0 {
9879                return Err(fidl::Error::NonZeroPadding {
9880                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9881                });
9882            }
9883            fidl::decode!(
9884                fidl::encoding::BoundedString<4096>,
9885                fdomain_client::fidl::FDomainResourceDialect,
9886                &mut self.relative_moniker,
9887                decoder,
9888                offset + 0,
9889                _depth
9890            )?;
9891            fidl::decode!(
9892                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>>,
9893                fdomain_client::fidl::FDomainResourceDialect,
9894                &mut self.iterator,
9895                decoder,
9896                offset + 16,
9897                _depth
9898            )?;
9899            Ok(())
9900        }
9901    }
9902
9903    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageByIdRequest {
9904        type Borrowed<'a> = &'a mut Self;
9905        fn take_or_borrow<'a>(
9906            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9907        ) -> Self::Borrowed<'a> {
9908            value
9909        }
9910    }
9911
9912    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageByIdRequest {
9913        type Owned = Self;
9914
9915        #[inline(always)]
9916        fn inline_align(_context: fidl::encoding::Context) -> usize {
9917            8
9918        }
9919
9920        #[inline(always)]
9921        fn inline_size(_context: fidl::encoding::Context) -> usize {
9922            24
9923        }
9924    }
9925
9926    unsafe impl
9927        fidl::encoding::Encode<
9928            StorageAdminOpenComponentStorageByIdRequest,
9929            fdomain_client::fidl::FDomainResourceDialect,
9930        > for &mut StorageAdminOpenComponentStorageByIdRequest
9931    {
9932        #[inline]
9933        unsafe fn encode(
9934            self,
9935            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9936            offset: usize,
9937            _depth: fidl::encoding::Depth,
9938        ) -> fidl::Result<()> {
9939            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
9940            // Delegate to tuple encoding.
9941            fidl::encoding::Encode::<
9942                StorageAdminOpenComponentStorageByIdRequest,
9943                fdomain_client::fidl::FDomainResourceDialect,
9944            >::encode(
9945                (
9946                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
9947                        &self.id,
9948                    ),
9949                    <fidl::encoding::Endpoint<
9950                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9951                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9952                        &mut self.object
9953                    ),
9954                ),
9955                encoder,
9956                offset,
9957                _depth,
9958            )
9959        }
9960    }
9961    unsafe impl<
9962        T0: fidl::encoding::Encode<
9963                fidl::encoding::BoundedString<64>,
9964                fdomain_client::fidl::FDomainResourceDialect,
9965            >,
9966        T1: fidl::encoding::Encode<
9967                fidl::encoding::Endpoint<
9968                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
9969                >,
9970                fdomain_client::fidl::FDomainResourceDialect,
9971            >,
9972    >
9973        fidl::encoding::Encode<
9974            StorageAdminOpenComponentStorageByIdRequest,
9975            fdomain_client::fidl::FDomainResourceDialect,
9976        > for (T0, T1)
9977    {
9978        #[inline]
9979        unsafe fn encode(
9980            self,
9981            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9982            offset: usize,
9983            depth: fidl::encoding::Depth,
9984        ) -> fidl::Result<()> {
9985            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
9986            // Zero out padding regions. There's no need to apply masks
9987            // because the unmasked parts will be overwritten by fields.
9988            unsafe {
9989                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9990                (ptr as *mut u64).write_unaligned(0);
9991            }
9992            // Write the fields.
9993            self.0.encode(encoder, offset + 0, depth)?;
9994            self.1.encode(encoder, offset + 16, depth)?;
9995            Ok(())
9996        }
9997    }
9998
9999    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10000        for StorageAdminOpenComponentStorageByIdRequest
10001    {
10002        #[inline(always)]
10003        fn new_empty() -> Self {
10004            Self {
10005                id: fidl::new_empty!(
10006                    fidl::encoding::BoundedString<64>,
10007                    fdomain_client::fidl::FDomainResourceDialect
10008                ),
10009                object: fidl::new_empty!(
10010                    fidl::encoding::Endpoint<
10011                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
10012                    >,
10013                    fdomain_client::fidl::FDomainResourceDialect
10014                ),
10015            }
10016        }
10017
10018        #[inline]
10019        unsafe fn decode(
10020            &mut self,
10021            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10022            offset: usize,
10023            _depth: fidl::encoding::Depth,
10024        ) -> fidl::Result<()> {
10025            decoder.debug_check_bounds::<Self>(offset);
10026            // Verify that padding bytes are zero.
10027            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10028            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10029            let mask = 0xffffffff00000000u64;
10030            let maskedval = padval & mask;
10031            if maskedval != 0 {
10032                return Err(fidl::Error::NonZeroPadding {
10033                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10034                });
10035            }
10036            fidl::decode!(
10037                fidl::encoding::BoundedString<64>,
10038                fdomain_client::fidl::FDomainResourceDialect,
10039                &mut self.id,
10040                decoder,
10041                offset + 0,
10042                _depth
10043            )?;
10044            fidl::decode!(
10045                fidl::encoding::Endpoint<
10046                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
10047                >,
10048                fdomain_client::fidl::FDomainResourceDialect,
10049                &mut self.object,
10050                decoder,
10051                offset + 16,
10052                _depth
10053            )?;
10054            Ok(())
10055        }
10056    }
10057
10058    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenStorageRequest {
10059        type Borrowed<'a> = &'a mut Self;
10060        fn take_or_borrow<'a>(
10061            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10062        ) -> Self::Borrowed<'a> {
10063            value
10064        }
10065    }
10066
10067    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenStorageRequest {
10068        type Owned = Self;
10069
10070        #[inline(always)]
10071        fn inline_align(_context: fidl::encoding::Context) -> usize {
10072            8
10073        }
10074
10075        #[inline(always)]
10076        fn inline_size(_context: fidl::encoding::Context) -> usize {
10077            24
10078        }
10079    }
10080
10081    unsafe impl
10082        fidl::encoding::Encode<
10083            StorageAdminOpenStorageRequest,
10084            fdomain_client::fidl::FDomainResourceDialect,
10085        > for &mut StorageAdminOpenStorageRequest
10086    {
10087        #[inline]
10088        unsafe fn encode(
10089            self,
10090            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10091            offset: usize,
10092            _depth: fidl::encoding::Depth,
10093        ) -> fidl::Result<()> {
10094            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
10095            // Delegate to tuple encoding.
10096            fidl::encoding::Encode::<StorageAdminOpenStorageRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
10097                (
10098                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
10099                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
10100                ),
10101                encoder, offset, _depth
10102            )
10103        }
10104    }
10105    unsafe impl<
10106        T0: fidl::encoding::Encode<
10107                fidl::encoding::BoundedString<4096>,
10108                fdomain_client::fidl::FDomainResourceDialect,
10109            >,
10110        T1: fidl::encoding::Encode<
10111                fidl::encoding::Endpoint<
10112                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
10113                >,
10114                fdomain_client::fidl::FDomainResourceDialect,
10115            >,
10116    >
10117        fidl::encoding::Encode<
10118            StorageAdminOpenStorageRequest,
10119            fdomain_client::fidl::FDomainResourceDialect,
10120        > for (T0, T1)
10121    {
10122        #[inline]
10123        unsafe fn encode(
10124            self,
10125            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10126            offset: usize,
10127            depth: fidl::encoding::Depth,
10128        ) -> fidl::Result<()> {
10129            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
10130            // Zero out padding regions. There's no need to apply masks
10131            // because the unmasked parts will be overwritten by fields.
10132            unsafe {
10133                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10134                (ptr as *mut u64).write_unaligned(0);
10135            }
10136            // Write the fields.
10137            self.0.encode(encoder, offset + 0, depth)?;
10138            self.1.encode(encoder, offset + 16, depth)?;
10139            Ok(())
10140        }
10141    }
10142
10143    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10144        for StorageAdminOpenStorageRequest
10145    {
10146        #[inline(always)]
10147        fn new_empty() -> Self {
10148            Self {
10149                relative_moniker: fidl::new_empty!(
10150                    fidl::encoding::BoundedString<4096>,
10151                    fdomain_client::fidl::FDomainResourceDialect
10152                ),
10153                object: fidl::new_empty!(
10154                    fidl::encoding::Endpoint<
10155                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
10156                    >,
10157                    fdomain_client::fidl::FDomainResourceDialect
10158                ),
10159            }
10160        }
10161
10162        #[inline]
10163        unsafe fn decode(
10164            &mut self,
10165            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10166            offset: usize,
10167            _depth: fidl::encoding::Depth,
10168        ) -> fidl::Result<()> {
10169            decoder.debug_check_bounds::<Self>(offset);
10170            // Verify that padding bytes are zero.
10171            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10172            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10173            let mask = 0xffffffff00000000u64;
10174            let maskedval = padval & mask;
10175            if maskedval != 0 {
10176                return Err(fidl::Error::NonZeroPadding {
10177                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10178                });
10179            }
10180            fidl::decode!(
10181                fidl::encoding::BoundedString<4096>,
10182                fdomain_client::fidl::FDomainResourceDialect,
10183                &mut self.relative_moniker,
10184                decoder,
10185                offset + 0,
10186                _depth
10187            )?;
10188            fidl::decode!(
10189                fidl::encoding::Endpoint<
10190                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
10191                >,
10192                fdomain_client::fidl::FDomainResourceDialect,
10193                &mut self.object,
10194                decoder,
10195                offset + 16,
10196                _depth
10197            )?;
10198            Ok(())
10199        }
10200    }
10201
10202    impl CapabilityRequestedPayload {
10203        #[inline(always)]
10204        fn max_ordinal_present(&self) -> u64 {
10205            if let Some(_) = self.capability {
10206                return 2;
10207            }
10208            if let Some(_) = self.name {
10209                return 1;
10210            }
10211            0
10212        }
10213    }
10214
10215    impl fidl::encoding::ResourceTypeMarker for CapabilityRequestedPayload {
10216        type Borrowed<'a> = &'a mut Self;
10217        fn take_or_borrow<'a>(
10218            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10219        ) -> Self::Borrowed<'a> {
10220            value
10221        }
10222    }
10223
10224    unsafe impl fidl::encoding::TypeMarker for CapabilityRequestedPayload {
10225        type Owned = Self;
10226
10227        #[inline(always)]
10228        fn inline_align(_context: fidl::encoding::Context) -> usize {
10229            8
10230        }
10231
10232        #[inline(always)]
10233        fn inline_size(_context: fidl::encoding::Context) -> usize {
10234            16
10235        }
10236    }
10237
10238    unsafe impl
10239        fidl::encoding::Encode<
10240            CapabilityRequestedPayload,
10241            fdomain_client::fidl::FDomainResourceDialect,
10242        > for &mut CapabilityRequestedPayload
10243    {
10244        unsafe fn encode(
10245            self,
10246            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10247            offset: usize,
10248            mut depth: fidl::encoding::Depth,
10249        ) -> fidl::Result<()> {
10250            encoder.debug_check_bounds::<CapabilityRequestedPayload>(offset);
10251            // Vector header
10252            let max_ordinal: u64 = self.max_ordinal_present();
10253            encoder.write_num(max_ordinal, offset);
10254            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10255            // Calling encoder.out_of_line_offset(0) is not allowed.
10256            if max_ordinal == 0 {
10257                return Ok(());
10258            }
10259            depth.increment()?;
10260            let envelope_size = 8;
10261            let bytes_len = max_ordinal as usize * envelope_size;
10262            #[allow(unused_variables)]
10263            let offset = encoder.out_of_line_offset(bytes_len);
10264            let mut _prev_end_offset: usize = 0;
10265            if 1 > max_ordinal {
10266                return Ok(());
10267            }
10268
10269            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10270            // are envelope_size bytes.
10271            let cur_offset: usize = (1 - 1) * envelope_size;
10272
10273            // Zero reserved fields.
10274            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10275
10276            // Safety:
10277            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10278            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10279            //   envelope_size bytes, there is always sufficient room.
10280            fidl::encoding::encode_in_envelope_optional::<
10281                fidl::encoding::BoundedString<255>,
10282                fdomain_client::fidl::FDomainResourceDialect,
10283            >(
10284                self.name.as_ref().map(
10285                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
10286                ),
10287                encoder,
10288                offset + cur_offset,
10289                depth,
10290            )?;
10291
10292            _prev_end_offset = cur_offset + envelope_size;
10293            if 2 > max_ordinal {
10294                return Ok(());
10295            }
10296
10297            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10298            // are envelope_size bytes.
10299            let cur_offset: usize = (2 - 1) * envelope_size;
10300
10301            // Zero reserved fields.
10302            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10303
10304            // Safety:
10305            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10306            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10307            //   envelope_size bytes, there is always sufficient room.
10308            fidl::encoding::encode_in_envelope_optional::<
10309                fidl::encoding::HandleType<
10310                    fdomain_client::Channel,
10311                    { fidl::ObjectType::CHANNEL.into_raw() },
10312                    2147483648,
10313                >,
10314                fdomain_client::fidl::FDomainResourceDialect,
10315            >(
10316                self.capability.as_mut().map(
10317                    <fidl::encoding::HandleType<
10318                        fdomain_client::Channel,
10319                        { fidl::ObjectType::CHANNEL.into_raw() },
10320                        2147483648,
10321                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10322                ),
10323                encoder,
10324                offset + cur_offset,
10325                depth,
10326            )?;
10327
10328            _prev_end_offset = cur_offset + envelope_size;
10329
10330            Ok(())
10331        }
10332    }
10333
10334    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10335        for CapabilityRequestedPayload
10336    {
10337        #[inline(always)]
10338        fn new_empty() -> Self {
10339            Self::default()
10340        }
10341
10342        unsafe fn decode(
10343            &mut self,
10344            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10345            offset: usize,
10346            mut depth: fidl::encoding::Depth,
10347        ) -> fidl::Result<()> {
10348            decoder.debug_check_bounds::<Self>(offset);
10349            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10350                None => return Err(fidl::Error::NotNullable),
10351                Some(len) => len,
10352            };
10353            // Calling decoder.out_of_line_offset(0) is not allowed.
10354            if len == 0 {
10355                return Ok(());
10356            };
10357            depth.increment()?;
10358            let envelope_size = 8;
10359            let bytes_len = len * envelope_size;
10360            let offset = decoder.out_of_line_offset(bytes_len)?;
10361            // Decode the envelope for each type.
10362            let mut _next_ordinal_to_read = 0;
10363            let mut next_offset = offset;
10364            let end_offset = offset + bytes_len;
10365            _next_ordinal_to_read += 1;
10366            if next_offset >= end_offset {
10367                return Ok(());
10368            }
10369
10370            // Decode unknown envelopes for gaps in ordinals.
10371            while _next_ordinal_to_read < 1 {
10372                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10373                _next_ordinal_to_read += 1;
10374                next_offset += envelope_size;
10375            }
10376
10377            let next_out_of_line = decoder.next_out_of_line();
10378            let handles_before = decoder.remaining_handles();
10379            if let Some((inlined, num_bytes, num_handles)) =
10380                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10381            {
10382                let member_inline_size =
10383                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
10384                        decoder.context,
10385                    );
10386                if inlined != (member_inline_size <= 4) {
10387                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10388                }
10389                let inner_offset;
10390                let mut inner_depth = depth.clone();
10391                if inlined {
10392                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10393                    inner_offset = next_offset;
10394                } else {
10395                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10396                    inner_depth.increment()?;
10397                }
10398                let val_ref = self.name.get_or_insert_with(|| {
10399                    fidl::new_empty!(
10400                        fidl::encoding::BoundedString<255>,
10401                        fdomain_client::fidl::FDomainResourceDialect
10402                    )
10403                });
10404                fidl::decode!(
10405                    fidl::encoding::BoundedString<255>,
10406                    fdomain_client::fidl::FDomainResourceDialect,
10407                    val_ref,
10408                    decoder,
10409                    inner_offset,
10410                    inner_depth
10411                )?;
10412                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10413                {
10414                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10415                }
10416                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10417                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10418                }
10419            }
10420
10421            next_offset += envelope_size;
10422            _next_ordinal_to_read += 1;
10423            if next_offset >= end_offset {
10424                return Ok(());
10425            }
10426
10427            // Decode unknown envelopes for gaps in ordinals.
10428            while _next_ordinal_to_read < 2 {
10429                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10430                _next_ordinal_to_read += 1;
10431                next_offset += envelope_size;
10432            }
10433
10434            let next_out_of_line = decoder.next_out_of_line();
10435            let handles_before = decoder.remaining_handles();
10436            if let Some((inlined, num_bytes, num_handles)) =
10437                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10438            {
10439                let member_inline_size = <fidl::encoding::HandleType<
10440                    fdomain_client::Channel,
10441                    { fidl::ObjectType::CHANNEL.into_raw() },
10442                    2147483648,
10443                > as fidl::encoding::TypeMarker>::inline_size(
10444                    decoder.context
10445                );
10446                if inlined != (member_inline_size <= 4) {
10447                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10448                }
10449                let inner_offset;
10450                let mut inner_depth = depth.clone();
10451                if inlined {
10452                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10453                    inner_offset = next_offset;
10454                } else {
10455                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10456                    inner_depth.increment()?;
10457                }
10458                let val_ref =
10459                self.capability.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
10460                fidl::decode!(fidl::encoding::HandleType<fdomain_client::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10461                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10462                {
10463                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10464                }
10465                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10466                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10467                }
10468            }
10469
10470            next_offset += envelope_size;
10471
10472            // Decode the remaining unknown envelopes.
10473            while next_offset < end_offset {
10474                _next_ordinal_to_read += 1;
10475                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10476                next_offset += envelope_size;
10477            }
10478
10479            Ok(())
10480        }
10481    }
10482
10483    impl CreateChildArgs {
10484        #[inline(always)]
10485        fn max_ordinal_present(&self) -> u64 {
10486            if let Some(_) = self.additional_inputs {
10487                return 5;
10488            }
10489            if let Some(_) = self.dictionary {
10490                return 4;
10491            }
10492            if let Some(_) = self.controller {
10493                return 3;
10494            }
10495            if let Some(_) = self.dynamic_offers {
10496                return 2;
10497            }
10498            if let Some(_) = self.numbered_handles {
10499                return 1;
10500            }
10501            0
10502        }
10503    }
10504
10505    impl fidl::encoding::ResourceTypeMarker for CreateChildArgs {
10506        type Borrowed<'a> = &'a mut Self;
10507        fn take_or_borrow<'a>(
10508            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10509        ) -> Self::Borrowed<'a> {
10510            value
10511        }
10512    }
10513
10514    unsafe impl fidl::encoding::TypeMarker for CreateChildArgs {
10515        type Owned = Self;
10516
10517        #[inline(always)]
10518        fn inline_align(_context: fidl::encoding::Context) -> usize {
10519            8
10520        }
10521
10522        #[inline(always)]
10523        fn inline_size(_context: fidl::encoding::Context) -> usize {
10524            16
10525        }
10526    }
10527
10528    unsafe impl
10529        fidl::encoding::Encode<CreateChildArgs, fdomain_client::fidl::FDomainResourceDialect>
10530        for &mut CreateChildArgs
10531    {
10532        unsafe fn encode(
10533            self,
10534            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10535            offset: usize,
10536            mut depth: fidl::encoding::Depth,
10537        ) -> fidl::Result<()> {
10538            encoder.debug_check_bounds::<CreateChildArgs>(offset);
10539            // Vector header
10540            let max_ordinal: u64 = self.max_ordinal_present();
10541            encoder.write_num(max_ordinal, offset);
10542            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10543            // Calling encoder.out_of_line_offset(0) is not allowed.
10544            if max_ordinal == 0 {
10545                return Ok(());
10546            }
10547            depth.increment()?;
10548            let envelope_size = 8;
10549            let bytes_len = max_ordinal as usize * envelope_size;
10550            #[allow(unused_variables)]
10551            let offset = encoder.out_of_line_offset(bytes_len);
10552            let mut _prev_end_offset: usize = 0;
10553            if 1 > max_ordinal {
10554                return Ok(());
10555            }
10556
10557            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10558            // are envelope_size bytes.
10559            let cur_offset: usize = (1 - 1) * envelope_size;
10560
10561            // Zero reserved fields.
10562            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10563
10564            // Safety:
10565            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10566            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10567            //   envelope_size bytes, there is always sufficient room.
10568            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect>(
10569            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10570            encoder, offset + cur_offset, depth
10571        )?;
10572
10573            _prev_end_offset = cur_offset + envelope_size;
10574            if 2 > max_ordinal {
10575                return Ok(());
10576            }
10577
10578            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10579            // are envelope_size bytes.
10580            let cur_offset: usize = (2 - 1) * envelope_size;
10581
10582            // Zero reserved fields.
10583            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10584
10585            // Safety:
10586            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10587            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10588            //   envelope_size bytes, there is always sufficient room.
10589            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect>(
10590            self.dynamic_offers.as_ref().map(<fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow),
10591            encoder, offset + cur_offset, depth
10592        )?;
10593
10594            _prev_end_offset = cur_offset + envelope_size;
10595            if 3 > max_ordinal {
10596                return Ok(());
10597            }
10598
10599            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10600            // are envelope_size bytes.
10601            let cur_offset: usize = (3 - 1) * envelope_size;
10602
10603            // Zero reserved fields.
10604            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10605
10606            // Safety:
10607            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10608            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10609            //   envelope_size bytes, there is always sufficient room.
10610            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
10611            self.controller.as_mut().map(<fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10612            encoder, offset + cur_offset, depth
10613        )?;
10614
10615            _prev_end_offset = cur_offset + envelope_size;
10616            if 4 > max_ordinal {
10617                return Ok(());
10618            }
10619
10620            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10621            // are envelope_size bytes.
10622            let cur_offset: usize = (4 - 1) * envelope_size;
10623
10624            // Zero reserved fields.
10625            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10626
10627            // Safety:
10628            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10629            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10630            //   envelope_size bytes, there is always sufficient room.
10631            fidl::encoding::encode_in_envelope_optional::<fdomain_fuchsia_component_sandbox::DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
10632            self.dictionary.as_mut().map(<fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10633            encoder, offset + cur_offset, depth
10634        )?;
10635
10636            _prev_end_offset = cur_offset + envelope_size;
10637            if 5 > max_ordinal {
10638                return Ok(());
10639            }
10640
10641            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10642            // are envelope_size bytes.
10643            let cur_offset: usize = (5 - 1) * envelope_size;
10644
10645            // Zero reserved fields.
10646            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10647
10648            // Safety:
10649            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10650            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10651            //   envelope_size bytes, there is always sufficient room.
10652            fidl::encoding::encode_in_envelope_optional::<
10653                fidl::encoding::HandleType<
10654                    fdomain_client::EventPair,
10655                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10656                    2147483648,
10657                >,
10658                fdomain_client::fidl::FDomainResourceDialect,
10659            >(
10660                self.additional_inputs.as_mut().map(
10661                    <fidl::encoding::HandleType<
10662                        fdomain_client::EventPair,
10663                        { fidl::ObjectType::EVENTPAIR.into_raw() },
10664                        2147483648,
10665                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10666                ),
10667                encoder,
10668                offset + cur_offset,
10669                depth,
10670            )?;
10671
10672            _prev_end_offset = cur_offset + envelope_size;
10673
10674            Ok(())
10675        }
10676    }
10677
10678    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
10679        for CreateChildArgs
10680    {
10681        #[inline(always)]
10682        fn new_empty() -> Self {
10683            Self::default()
10684        }
10685
10686        unsafe fn decode(
10687            &mut self,
10688            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10689            offset: usize,
10690            mut depth: fidl::encoding::Depth,
10691        ) -> fidl::Result<()> {
10692            decoder.debug_check_bounds::<Self>(offset);
10693            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10694                None => return Err(fidl::Error::NotNullable),
10695                Some(len) => len,
10696            };
10697            // Calling decoder.out_of_line_offset(0) is not allowed.
10698            if len == 0 {
10699                return Ok(());
10700            };
10701            depth.increment()?;
10702            let envelope_size = 8;
10703            let bytes_len = len * envelope_size;
10704            let offset = decoder.out_of_line_offset(bytes_len)?;
10705            // Decode the envelope for each type.
10706            let mut _next_ordinal_to_read = 0;
10707            let mut next_offset = offset;
10708            let end_offset = offset + bytes_len;
10709            _next_ordinal_to_read += 1;
10710            if next_offset >= end_offset {
10711                return Ok(());
10712            }
10713
10714            // Decode unknown envelopes for gaps in ordinals.
10715            while _next_ordinal_to_read < 1 {
10716                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10717                _next_ordinal_to_read += 1;
10718                next_offset += envelope_size;
10719            }
10720
10721            let next_out_of_line = decoder.next_out_of_line();
10722            let handles_before = decoder.remaining_handles();
10723            if let Some((inlined, num_bytes, num_handles)) =
10724                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10725            {
10726                let member_inline_size = <fidl::encoding::Vector<
10727                    fdomain_fuchsia_process::HandleInfo,
10728                    128,
10729                > as fidl::encoding::TypeMarker>::inline_size(
10730                    decoder.context
10731                );
10732                if inlined != (member_inline_size <= 4) {
10733                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10734                }
10735                let inner_offset;
10736                let mut inner_depth = depth.clone();
10737                if inlined {
10738                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10739                    inner_offset = next_offset;
10740                } else {
10741                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10742                    inner_depth.increment()?;
10743                }
10744                let val_ref =
10745                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect));
10746                fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10747                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10748                {
10749                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10750                }
10751                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10752                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10753                }
10754            }
10755
10756            next_offset += envelope_size;
10757            _next_ordinal_to_read += 1;
10758            if next_offset >= end_offset {
10759                return Ok(());
10760            }
10761
10762            // Decode unknown envelopes for gaps in ordinals.
10763            while _next_ordinal_to_read < 2 {
10764                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10765                _next_ordinal_to_read += 1;
10766                next_offset += envelope_size;
10767            }
10768
10769            let next_out_of_line = decoder.next_out_of_line();
10770            let handles_before = decoder.remaining_handles();
10771            if let Some((inlined, num_bytes, num_handles)) =
10772                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10773            {
10774                let member_inline_size = <fidl::encoding::Vector<
10775                    fdomain_fuchsia_component_decl::Offer,
10776                    128,
10777                > as fidl::encoding::TypeMarker>::inline_size(
10778                    decoder.context
10779                );
10780                if inlined != (member_inline_size <= 4) {
10781                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10782                }
10783                let inner_offset;
10784                let mut inner_depth = depth.clone();
10785                if inlined {
10786                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10787                    inner_offset = next_offset;
10788                } else {
10789                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10790                    inner_depth.increment()?;
10791                }
10792                let val_ref =
10793                self.dynamic_offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect));
10794                fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10795                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10796                {
10797                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10798                }
10799                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10800                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10801                }
10802            }
10803
10804            next_offset += envelope_size;
10805            _next_ordinal_to_read += 1;
10806            if next_offset >= end_offset {
10807                return Ok(());
10808            }
10809
10810            // Decode unknown envelopes for gaps in ordinals.
10811            while _next_ordinal_to_read < 3 {
10812                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10813                _next_ordinal_to_read += 1;
10814                next_offset += envelope_size;
10815            }
10816
10817            let next_out_of_line = decoder.next_out_of_line();
10818            let handles_before = decoder.remaining_handles();
10819            if let Some((inlined, num_bytes, num_handles)) =
10820                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10821            {
10822                let member_inline_size = <fidl::encoding::Endpoint<
10823                    fdomain_client::fidl::ServerEnd<ControllerMarker>,
10824                > as fidl::encoding::TypeMarker>::inline_size(
10825                    decoder.context
10826                );
10827                if inlined != (member_inline_size <= 4) {
10828                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10829                }
10830                let inner_offset;
10831                let mut inner_depth = depth.clone();
10832                if inlined {
10833                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10834                    inner_offset = next_offset;
10835                } else {
10836                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10837                    inner_depth.increment()?;
10838                }
10839                let val_ref = self.controller.get_or_insert_with(|| {
10840                    fidl::new_empty!(
10841                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
10842                        fdomain_client::fidl::FDomainResourceDialect
10843                    )
10844                });
10845                fidl::decode!(
10846                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
10847                    fdomain_client::fidl::FDomainResourceDialect,
10848                    val_ref,
10849                    decoder,
10850                    inner_offset,
10851                    inner_depth
10852                )?;
10853                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10854                {
10855                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10856                }
10857                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10858                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10859                }
10860            }
10861
10862            next_offset += envelope_size;
10863            _next_ordinal_to_read += 1;
10864            if next_offset >= end_offset {
10865                return Ok(());
10866            }
10867
10868            // Decode unknown envelopes for gaps in ordinals.
10869            while _next_ordinal_to_read < 4 {
10870                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10871                _next_ordinal_to_read += 1;
10872                next_offset += envelope_size;
10873            }
10874
10875            let next_out_of_line = decoder.next_out_of_line();
10876            let handles_before = decoder.remaining_handles();
10877            if let Some((inlined, num_bytes, num_handles)) =
10878                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10879            {
10880                let member_inline_size = <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10881                if inlined != (member_inline_size <= 4) {
10882                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10883                }
10884                let inner_offset;
10885                let mut inner_depth = depth.clone();
10886                if inlined {
10887                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10888                    inner_offset = next_offset;
10889                } else {
10890                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10891                    inner_depth.increment()?;
10892                }
10893                let val_ref = self.dictionary.get_or_insert_with(|| {
10894                    fidl::new_empty!(
10895                        fdomain_fuchsia_component_sandbox::DictionaryRef,
10896                        fdomain_client::fidl::FDomainResourceDialect
10897                    )
10898                });
10899                fidl::decode!(
10900                    fdomain_fuchsia_component_sandbox::DictionaryRef,
10901                    fdomain_client::fidl::FDomainResourceDialect,
10902                    val_ref,
10903                    decoder,
10904                    inner_offset,
10905                    inner_depth
10906                )?;
10907                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10908                {
10909                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10910                }
10911                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10912                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10913                }
10914            }
10915
10916            next_offset += envelope_size;
10917            _next_ordinal_to_read += 1;
10918            if next_offset >= end_offset {
10919                return Ok(());
10920            }
10921
10922            // Decode unknown envelopes for gaps in ordinals.
10923            while _next_ordinal_to_read < 5 {
10924                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10925                _next_ordinal_to_read += 1;
10926                next_offset += envelope_size;
10927            }
10928
10929            let next_out_of_line = decoder.next_out_of_line();
10930            let handles_before = decoder.remaining_handles();
10931            if let Some((inlined, num_bytes, num_handles)) =
10932                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10933            {
10934                let member_inline_size = <fidl::encoding::HandleType<
10935                    fdomain_client::EventPair,
10936                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10937                    2147483648,
10938                > as fidl::encoding::TypeMarker>::inline_size(
10939                    decoder.context
10940                );
10941                if inlined != (member_inline_size <= 4) {
10942                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10943                }
10944                let inner_offset;
10945                let mut inner_depth = depth.clone();
10946                if inlined {
10947                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10948                    inner_offset = next_offset;
10949                } else {
10950                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10951                    inner_depth.increment()?;
10952                }
10953                let val_ref =
10954                self.additional_inputs.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
10955                fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10956                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10957                {
10958                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10959                }
10960                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10961                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10962                }
10963            }
10964
10965            next_offset += envelope_size;
10966
10967            // Decode the remaining unknown envelopes.
10968            while next_offset < end_offset {
10969                _next_ordinal_to_read += 1;
10970                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10971                next_offset += envelope_size;
10972            }
10973
10974            Ok(())
10975        }
10976    }
10977
10978    impl DebugStartedPayload {
10979        #[inline(always)]
10980        fn max_ordinal_present(&self) -> u64 {
10981            if let Some(_) = self.break_on_start {
10982                return 2;
10983            }
10984            if let Some(_) = self.runtime_dir {
10985                return 1;
10986            }
10987            0
10988        }
10989    }
10990
10991    impl fidl::encoding::ResourceTypeMarker for DebugStartedPayload {
10992        type Borrowed<'a> = &'a mut Self;
10993        fn take_or_borrow<'a>(
10994            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10995        ) -> Self::Borrowed<'a> {
10996            value
10997        }
10998    }
10999
11000    unsafe impl fidl::encoding::TypeMarker for DebugStartedPayload {
11001        type Owned = Self;
11002
11003        #[inline(always)]
11004        fn inline_align(_context: fidl::encoding::Context) -> usize {
11005            8
11006        }
11007
11008        #[inline(always)]
11009        fn inline_size(_context: fidl::encoding::Context) -> usize {
11010            16
11011        }
11012    }
11013
11014    unsafe impl
11015        fidl::encoding::Encode<DebugStartedPayload, fdomain_client::fidl::FDomainResourceDialect>
11016        for &mut DebugStartedPayload
11017    {
11018        unsafe fn encode(
11019            self,
11020            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11021            offset: usize,
11022            mut depth: fidl::encoding::Depth,
11023        ) -> fidl::Result<()> {
11024            encoder.debug_check_bounds::<DebugStartedPayload>(offset);
11025            // Vector header
11026            let max_ordinal: u64 = self.max_ordinal_present();
11027            encoder.write_num(max_ordinal, offset);
11028            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11029            // Calling encoder.out_of_line_offset(0) is not allowed.
11030            if max_ordinal == 0 {
11031                return Ok(());
11032            }
11033            depth.increment()?;
11034            let envelope_size = 8;
11035            let bytes_len = max_ordinal as usize * envelope_size;
11036            #[allow(unused_variables)]
11037            let offset = encoder.out_of_line_offset(bytes_len);
11038            let mut _prev_end_offset: usize = 0;
11039            if 1 > max_ordinal {
11040                return Ok(());
11041            }
11042
11043            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11044            // are envelope_size bytes.
11045            let cur_offset: usize = (1 - 1) * envelope_size;
11046
11047            // Zero reserved fields.
11048            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11049
11050            // Safety:
11051            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11052            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11053            //   envelope_size bytes, there is always sufficient room.
11054            fidl::encoding::encode_in_envelope_optional::<
11055                fidl::encoding::Endpoint<
11056                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11057                >,
11058                fdomain_client::fidl::FDomainResourceDialect,
11059            >(
11060                self.runtime_dir.as_mut().map(
11061                    <fidl::encoding::Endpoint<
11062                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11063                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11064                ),
11065                encoder,
11066                offset + cur_offset,
11067                depth,
11068            )?;
11069
11070            _prev_end_offset = cur_offset + envelope_size;
11071            if 2 > max_ordinal {
11072                return Ok(());
11073            }
11074
11075            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11076            // are envelope_size bytes.
11077            let cur_offset: usize = (2 - 1) * envelope_size;
11078
11079            // Zero reserved fields.
11080            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11081
11082            // Safety:
11083            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11084            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11085            //   envelope_size bytes, there is always sufficient room.
11086            fidl::encoding::encode_in_envelope_optional::<
11087                fidl::encoding::HandleType<
11088                    fdomain_client::EventPair,
11089                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11090                    2147483648,
11091                >,
11092                fdomain_client::fidl::FDomainResourceDialect,
11093            >(
11094                self.break_on_start.as_mut().map(
11095                    <fidl::encoding::HandleType<
11096                        fdomain_client::EventPair,
11097                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11098                        2147483648,
11099                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11100                ),
11101                encoder,
11102                offset + cur_offset,
11103                depth,
11104            )?;
11105
11106            _prev_end_offset = cur_offset + envelope_size;
11107
11108            Ok(())
11109        }
11110    }
11111
11112    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
11113        for DebugStartedPayload
11114    {
11115        #[inline(always)]
11116        fn new_empty() -> Self {
11117            Self::default()
11118        }
11119
11120        unsafe fn decode(
11121            &mut self,
11122            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11123            offset: usize,
11124            mut depth: fidl::encoding::Depth,
11125        ) -> fidl::Result<()> {
11126            decoder.debug_check_bounds::<Self>(offset);
11127            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11128                None => return Err(fidl::Error::NotNullable),
11129                Some(len) => len,
11130            };
11131            // Calling decoder.out_of_line_offset(0) is not allowed.
11132            if len == 0 {
11133                return Ok(());
11134            };
11135            depth.increment()?;
11136            let envelope_size = 8;
11137            let bytes_len = len * envelope_size;
11138            let offset = decoder.out_of_line_offset(bytes_len)?;
11139            // Decode the envelope for each type.
11140            let mut _next_ordinal_to_read = 0;
11141            let mut next_offset = offset;
11142            let end_offset = offset + bytes_len;
11143            _next_ordinal_to_read += 1;
11144            if next_offset >= end_offset {
11145                return Ok(());
11146            }
11147
11148            // Decode unknown envelopes for gaps in ordinals.
11149            while _next_ordinal_to_read < 1 {
11150                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11151                _next_ordinal_to_read += 1;
11152                next_offset += envelope_size;
11153            }
11154
11155            let next_out_of_line = decoder.next_out_of_line();
11156            let handles_before = decoder.remaining_handles();
11157            if let Some((inlined, num_bytes, num_handles)) =
11158                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11159            {
11160                let member_inline_size = <fidl::encoding::Endpoint<
11161                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11162                > as fidl::encoding::TypeMarker>::inline_size(
11163                    decoder.context
11164                );
11165                if inlined != (member_inline_size <= 4) {
11166                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11167                }
11168                let inner_offset;
11169                let mut inner_depth = depth.clone();
11170                if inlined {
11171                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11172                    inner_offset = next_offset;
11173                } else {
11174                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11175                    inner_depth.increment()?;
11176                }
11177                let val_ref = self.runtime_dir.get_or_insert_with(|| {
11178                    fidl::new_empty!(
11179                        fidl::encoding::Endpoint<
11180                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11181                        >,
11182                        fdomain_client::fidl::FDomainResourceDialect
11183                    )
11184                });
11185                fidl::decode!(
11186                    fidl::encoding::Endpoint<
11187                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11188                    >,
11189                    fdomain_client::fidl::FDomainResourceDialect,
11190                    val_ref,
11191                    decoder,
11192                    inner_offset,
11193                    inner_depth
11194                )?;
11195                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11196                {
11197                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11198                }
11199                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11200                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11201                }
11202            }
11203
11204            next_offset += envelope_size;
11205            _next_ordinal_to_read += 1;
11206            if next_offset >= end_offset {
11207                return Ok(());
11208            }
11209
11210            // Decode unknown envelopes for gaps in ordinals.
11211            while _next_ordinal_to_read < 2 {
11212                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11213                _next_ordinal_to_read += 1;
11214                next_offset += envelope_size;
11215            }
11216
11217            let next_out_of_line = decoder.next_out_of_line();
11218            let handles_before = decoder.remaining_handles();
11219            if let Some((inlined, num_bytes, num_handles)) =
11220                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11221            {
11222                let member_inline_size = <fidl::encoding::HandleType<
11223                    fdomain_client::EventPair,
11224                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11225                    2147483648,
11226                > as fidl::encoding::TypeMarker>::inline_size(
11227                    decoder.context
11228                );
11229                if inlined != (member_inline_size <= 4) {
11230                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11231                }
11232                let inner_offset;
11233                let mut inner_depth = depth.clone();
11234                if inlined {
11235                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11236                    inner_offset = next_offset;
11237                } else {
11238                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11239                    inner_depth.increment()?;
11240                }
11241                let val_ref =
11242                self.break_on_start.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
11243                fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11244                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11245                {
11246                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11247                }
11248                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11249                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11250                }
11251            }
11252
11253            next_offset += envelope_size;
11254
11255            // Decode the remaining unknown envelopes.
11256            while next_offset < end_offset {
11257                _next_ordinal_to_read += 1;
11258                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11259                next_offset += envelope_size;
11260            }
11261
11262            Ok(())
11263        }
11264    }
11265
11266    impl Event {
11267        #[inline(always)]
11268        fn max_ordinal_present(&self) -> u64 {
11269            if let Some(_) = self.payload {
11270                return 2;
11271            }
11272            if let Some(_) = self.header {
11273                return 1;
11274            }
11275            0
11276        }
11277    }
11278
11279    impl fidl::encoding::ResourceTypeMarker for Event {
11280        type Borrowed<'a> = &'a mut Self;
11281        fn take_or_borrow<'a>(
11282            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11283        ) -> Self::Borrowed<'a> {
11284            value
11285        }
11286    }
11287
11288    unsafe impl fidl::encoding::TypeMarker for Event {
11289        type Owned = Self;
11290
11291        #[inline(always)]
11292        fn inline_align(_context: fidl::encoding::Context) -> usize {
11293            8
11294        }
11295
11296        #[inline(always)]
11297        fn inline_size(_context: fidl::encoding::Context) -> usize {
11298            16
11299        }
11300    }
11301
11302    unsafe impl fidl::encoding::Encode<Event, fdomain_client::fidl::FDomainResourceDialect>
11303        for &mut Event
11304    {
11305        unsafe fn encode(
11306            self,
11307            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11308            offset: usize,
11309            mut depth: fidl::encoding::Depth,
11310        ) -> fidl::Result<()> {
11311            encoder.debug_check_bounds::<Event>(offset);
11312            // Vector header
11313            let max_ordinal: u64 = self.max_ordinal_present();
11314            encoder.write_num(max_ordinal, offset);
11315            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11316            // Calling encoder.out_of_line_offset(0) is not allowed.
11317            if max_ordinal == 0 {
11318                return Ok(());
11319            }
11320            depth.increment()?;
11321            let envelope_size = 8;
11322            let bytes_len = max_ordinal as usize * envelope_size;
11323            #[allow(unused_variables)]
11324            let offset = encoder.out_of_line_offset(bytes_len);
11325            let mut _prev_end_offset: usize = 0;
11326            if 1 > max_ordinal {
11327                return Ok(());
11328            }
11329
11330            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11331            // are envelope_size bytes.
11332            let cur_offset: usize = (1 - 1) * envelope_size;
11333
11334            // Zero reserved fields.
11335            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11336
11337            // Safety:
11338            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11339            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11340            //   envelope_size bytes, there is always sufficient room.
11341            fidl::encoding::encode_in_envelope_optional::<
11342                EventHeader,
11343                fdomain_client::fidl::FDomainResourceDialect,
11344            >(
11345                self.header.as_ref().map(<EventHeader as fidl::encoding::ValueTypeMarker>::borrow),
11346                encoder,
11347                offset + cur_offset,
11348                depth,
11349            )?;
11350
11351            _prev_end_offset = cur_offset + envelope_size;
11352            if 2 > max_ordinal {
11353                return Ok(());
11354            }
11355
11356            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11357            // are envelope_size bytes.
11358            let cur_offset: usize = (2 - 1) * envelope_size;
11359
11360            // Zero reserved fields.
11361            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11362
11363            // Safety:
11364            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11365            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11366            //   envelope_size bytes, there is always sufficient room.
11367            fidl::encoding::encode_in_envelope_optional::<
11368                EventPayload,
11369                fdomain_client::fidl::FDomainResourceDialect,
11370            >(
11371                self.payload
11372                    .as_mut()
11373                    .map(<EventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11374                encoder,
11375                offset + cur_offset,
11376                depth,
11377            )?;
11378
11379            _prev_end_offset = cur_offset + envelope_size;
11380
11381            Ok(())
11382        }
11383    }
11384
11385    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Event {
11386        #[inline(always)]
11387        fn new_empty() -> Self {
11388            Self::default()
11389        }
11390
11391        unsafe fn decode(
11392            &mut self,
11393            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11394            offset: usize,
11395            mut depth: fidl::encoding::Depth,
11396        ) -> fidl::Result<()> {
11397            decoder.debug_check_bounds::<Self>(offset);
11398            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11399                None => return Err(fidl::Error::NotNullable),
11400                Some(len) => len,
11401            };
11402            // Calling decoder.out_of_line_offset(0) is not allowed.
11403            if len == 0 {
11404                return Ok(());
11405            };
11406            depth.increment()?;
11407            let envelope_size = 8;
11408            let bytes_len = len * envelope_size;
11409            let offset = decoder.out_of_line_offset(bytes_len)?;
11410            // Decode the envelope for each type.
11411            let mut _next_ordinal_to_read = 0;
11412            let mut next_offset = offset;
11413            let end_offset = offset + bytes_len;
11414            _next_ordinal_to_read += 1;
11415            if next_offset >= end_offset {
11416                return Ok(());
11417            }
11418
11419            // Decode unknown envelopes for gaps in ordinals.
11420            while _next_ordinal_to_read < 1 {
11421                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11422                _next_ordinal_to_read += 1;
11423                next_offset += envelope_size;
11424            }
11425
11426            let next_out_of_line = decoder.next_out_of_line();
11427            let handles_before = decoder.remaining_handles();
11428            if let Some((inlined, num_bytes, num_handles)) =
11429                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11430            {
11431                let member_inline_size =
11432                    <EventHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11433                if inlined != (member_inline_size <= 4) {
11434                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11435                }
11436                let inner_offset;
11437                let mut inner_depth = depth.clone();
11438                if inlined {
11439                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11440                    inner_offset = next_offset;
11441                } else {
11442                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11443                    inner_depth.increment()?;
11444                }
11445                let val_ref = self.header.get_or_insert_with(|| {
11446                    fidl::new_empty!(EventHeader, fdomain_client::fidl::FDomainResourceDialect)
11447                });
11448                fidl::decode!(
11449                    EventHeader,
11450                    fdomain_client::fidl::FDomainResourceDialect,
11451                    val_ref,
11452                    decoder,
11453                    inner_offset,
11454                    inner_depth
11455                )?;
11456                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11457                {
11458                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11459                }
11460                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11461                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11462                }
11463            }
11464
11465            next_offset += envelope_size;
11466            _next_ordinal_to_read += 1;
11467            if next_offset >= end_offset {
11468                return Ok(());
11469            }
11470
11471            // Decode unknown envelopes for gaps in ordinals.
11472            while _next_ordinal_to_read < 2 {
11473                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11474                _next_ordinal_to_read += 1;
11475                next_offset += envelope_size;
11476            }
11477
11478            let next_out_of_line = decoder.next_out_of_line();
11479            let handles_before = decoder.remaining_handles();
11480            if let Some((inlined, num_bytes, num_handles)) =
11481                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11482            {
11483                let member_inline_size =
11484                    <EventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11485                if inlined != (member_inline_size <= 4) {
11486                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11487                }
11488                let inner_offset;
11489                let mut inner_depth = depth.clone();
11490                if inlined {
11491                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11492                    inner_offset = next_offset;
11493                } else {
11494                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11495                    inner_depth.increment()?;
11496                }
11497                let val_ref = self.payload.get_or_insert_with(|| {
11498                    fidl::new_empty!(EventPayload, fdomain_client::fidl::FDomainResourceDialect)
11499                });
11500                fidl::decode!(
11501                    EventPayload,
11502                    fdomain_client::fidl::FDomainResourceDialect,
11503                    val_ref,
11504                    decoder,
11505                    inner_offset,
11506                    inner_depth
11507                )?;
11508                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11509                {
11510                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11511                }
11512                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11513                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11514                }
11515            }
11516
11517            next_offset += envelope_size;
11518
11519            // Decode the remaining unknown envelopes.
11520            while next_offset < end_offset {
11521                _next_ordinal_to_read += 1;
11522                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11523                next_offset += envelope_size;
11524            }
11525
11526            Ok(())
11527        }
11528    }
11529
11530    impl NamespaceEntry {
11531        #[inline(always)]
11532        fn max_ordinal_present(&self) -> u64 {
11533            if let Some(_) = self.directory {
11534                return 2;
11535            }
11536            if let Some(_) = self.path {
11537                return 1;
11538            }
11539            0
11540        }
11541    }
11542
11543    impl fidl::encoding::ResourceTypeMarker for NamespaceEntry {
11544        type Borrowed<'a> = &'a mut Self;
11545        fn take_or_borrow<'a>(
11546            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11547        ) -> Self::Borrowed<'a> {
11548            value
11549        }
11550    }
11551
11552    unsafe impl fidl::encoding::TypeMarker for NamespaceEntry {
11553        type Owned = Self;
11554
11555        #[inline(always)]
11556        fn inline_align(_context: fidl::encoding::Context) -> usize {
11557            8
11558        }
11559
11560        #[inline(always)]
11561        fn inline_size(_context: fidl::encoding::Context) -> usize {
11562            16
11563        }
11564    }
11565
11566    unsafe impl fidl::encoding::Encode<NamespaceEntry, fdomain_client::fidl::FDomainResourceDialect>
11567        for &mut NamespaceEntry
11568    {
11569        unsafe fn encode(
11570            self,
11571            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11572            offset: usize,
11573            mut depth: fidl::encoding::Depth,
11574        ) -> fidl::Result<()> {
11575            encoder.debug_check_bounds::<NamespaceEntry>(offset);
11576            // Vector header
11577            let max_ordinal: u64 = self.max_ordinal_present();
11578            encoder.write_num(max_ordinal, offset);
11579            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11580            // Calling encoder.out_of_line_offset(0) is not allowed.
11581            if max_ordinal == 0 {
11582                return Ok(());
11583            }
11584            depth.increment()?;
11585            let envelope_size = 8;
11586            let bytes_len = max_ordinal as usize * envelope_size;
11587            #[allow(unused_variables)]
11588            let offset = encoder.out_of_line_offset(bytes_len);
11589            let mut _prev_end_offset: usize = 0;
11590            if 1 > max_ordinal {
11591                return Ok(());
11592            }
11593
11594            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11595            // are envelope_size bytes.
11596            let cur_offset: usize = (1 - 1) * envelope_size;
11597
11598            // Zero reserved fields.
11599            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11600
11601            // Safety:
11602            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11603            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11604            //   envelope_size bytes, there is always sufficient room.
11605            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fdomain_client::fidl::FDomainResourceDialect>(
11606            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
11607            encoder, offset + cur_offset, depth
11608        )?;
11609
11610            _prev_end_offset = cur_offset + envelope_size;
11611            if 2 > max_ordinal {
11612                return Ok(());
11613            }
11614
11615            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11616            // are envelope_size bytes.
11617            let cur_offset: usize = (2 - 1) * envelope_size;
11618
11619            // Zero reserved fields.
11620            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11621
11622            // Safety:
11623            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11624            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11625            //   envelope_size bytes, there is always sufficient room.
11626            fidl::encoding::encode_in_envelope_optional::<
11627                fidl::encoding::Endpoint<
11628                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11629                >,
11630                fdomain_client::fidl::FDomainResourceDialect,
11631            >(
11632                self.directory.as_mut().map(
11633                    <fidl::encoding::Endpoint<
11634                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11635                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11636                ),
11637                encoder,
11638                offset + cur_offset,
11639                depth,
11640            )?;
11641
11642            _prev_end_offset = cur_offset + envelope_size;
11643
11644            Ok(())
11645        }
11646    }
11647
11648    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for NamespaceEntry {
11649        #[inline(always)]
11650        fn new_empty() -> Self {
11651            Self::default()
11652        }
11653
11654        unsafe fn decode(
11655            &mut self,
11656            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11657            offset: usize,
11658            mut depth: fidl::encoding::Depth,
11659        ) -> fidl::Result<()> {
11660            decoder.debug_check_bounds::<Self>(offset);
11661            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11662                None => return Err(fidl::Error::NotNullable),
11663                Some(len) => len,
11664            };
11665            // Calling decoder.out_of_line_offset(0) is not allowed.
11666            if len == 0 {
11667                return Ok(());
11668            };
11669            depth.increment()?;
11670            let envelope_size = 8;
11671            let bytes_len = len * envelope_size;
11672            let offset = decoder.out_of_line_offset(bytes_len)?;
11673            // Decode the envelope for each type.
11674            let mut _next_ordinal_to_read = 0;
11675            let mut next_offset = offset;
11676            let end_offset = offset + bytes_len;
11677            _next_ordinal_to_read += 1;
11678            if next_offset >= end_offset {
11679                return Ok(());
11680            }
11681
11682            // Decode unknown envelopes for gaps in ordinals.
11683            while _next_ordinal_to_read < 1 {
11684                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11685                _next_ordinal_to_read += 1;
11686                next_offset += envelope_size;
11687            }
11688
11689            let next_out_of_line = decoder.next_out_of_line();
11690            let handles_before = decoder.remaining_handles();
11691            if let Some((inlined, num_bytes, num_handles)) =
11692                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11693            {
11694                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11695                if inlined != (member_inline_size <= 4) {
11696                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11697                }
11698                let inner_offset;
11699                let mut inner_depth = depth.clone();
11700                if inlined {
11701                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11702                    inner_offset = next_offset;
11703                } else {
11704                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11705                    inner_depth.increment()?;
11706                }
11707                let val_ref = self.path.get_or_insert_with(|| {
11708                    fidl::new_empty!(
11709                        fidl::encoding::BoundedString<4095>,
11710                        fdomain_client::fidl::FDomainResourceDialect
11711                    )
11712                });
11713                fidl::decode!(
11714                    fidl::encoding::BoundedString<4095>,
11715                    fdomain_client::fidl::FDomainResourceDialect,
11716                    val_ref,
11717                    decoder,
11718                    inner_offset,
11719                    inner_depth
11720                )?;
11721                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11722                {
11723                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11724                }
11725                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11726                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11727                }
11728            }
11729
11730            next_offset += envelope_size;
11731            _next_ordinal_to_read += 1;
11732            if next_offset >= end_offset {
11733                return Ok(());
11734            }
11735
11736            // Decode unknown envelopes for gaps in ordinals.
11737            while _next_ordinal_to_read < 2 {
11738                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11739                _next_ordinal_to_read += 1;
11740                next_offset += envelope_size;
11741            }
11742
11743            let next_out_of_line = decoder.next_out_of_line();
11744            let handles_before = decoder.remaining_handles();
11745            if let Some((inlined, num_bytes, num_handles)) =
11746                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11747            {
11748                let member_inline_size = <fidl::encoding::Endpoint<
11749                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11750                > as fidl::encoding::TypeMarker>::inline_size(
11751                    decoder.context
11752                );
11753                if inlined != (member_inline_size <= 4) {
11754                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11755                }
11756                let inner_offset;
11757                let mut inner_depth = depth.clone();
11758                if inlined {
11759                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11760                    inner_offset = next_offset;
11761                } else {
11762                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11763                    inner_depth.increment()?;
11764                }
11765                let val_ref = self.directory.get_or_insert_with(|| {
11766                    fidl::new_empty!(
11767                        fidl::encoding::Endpoint<
11768                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11769                        >,
11770                        fdomain_client::fidl::FDomainResourceDialect
11771                    )
11772                });
11773                fidl::decode!(
11774                    fidl::encoding::Endpoint<
11775                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
11776                    >,
11777                    fdomain_client::fidl::FDomainResourceDialect,
11778                    val_ref,
11779                    decoder,
11780                    inner_offset,
11781                    inner_depth
11782                )?;
11783                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11784                {
11785                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11786                }
11787                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11788                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11789                }
11790            }
11791
11792            next_offset += envelope_size;
11793
11794            // Decode the remaining unknown envelopes.
11795            while next_offset < end_offset {
11796                _next_ordinal_to_read += 1;
11797                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11798                next_offset += envelope_size;
11799            }
11800
11801            Ok(())
11802        }
11803    }
11804
11805    impl StartChildArgs {
11806        #[inline(always)]
11807        fn max_ordinal_present(&self) -> u64 {
11808            if let Some(_) = self.additional_inputs {
11809                return 4;
11810            }
11811            if let Some(_) = self.dictionary {
11812                return 3;
11813            }
11814            if let Some(_) = self.namespace_entries {
11815                return 2;
11816            }
11817            if let Some(_) = self.numbered_handles {
11818                return 1;
11819            }
11820            0
11821        }
11822    }
11823
11824    impl fidl::encoding::ResourceTypeMarker for StartChildArgs {
11825        type Borrowed<'a> = &'a mut Self;
11826        fn take_or_borrow<'a>(
11827            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11828        ) -> Self::Borrowed<'a> {
11829            value
11830        }
11831    }
11832
11833    unsafe impl fidl::encoding::TypeMarker for StartChildArgs {
11834        type Owned = Self;
11835
11836        #[inline(always)]
11837        fn inline_align(_context: fidl::encoding::Context) -> usize {
11838            8
11839        }
11840
11841        #[inline(always)]
11842        fn inline_size(_context: fidl::encoding::Context) -> usize {
11843            16
11844        }
11845    }
11846
11847    unsafe impl fidl::encoding::Encode<StartChildArgs, fdomain_client::fidl::FDomainResourceDialect>
11848        for &mut StartChildArgs
11849    {
11850        unsafe fn encode(
11851            self,
11852            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11853            offset: usize,
11854            mut depth: fidl::encoding::Depth,
11855        ) -> fidl::Result<()> {
11856            encoder.debug_check_bounds::<StartChildArgs>(offset);
11857            // Vector header
11858            let max_ordinal: u64 = self.max_ordinal_present();
11859            encoder.write_num(max_ordinal, offset);
11860            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11861            // Calling encoder.out_of_line_offset(0) is not allowed.
11862            if max_ordinal == 0 {
11863                return Ok(());
11864            }
11865            depth.increment()?;
11866            let envelope_size = 8;
11867            let bytes_len = max_ordinal as usize * envelope_size;
11868            #[allow(unused_variables)]
11869            let offset = encoder.out_of_line_offset(bytes_len);
11870            let mut _prev_end_offset: usize = 0;
11871            if 1 > max_ordinal {
11872                return Ok(());
11873            }
11874
11875            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11876            // are envelope_size bytes.
11877            let cur_offset: usize = (1 - 1) * envelope_size;
11878
11879            // Zero reserved fields.
11880            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11881
11882            // Safety:
11883            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11884            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11885            //   envelope_size bytes, there is always sufficient room.
11886            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect>(
11887            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11888            encoder, offset + cur_offset, depth
11889        )?;
11890
11891            _prev_end_offset = cur_offset + envelope_size;
11892            if 2 > max_ordinal {
11893                return Ok(());
11894            }
11895
11896            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11897            // are envelope_size bytes.
11898            let cur_offset: usize = (2 - 1) * envelope_size;
11899
11900            // Zero reserved fields.
11901            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11902
11903            // Safety:
11904            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11905            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11906            //   envelope_size bytes, there is always sufficient room.
11907            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect>(
11908            self.namespace_entries.as_mut().map(<fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11909            encoder, offset + cur_offset, depth
11910        )?;
11911
11912            _prev_end_offset = cur_offset + envelope_size;
11913            if 3 > max_ordinal {
11914                return Ok(());
11915            }
11916
11917            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11918            // are envelope_size bytes.
11919            let cur_offset: usize = (3 - 1) * envelope_size;
11920
11921            // Zero reserved fields.
11922            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11923
11924            // Safety:
11925            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11926            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11927            //   envelope_size bytes, there is always sufficient room.
11928            fidl::encoding::encode_in_envelope_optional::<fdomain_fuchsia_component_sandbox::DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
11929            self.dictionary.as_mut().map(<fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11930            encoder, offset + cur_offset, depth
11931        )?;
11932
11933            _prev_end_offset = cur_offset + envelope_size;
11934            if 4 > max_ordinal {
11935                return Ok(());
11936            }
11937
11938            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11939            // are envelope_size bytes.
11940            let cur_offset: usize = (4 - 1) * envelope_size;
11941
11942            // Zero reserved fields.
11943            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11944
11945            // Safety:
11946            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11947            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11948            //   envelope_size bytes, there is always sufficient room.
11949            fidl::encoding::encode_in_envelope_optional::<
11950                fidl::encoding::HandleType<
11951                    fdomain_client::EventPair,
11952                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11953                    2147483648,
11954                >,
11955                fdomain_client::fidl::FDomainResourceDialect,
11956            >(
11957                self.additional_inputs.as_mut().map(
11958                    <fidl::encoding::HandleType<
11959                        fdomain_client::EventPair,
11960                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11961                        2147483648,
11962                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11963                ),
11964                encoder,
11965                offset + cur_offset,
11966                depth,
11967            )?;
11968
11969            _prev_end_offset = cur_offset + envelope_size;
11970
11971            Ok(())
11972        }
11973    }
11974
11975    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for StartChildArgs {
11976        #[inline(always)]
11977        fn new_empty() -> Self {
11978            Self::default()
11979        }
11980
11981        unsafe fn decode(
11982            &mut self,
11983            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
11984            offset: usize,
11985            mut depth: fidl::encoding::Depth,
11986        ) -> fidl::Result<()> {
11987            decoder.debug_check_bounds::<Self>(offset);
11988            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11989                None => return Err(fidl::Error::NotNullable),
11990                Some(len) => len,
11991            };
11992            // Calling decoder.out_of_line_offset(0) is not allowed.
11993            if len == 0 {
11994                return Ok(());
11995            };
11996            depth.increment()?;
11997            let envelope_size = 8;
11998            let bytes_len = len * envelope_size;
11999            let offset = decoder.out_of_line_offset(bytes_len)?;
12000            // Decode the envelope for each type.
12001            let mut _next_ordinal_to_read = 0;
12002            let mut next_offset = offset;
12003            let end_offset = offset + bytes_len;
12004            _next_ordinal_to_read += 1;
12005            if next_offset >= end_offset {
12006                return Ok(());
12007            }
12008
12009            // Decode unknown envelopes for gaps in ordinals.
12010            while _next_ordinal_to_read < 1 {
12011                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12012                _next_ordinal_to_read += 1;
12013                next_offset += envelope_size;
12014            }
12015
12016            let next_out_of_line = decoder.next_out_of_line();
12017            let handles_before = decoder.remaining_handles();
12018            if let Some((inlined, num_bytes, num_handles)) =
12019                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12020            {
12021                let member_inline_size = <fidl::encoding::Vector<
12022                    fdomain_fuchsia_process::HandleInfo,
12023                    128,
12024                > as fidl::encoding::TypeMarker>::inline_size(
12025                    decoder.context
12026                );
12027                if inlined != (member_inline_size <= 4) {
12028                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12029                }
12030                let inner_offset;
12031                let mut inner_depth = depth.clone();
12032                if inlined {
12033                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12034                    inner_offset = next_offset;
12035                } else {
12036                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12037                    inner_depth.increment()?;
12038                }
12039                let val_ref =
12040                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect));
12041                fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12042                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12043                {
12044                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12045                }
12046                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12047                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12048                }
12049            }
12050
12051            next_offset += envelope_size;
12052            _next_ordinal_to_read += 1;
12053            if next_offset >= end_offset {
12054                return Ok(());
12055            }
12056
12057            // Decode unknown envelopes for gaps in ordinals.
12058            while _next_ordinal_to_read < 2 {
12059                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12060                _next_ordinal_to_read += 1;
12061                next_offset += envelope_size;
12062            }
12063
12064            let next_out_of_line = decoder.next_out_of_line();
12065            let handles_before = decoder.remaining_handles();
12066            if let Some((inlined, num_bytes, num_handles)) =
12067                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12068            {
12069                let member_inline_size = <fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12070                if inlined != (member_inline_size <= 4) {
12071                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12072                }
12073                let inner_offset;
12074                let mut inner_depth = depth.clone();
12075                if inlined {
12076                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12077                    inner_offset = next_offset;
12078                } else {
12079                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12080                    inner_depth.increment()?;
12081                }
12082                let val_ref =
12083                self.namespace_entries.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect));
12084                fidl::decode!(fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12085                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12086                {
12087                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12088                }
12089                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12090                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12091                }
12092            }
12093
12094            next_offset += envelope_size;
12095            _next_ordinal_to_read += 1;
12096            if next_offset >= end_offset {
12097                return Ok(());
12098            }
12099
12100            // Decode unknown envelopes for gaps in ordinals.
12101            while _next_ordinal_to_read < 3 {
12102                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12103                _next_ordinal_to_read += 1;
12104                next_offset += envelope_size;
12105            }
12106
12107            let next_out_of_line = decoder.next_out_of_line();
12108            let handles_before = decoder.remaining_handles();
12109            if let Some((inlined, num_bytes, num_handles)) =
12110                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12111            {
12112                let member_inline_size = <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12113                if inlined != (member_inline_size <= 4) {
12114                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12115                }
12116                let inner_offset;
12117                let mut inner_depth = depth.clone();
12118                if inlined {
12119                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12120                    inner_offset = next_offset;
12121                } else {
12122                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12123                    inner_depth.increment()?;
12124                }
12125                let val_ref = self.dictionary.get_or_insert_with(|| {
12126                    fidl::new_empty!(
12127                        fdomain_fuchsia_component_sandbox::DictionaryRef,
12128                        fdomain_client::fidl::FDomainResourceDialect
12129                    )
12130                });
12131                fidl::decode!(
12132                    fdomain_fuchsia_component_sandbox::DictionaryRef,
12133                    fdomain_client::fidl::FDomainResourceDialect,
12134                    val_ref,
12135                    decoder,
12136                    inner_offset,
12137                    inner_depth
12138                )?;
12139                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12140                {
12141                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12142                }
12143                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12144                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12145                }
12146            }
12147
12148            next_offset += envelope_size;
12149            _next_ordinal_to_read += 1;
12150            if next_offset >= end_offset {
12151                return Ok(());
12152            }
12153
12154            // Decode unknown envelopes for gaps in ordinals.
12155            while _next_ordinal_to_read < 4 {
12156                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12157                _next_ordinal_to_read += 1;
12158                next_offset += envelope_size;
12159            }
12160
12161            let next_out_of_line = decoder.next_out_of_line();
12162            let handles_before = decoder.remaining_handles();
12163            if let Some((inlined, num_bytes, num_handles)) =
12164                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12165            {
12166                let member_inline_size = <fidl::encoding::HandleType<
12167                    fdomain_client::EventPair,
12168                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12169                    2147483648,
12170                > as fidl::encoding::TypeMarker>::inline_size(
12171                    decoder.context
12172                );
12173                if inlined != (member_inline_size <= 4) {
12174                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12175                }
12176                let inner_offset;
12177                let mut inner_depth = depth.clone();
12178                if inlined {
12179                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12180                    inner_offset = next_offset;
12181                } else {
12182                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12183                    inner_depth.increment()?;
12184                }
12185                let val_ref =
12186                self.additional_inputs.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect));
12187                fidl::decode!(fidl::encoding::HandleType<fdomain_client::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12188                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12189                {
12190                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12191                }
12192                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12193                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12194                }
12195            }
12196
12197            next_offset += envelope_size;
12198
12199            // Decode the remaining unknown envelopes.
12200            while next_offset < end_offset {
12201                _next_ordinal_to_read += 1;
12202                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12203                next_offset += envelope_size;
12204            }
12205
12206            Ok(())
12207        }
12208    }
12209
12210    impl fidl::encoding::ResourceTypeMarker for EventPayload {
12211        type Borrowed<'a> = &'a mut Self;
12212        fn take_or_borrow<'a>(
12213            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12214        ) -> Self::Borrowed<'a> {
12215            value
12216        }
12217    }
12218
12219    unsafe impl fidl::encoding::TypeMarker for EventPayload {
12220        type Owned = Self;
12221
12222        #[inline(always)]
12223        fn inline_align(_context: fidl::encoding::Context) -> usize {
12224            8
12225        }
12226
12227        #[inline(always)]
12228        fn inline_size(_context: fidl::encoding::Context) -> usize {
12229            16
12230        }
12231    }
12232
12233    unsafe impl fidl::encoding::Encode<EventPayload, fdomain_client::fidl::FDomainResourceDialect>
12234        for &mut EventPayload
12235    {
12236        #[inline]
12237        unsafe fn encode(
12238            self,
12239            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12240            offset: usize,
12241            _depth: fidl::encoding::Depth,
12242        ) -> fidl::Result<()> {
12243            encoder.debug_check_bounds::<EventPayload>(offset);
12244            encoder.write_num::<u64>(self.ordinal(), offset);
12245            match self {
12246            EventPayload::CapabilityRequested(ref mut val) => {
12247                fidl::encoding::encode_in_envelope::<CapabilityRequestedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12248                    <CapabilityRequestedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12249                    encoder, offset + 8, _depth
12250                )
12251            }
12252            EventPayload::Purged(ref val) => {
12253                fidl::encoding::encode_in_envelope::<PurgedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12254                    <PurgedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
12255                    encoder, offset + 8, _depth
12256                )
12257            }
12258            EventPayload::Discovered(ref val) => {
12259                fidl::encoding::encode_in_envelope::<DiscoveredPayload, fdomain_client::fidl::FDomainResourceDialect>(
12260                    <DiscoveredPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
12261                    encoder, offset + 8, _depth
12262                )
12263            }
12264            EventPayload::Destroyed(ref val) => {
12265                fidl::encoding::encode_in_envelope::<DestroyedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12266                    <DestroyedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
12267                    encoder, offset + 8, _depth
12268                )
12269            }
12270            EventPayload::Resolved(ref val) => {
12271                fidl::encoding::encode_in_envelope::<ResolvedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12272                    <ResolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
12273                    encoder, offset + 8, _depth
12274                )
12275            }
12276            EventPayload::Started(ref val) => {
12277                fidl::encoding::encode_in_envelope::<StartedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12278                    <StartedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
12279                    encoder, offset + 8, _depth
12280                )
12281            }
12282            EventPayload::Stopped(ref val) => {
12283                fidl::encoding::encode_in_envelope::<StoppedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12284                    <StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
12285                    encoder, offset + 8, _depth
12286                )
12287            }
12288            EventPayload::DebugStarted(ref mut val) => {
12289                fidl::encoding::encode_in_envelope::<DebugStartedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12290                    <DebugStartedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
12291                    encoder, offset + 8, _depth
12292                )
12293            }
12294            EventPayload::Unresolved(ref val) => {
12295                fidl::encoding::encode_in_envelope::<UnresolvedPayload, fdomain_client::fidl::FDomainResourceDialect>(
12296                    <UnresolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
12297                    encoder, offset + 8, _depth
12298                )
12299            }
12300            EventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
12301        }
12302        }
12303    }
12304
12305    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for EventPayload {
12306        #[inline(always)]
12307        fn new_empty() -> Self {
12308            Self::__SourceBreaking { unknown_ordinal: 0 }
12309        }
12310
12311        #[inline]
12312        unsafe fn decode(
12313            &mut self,
12314            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
12315            offset: usize,
12316            mut depth: fidl::encoding::Depth,
12317        ) -> fidl::Result<()> {
12318            decoder.debug_check_bounds::<Self>(offset);
12319            #[allow(unused_variables)]
12320            let next_out_of_line = decoder.next_out_of_line();
12321            let handles_before = decoder.remaining_handles();
12322            let (ordinal, inlined, num_bytes, num_handles) =
12323                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
12324
12325            let member_inline_size = match ordinal {
12326                1 => <CapabilityRequestedPayload as fidl::encoding::TypeMarker>::inline_size(
12327                    decoder.context,
12328                ),
12329                2 => <PurgedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12330                4 => {
12331                    <DiscoveredPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12332                }
12333                5 => <DestroyedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12334                6 => <ResolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12335                7 => <StartedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12336                8 => <StoppedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
12337                9 => <DebugStartedPayload as fidl::encoding::TypeMarker>::inline_size(
12338                    decoder.context,
12339                ),
12340                10 => {
12341                    <UnresolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
12342                }
12343                0 => return Err(fidl::Error::UnknownUnionTag),
12344                _ => num_bytes as usize,
12345            };
12346
12347            if inlined != (member_inline_size <= 4) {
12348                return Err(fidl::Error::InvalidInlineBitInEnvelope);
12349            }
12350            let _inner_offset;
12351            if inlined {
12352                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
12353                _inner_offset = offset + 8;
12354            } else {
12355                depth.increment()?;
12356                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12357            }
12358            match ordinal {
12359                1 => {
12360                    #[allow(irrefutable_let_patterns)]
12361                    if let EventPayload::CapabilityRequested(_) = self {
12362                        // Do nothing, read the value into the object
12363                    } else {
12364                        // Initialize `self` to the right variant
12365                        *self = EventPayload::CapabilityRequested(fidl::new_empty!(
12366                            CapabilityRequestedPayload,
12367                            fdomain_client::fidl::FDomainResourceDialect
12368                        ));
12369                    }
12370                    #[allow(irrefutable_let_patterns)]
12371                    if let EventPayload::CapabilityRequested(ref mut val) = self {
12372                        fidl::decode!(
12373                            CapabilityRequestedPayload,
12374                            fdomain_client::fidl::FDomainResourceDialect,
12375                            val,
12376                            decoder,
12377                            _inner_offset,
12378                            depth
12379                        )?;
12380                    } else {
12381                        unreachable!()
12382                    }
12383                }
12384                2 => {
12385                    #[allow(irrefutable_let_patterns)]
12386                    if let EventPayload::Purged(_) = self {
12387                        // Do nothing, read the value into the object
12388                    } else {
12389                        // Initialize `self` to the right variant
12390                        *self = EventPayload::Purged(fidl::new_empty!(
12391                            PurgedPayload,
12392                            fdomain_client::fidl::FDomainResourceDialect
12393                        ));
12394                    }
12395                    #[allow(irrefutable_let_patterns)]
12396                    if let EventPayload::Purged(ref mut val) = self {
12397                        fidl::decode!(
12398                            PurgedPayload,
12399                            fdomain_client::fidl::FDomainResourceDialect,
12400                            val,
12401                            decoder,
12402                            _inner_offset,
12403                            depth
12404                        )?;
12405                    } else {
12406                        unreachable!()
12407                    }
12408                }
12409                4 => {
12410                    #[allow(irrefutable_let_patterns)]
12411                    if let EventPayload::Discovered(_) = self {
12412                        // Do nothing, read the value into the object
12413                    } else {
12414                        // Initialize `self` to the right variant
12415                        *self = EventPayload::Discovered(fidl::new_empty!(
12416                            DiscoveredPayload,
12417                            fdomain_client::fidl::FDomainResourceDialect
12418                        ));
12419                    }
12420                    #[allow(irrefutable_let_patterns)]
12421                    if let EventPayload::Discovered(ref mut val) = self {
12422                        fidl::decode!(
12423                            DiscoveredPayload,
12424                            fdomain_client::fidl::FDomainResourceDialect,
12425                            val,
12426                            decoder,
12427                            _inner_offset,
12428                            depth
12429                        )?;
12430                    } else {
12431                        unreachable!()
12432                    }
12433                }
12434                5 => {
12435                    #[allow(irrefutable_let_patterns)]
12436                    if let EventPayload::Destroyed(_) = self {
12437                        // Do nothing, read the value into the object
12438                    } else {
12439                        // Initialize `self` to the right variant
12440                        *self = EventPayload::Destroyed(fidl::new_empty!(
12441                            DestroyedPayload,
12442                            fdomain_client::fidl::FDomainResourceDialect
12443                        ));
12444                    }
12445                    #[allow(irrefutable_let_patterns)]
12446                    if let EventPayload::Destroyed(ref mut val) = self {
12447                        fidl::decode!(
12448                            DestroyedPayload,
12449                            fdomain_client::fidl::FDomainResourceDialect,
12450                            val,
12451                            decoder,
12452                            _inner_offset,
12453                            depth
12454                        )?;
12455                    } else {
12456                        unreachable!()
12457                    }
12458                }
12459                6 => {
12460                    #[allow(irrefutable_let_patterns)]
12461                    if let EventPayload::Resolved(_) = self {
12462                        // Do nothing, read the value into the object
12463                    } else {
12464                        // Initialize `self` to the right variant
12465                        *self = EventPayload::Resolved(fidl::new_empty!(
12466                            ResolvedPayload,
12467                            fdomain_client::fidl::FDomainResourceDialect
12468                        ));
12469                    }
12470                    #[allow(irrefutable_let_patterns)]
12471                    if let EventPayload::Resolved(ref mut val) = self {
12472                        fidl::decode!(
12473                            ResolvedPayload,
12474                            fdomain_client::fidl::FDomainResourceDialect,
12475                            val,
12476                            decoder,
12477                            _inner_offset,
12478                            depth
12479                        )?;
12480                    } else {
12481                        unreachable!()
12482                    }
12483                }
12484                7 => {
12485                    #[allow(irrefutable_let_patterns)]
12486                    if let EventPayload::Started(_) = self {
12487                        // Do nothing, read the value into the object
12488                    } else {
12489                        // Initialize `self` to the right variant
12490                        *self = EventPayload::Started(fidl::new_empty!(
12491                            StartedPayload,
12492                            fdomain_client::fidl::FDomainResourceDialect
12493                        ));
12494                    }
12495                    #[allow(irrefutable_let_patterns)]
12496                    if let EventPayload::Started(ref mut val) = self {
12497                        fidl::decode!(
12498                            StartedPayload,
12499                            fdomain_client::fidl::FDomainResourceDialect,
12500                            val,
12501                            decoder,
12502                            _inner_offset,
12503                            depth
12504                        )?;
12505                    } else {
12506                        unreachable!()
12507                    }
12508                }
12509                8 => {
12510                    #[allow(irrefutable_let_patterns)]
12511                    if let EventPayload::Stopped(_) = self {
12512                        // Do nothing, read the value into the object
12513                    } else {
12514                        // Initialize `self` to the right variant
12515                        *self = EventPayload::Stopped(fidl::new_empty!(
12516                            StoppedPayload,
12517                            fdomain_client::fidl::FDomainResourceDialect
12518                        ));
12519                    }
12520                    #[allow(irrefutable_let_patterns)]
12521                    if let EventPayload::Stopped(ref mut val) = self {
12522                        fidl::decode!(
12523                            StoppedPayload,
12524                            fdomain_client::fidl::FDomainResourceDialect,
12525                            val,
12526                            decoder,
12527                            _inner_offset,
12528                            depth
12529                        )?;
12530                    } else {
12531                        unreachable!()
12532                    }
12533                }
12534                9 => {
12535                    #[allow(irrefutable_let_patterns)]
12536                    if let EventPayload::DebugStarted(_) = self {
12537                        // Do nothing, read the value into the object
12538                    } else {
12539                        // Initialize `self` to the right variant
12540                        *self = EventPayload::DebugStarted(fidl::new_empty!(
12541                            DebugStartedPayload,
12542                            fdomain_client::fidl::FDomainResourceDialect
12543                        ));
12544                    }
12545                    #[allow(irrefutable_let_patterns)]
12546                    if let EventPayload::DebugStarted(ref mut val) = self {
12547                        fidl::decode!(
12548                            DebugStartedPayload,
12549                            fdomain_client::fidl::FDomainResourceDialect,
12550                            val,
12551                            decoder,
12552                            _inner_offset,
12553                            depth
12554                        )?;
12555                    } else {
12556                        unreachable!()
12557                    }
12558                }
12559                10 => {
12560                    #[allow(irrefutable_let_patterns)]
12561                    if let EventPayload::Unresolved(_) = self {
12562                        // Do nothing, read the value into the object
12563                    } else {
12564                        // Initialize `self` to the right variant
12565                        *self = EventPayload::Unresolved(fidl::new_empty!(
12566                            UnresolvedPayload,
12567                            fdomain_client::fidl::FDomainResourceDialect
12568                        ));
12569                    }
12570                    #[allow(irrefutable_let_patterns)]
12571                    if let EventPayload::Unresolved(ref mut val) = self {
12572                        fidl::decode!(
12573                            UnresolvedPayload,
12574                            fdomain_client::fidl::FDomainResourceDialect,
12575                            val,
12576                            decoder,
12577                            _inner_offset,
12578                            depth
12579                        )?;
12580                    } else {
12581                        unreachable!()
12582                    }
12583                }
12584                #[allow(deprecated)]
12585                ordinal => {
12586                    for _ in 0..num_handles {
12587                        decoder.drop_next_handle()?;
12588                    }
12589                    *self = EventPayload::__SourceBreaking { unknown_ordinal: ordinal };
12590                }
12591            }
12592            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
12593                return Err(fidl::Error::InvalidNumBytesInEnvelope);
12594            }
12595            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12596                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12597            }
12598            Ok(())
12599        }
12600    }
12601}