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, PartialEq)]
14pub struct ControllerStartRequest {
15    pub args: StartChildArgs,
16    pub execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
17}
18
19impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for ControllerStartRequest {}
20
21#[derive(Debug, PartialEq)]
22pub struct ControllerGetExposedDictionaryResponse {
23    pub dictionary: fdomain_fuchsia_component_sandbox::DictionaryRef,
24}
25
26impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
27    for ControllerGetExposedDictionaryResponse
28{
29}
30
31#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
32pub struct ControllerIsStartedResponse {
33    pub is_started: bool,
34}
35
36impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
37    for ControllerIsStartedResponse
38{
39}
40
41#[derive(Debug, PartialEq)]
42pub struct EventStreamGetNextResponse {
43    pub events: Vec<Event>,
44}
45
46impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for EventStreamGetNextResponse {}
47
48#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
49pub struct IntrospectorGetMonikerRequest {
50    pub component_instance: fdomain_client::Event,
51}
52
53impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
54    for IntrospectorGetMonikerRequest
55{
56}
57
58#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
59pub struct NamespaceCreateRequest {
60    pub entries: Vec<NamespaceInputEntry>,
61}
62
63impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreateRequest {}
64
65#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
66pub struct NamespaceInputEntry {
67    pub path: String,
68    pub dictionary:
69        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_component_sandbox::DictionaryMarker>,
70}
71
72impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceInputEntry {}
73
74#[derive(Debug, PartialEq)]
75pub struct NamespaceCreateResponse {
76    pub entries: Vec<NamespaceEntry>,
77}
78
79impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceCreateResponse {}
80
81#[derive(Debug, PartialEq)]
82pub struct RealmCreateChildRequest {
83    pub collection: fdomain_fuchsia_component_decl::CollectionRef,
84    pub decl: fdomain_fuchsia_component_decl::Child,
85    pub args: CreateChildArgs,
86}
87
88impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmCreateChildRequest {}
89
90#[derive(Debug, PartialEq)]
91pub struct RealmGetChildOutputDictionaryRequest {
92    pub child: fdomain_fuchsia_component_decl::ChildRef,
93}
94
95impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
96    for RealmGetChildOutputDictionaryRequest
97{
98}
99
100#[derive(Debug, PartialEq)]
101pub struct RealmListChildrenRequest {
102    pub collection: fdomain_fuchsia_component_decl::CollectionRef,
103    pub iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
104}
105
106impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmListChildrenRequest {}
107
108#[derive(Debug, PartialEq)]
109pub struct RealmOpenControllerRequest {
110    pub child: fdomain_fuchsia_component_decl::ChildRef,
111    pub controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
112}
113
114impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmOpenControllerRequest {}
115
116#[derive(Debug, PartialEq)]
117pub struct RealmOpenExposedDirRequest {
118    pub child: fdomain_fuchsia_component_decl::ChildRef,
119    pub exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
120}
121
122impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for RealmOpenExposedDirRequest {}
123
124#[derive(Debug, PartialEq)]
125pub struct RealmGetChildOutputDictionaryResponse {
126    pub dictionary: fdomain_fuchsia_component_sandbox::DictionaryRef,
127}
128
129impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
130    for RealmGetChildOutputDictionaryResponse
131{
132}
133
134#[derive(Debug, PartialEq)]
135pub struct RealmGetResolvedInfoResponse {
136    pub resolved_info: fdomain_fuchsia_component_resolution::Component,
137}
138
139impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
140    for RealmGetResolvedInfoResponse
141{
142}
143
144#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
145pub struct StorageAdminListStorageInRealmRequest {
146    pub relative_moniker: String,
147    pub iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
148}
149
150impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
151    for StorageAdminListStorageInRealmRequest
152{
153}
154
155#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
156pub struct StorageAdminOpenComponentStorageByIdRequest {
157    pub id: String,
158    pub object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
159}
160
161impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
162    for StorageAdminOpenComponentStorageByIdRequest
163{
164}
165
166#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
167pub struct StorageAdminOpenStorageRequest {
168    pub relative_moniker: String,
169    pub object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
170}
171
172impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect>
173    for StorageAdminOpenStorageRequest
174{
175}
176
177/// Payload for CapabilityRequested events
178#[derive(Debug, Default, PartialEq)]
179pub struct CapabilityRequestedPayload {
180    /// The name of the capability.
181    pub name: Option<String>,
182    /// A handle to the server end of the channel to host
183    /// capability.
184    pub capability: Option<fdomain_client::Channel>,
185    #[doc(hidden)]
186    pub __source_breaking: fidl::marker::SourceBreaking,
187}
188
189impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CapabilityRequestedPayload {}
190
191#[derive(Debug, Default, PartialEq)]
192pub struct CreateChildArgs {
193    /// The numbered handles to pass to the component instance.
194    ///
195    /// If the runner for the component does not support the numbered handles it is
196    /// expected to close the handles.
197    pub numbered_handles: Option<Vec<fdomain_fuchsia_process::HandleInfo>>,
198    /// Dynamic offers that will target the component instance.
199    ///
200    /// Including `OfferDecl`s in this vector will cause additional capabilities
201    /// to be offered to the newly created child, beyond the `OfferDecl`s in the
202    /// parent's `ComponentDecl` that target the collection.
203    ///
204    /// Any kind of offer (e.g., protocol, directory) can be used as a dynamic
205    /// offer. Any source that would be valid for a static offer is also valid
206    /// for a dynamic offer. Additionally, unlike static offers, dynamic offers
207    /// can use a "sibling" dynamic child component as a source by setting the
208    /// source to a `ChildRef` that sets the `collection` field.
209    ///
210    /// Dynamic offers always target the newly created child component. As a
211    /// result, `OfferDecl`s in `dynamic_offers` must not set the `target`
212    /// field, as its value is implied.
213    ///
214    /// If either the source (that is, the component named in the `source` field
215    /// of the `OfferDecl`) or the target of a dynamic offer is destroyed, the
216    /// offer itself is destroyed simultaneously.
217    ///
218    /// In order to set this field to a non-empty value, the collection in which
219    /// the child component is being created must specify
220    /// `ComponentDecl.allowed_offers = STATIC_AND_DYNAMIC`.
221    pub dynamic_offers: Option<Vec<fdomain_fuchsia_component_decl::Offer>>,
222    /// The controller for this component, which may be used to influence the
223    /// component's lifecycle.
224    pub controller: Option<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
225    /// A dictionary that contains extra capabilities for the component instance.
226    pub dictionary: Option<fdomain_fuchsia_component_sandbox::DictionaryRef>,
227    #[doc(hidden)]
228    pub __source_breaking: fidl::marker::SourceBreaking,
229}
230
231impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for CreateChildArgs {}
232
233/// Payload for DebugStarted events.
234#[derive(Debug, Default, PartialEq)]
235pub struct DebugStartedPayload {
236    /// The directory served by the runner to present runtime and runner-specific information
237    /// about the component. The other side is sent to the runner in ComponentStartInfo.
238    /// For example, it can be queried to know whether the component is an ELF component and
239    /// supports the break_on_start protocol below.
240    pub runtime_dir: Option<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>,
241    /// An eventpair that can be used by debuggers to defer the launch of the component,
242    /// e.g., ELF debuggers can setup the exception channel on the job while holding
243    /// the eventpair, then drop the eventpair to notify the runner that processes could
244    /// be created. The other side is sent to the runner in ComponentStartInfo.
245    pub break_on_start: Option<fdomain_client::EventPair>,
246    #[doc(hidden)]
247    pub __source_breaking: fidl::marker::SourceBreaking,
248}
249
250impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for DebugStartedPayload {}
251
252/// Contains all information about a single event
253#[derive(Debug, Default, PartialEq)]
254pub struct Event {
255    /// Information about the component for which this event was generated.
256    pub header: Option<EventHeader>,
257    /// Optional payload for some event types
258    pub payload: Option<EventPayload>,
259    #[doc(hidden)]
260    pub __source_breaking: fidl::marker::SourceBreaking,
261}
262
263impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for Event {}
264
265/// A single component namespace entry, which describes a namespace mount point
266/// (`path`) and the directory backing it (`directory`). This type is usually
267/// composed inside a vector.  See `ComponentStartInfo.ns` for more details.
268#[derive(Debug, Default, PartialEq)]
269pub struct NamespaceEntry {
270    /// The mount point for the directory, including a
271    /// leading slash. For example: "/pkg", "/svc", or "/config/data".
272    pub path: Option<String>,
273    /// The directory mounted at the above `path`.
274    pub directory: Option<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>>,
275    #[doc(hidden)]
276    pub __source_breaking: fidl::marker::SourceBreaking,
277}
278
279impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for NamespaceEntry {}
280
281#[derive(Debug, Default, PartialEq)]
282pub struct StartChildArgs {
283    /// The numbered handles to pass to the component instance.
284    ///
285    /// If the runner for the component does not support the numbered handles it
286    /// is expected to close the handles.
287    ///
288    /// If set, the values given here will override the handles given in
289    /// CreateChildArgs.
290    pub numbered_handles: Option<Vec<fdomain_fuchsia_process::HandleInfo>>,
291    /// The namespace generated by component manager will be extended to include
292    /// any namespace entries listed here before being given to the component's
293    /// runner.
294    ///
295    /// If there are any conflicting entries, an error will occur when starting
296    /// the component.
297    pub namespace_entries: Option<Vec<NamespaceEntry>>,
298    /// A dictionary that contains extra capabilities for the component instance.
299    pub dictionary: Option<fdomain_fuchsia_component_sandbox::DictionaryRef>,
300    #[doc(hidden)]
301    pub __source_breaking: fidl::marker::SourceBreaking,
302}
303
304impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for StartChildArgs {}
305
306/// Encapsulates additional data/protocols for some event types.
307#[derive(Debug)]
308pub enum EventPayload {
309    /// Payload for CapabilityRequested events
310    CapabilityRequested(CapabilityRequestedPayload),
311    /// Payload for Purged events.
312    Purged(PurgedPayload),
313    /// Payload for Discovered events.
314    Discovered(DiscoveredPayload),
315    /// Payload for Destroyed events.
316    Destroyed(DestroyedPayload),
317    /// Payload for Resolved events
318    Resolved(ResolvedPayload),
319    /// Payload for Started events
320    Started(StartedPayload),
321    /// Payload for Stopped events
322    Stopped(StoppedPayload),
323    /// Payload for DebugStarted events
324    DebugStarted(DebugStartedPayload),
325    /// Payload for Unresolved events
326    Unresolved(UnresolvedPayload),
327    #[doc(hidden)]
328    __SourceBreaking { unknown_ordinal: u64 },
329}
330
331/// Pattern that matches an unknown `EventPayload` member.
332#[macro_export]
333macro_rules! EventPayloadUnknown {
334    () => {
335        _
336    };
337}
338
339// Custom PartialEq so that unknown variants are not equal to themselves.
340impl PartialEq for EventPayload {
341    fn eq(&self, other: &Self) -> bool {
342        match (self, other) {
343            (Self::CapabilityRequested(x), Self::CapabilityRequested(y)) => *x == *y,
344            (Self::Purged(x), Self::Purged(y)) => *x == *y,
345            (Self::Discovered(x), Self::Discovered(y)) => *x == *y,
346            (Self::Destroyed(x), Self::Destroyed(y)) => *x == *y,
347            (Self::Resolved(x), Self::Resolved(y)) => *x == *y,
348            (Self::Started(x), Self::Started(y)) => *x == *y,
349            (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
350            (Self::DebugStarted(x), Self::DebugStarted(y)) => *x == *y,
351            (Self::Unresolved(x), Self::Unresolved(y)) => *x == *y,
352            _ => false,
353        }
354    }
355}
356
357impl EventPayload {
358    #[inline]
359    pub fn ordinal(&self) -> u64 {
360        match *self {
361            Self::CapabilityRequested(_) => 1,
362            Self::Purged(_) => 2,
363            Self::Discovered(_) => 4,
364            Self::Destroyed(_) => 5,
365            Self::Resolved(_) => 6,
366            Self::Started(_) => 7,
367            Self::Stopped(_) => 8,
368            Self::DebugStarted(_) => 9,
369            Self::Unresolved(_) => 10,
370            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
371        }
372    }
373
374    #[inline]
375    pub fn unknown_variant_for_testing() -> Self {
376        Self::__SourceBreaking { unknown_ordinal: 0 }
377    }
378
379    #[inline]
380    pub fn is_unknown(&self) -> bool {
381        match self {
382            Self::__SourceBreaking { .. } => true,
383            _ => false,
384        }
385    }
386}
387
388impl fidl::Standalone<fdomain_client::fidl::FDomainResourceDialect> for EventPayload {}
389
390#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
391pub struct BinderMarker;
392
393impl fdomain_client::fidl::ProtocolMarker for BinderMarker {
394    type Proxy = BinderProxy;
395    type RequestStream = BinderRequestStream;
396
397    const DEBUG_NAME: &'static str = "fuchsia.component.Binder";
398}
399impl fdomain_client::fidl::DiscoverableProtocolMarker for BinderMarker {}
400
401pub trait BinderProxyInterface: Send + Sync {}
402
403#[derive(Debug, Clone)]
404pub struct BinderProxy {
405    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
406}
407
408impl fdomain_client::fidl::Proxy for BinderProxy {
409    type Protocol = BinderMarker;
410
411    fn from_channel(inner: fdomain_client::Channel) -> Self {
412        Self::new(inner)
413    }
414
415    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
416        self.client.into_channel().map_err(|client| Self { client })
417    }
418
419    fn as_channel(&self) -> &fdomain_client::Channel {
420        self.client.as_channel()
421    }
422}
423
424impl BinderProxy {
425    /// Create a new Proxy for fuchsia.component/Binder.
426    pub fn new(channel: fdomain_client::Channel) -> Self {
427        let protocol_name = <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
428        Self { client: fidl::client::Client::new(channel, protocol_name) }
429    }
430
431    /// Get a Stream of events from the remote end of the protocol.
432    ///
433    /// # Panics
434    ///
435    /// Panics if the event stream was already taken.
436    pub fn take_event_stream(&self) -> BinderEventStream {
437        BinderEventStream { event_receiver: self.client.take_event_receiver() }
438    }
439}
440
441impl BinderProxyInterface for BinderProxy {}
442
443pub struct BinderEventStream {
444    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
445}
446
447impl std::marker::Unpin for BinderEventStream {}
448
449impl futures::stream::FusedStream for BinderEventStream {
450    fn is_terminated(&self) -> bool {
451        self.event_receiver.is_terminated()
452    }
453}
454
455impl futures::Stream for BinderEventStream {
456    type Item = Result<BinderEvent, fidl::Error>;
457
458    fn poll_next(
459        mut self: std::pin::Pin<&mut Self>,
460        cx: &mut std::task::Context<'_>,
461    ) -> std::task::Poll<Option<Self::Item>> {
462        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
463            &mut self.event_receiver,
464            cx
465        )?) {
466            Some(buf) => std::task::Poll::Ready(Some(BinderEvent::decode(buf))),
467            None => std::task::Poll::Ready(None),
468        }
469    }
470}
471
472#[derive(Debug)]
473pub enum BinderEvent {}
474
475impl BinderEvent {
476    /// Decodes a message buffer as a [`BinderEvent`].
477    fn decode(
478        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
479    ) -> Result<BinderEvent, fidl::Error> {
480        let (bytes, _handles) = buf.split_mut();
481        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
482        debug_assert_eq!(tx_header.tx_id, 0);
483        match tx_header.ordinal {
484            _ => Err(fidl::Error::UnknownOrdinal {
485                ordinal: tx_header.ordinal,
486                protocol_name: <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
487            }),
488        }
489    }
490}
491
492/// A Stream of incoming requests for fuchsia.component/Binder.
493pub struct BinderRequestStream {
494    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
495    is_terminated: bool,
496}
497
498impl std::marker::Unpin for BinderRequestStream {}
499
500impl futures::stream::FusedStream for BinderRequestStream {
501    fn is_terminated(&self) -> bool {
502        self.is_terminated
503    }
504}
505
506impl fdomain_client::fidl::RequestStream for BinderRequestStream {
507    type Protocol = BinderMarker;
508    type ControlHandle = BinderControlHandle;
509
510    fn from_channel(channel: fdomain_client::Channel) -> Self {
511        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
512    }
513
514    fn control_handle(&self) -> Self::ControlHandle {
515        BinderControlHandle { inner: self.inner.clone() }
516    }
517
518    fn into_inner(
519        self,
520    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
521    {
522        (self.inner, self.is_terminated)
523    }
524
525    fn from_inner(
526        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
527        is_terminated: bool,
528    ) -> Self {
529        Self { inner, is_terminated }
530    }
531}
532
533impl futures::Stream for BinderRequestStream {
534    type Item = Result<BinderRequest, fidl::Error>;
535
536    fn poll_next(
537        mut self: std::pin::Pin<&mut Self>,
538        cx: &mut std::task::Context<'_>,
539    ) -> std::task::Poll<Option<Self::Item>> {
540        let this = &mut *self;
541        if this.inner.check_shutdown(cx) {
542            this.is_terminated = true;
543            return std::task::Poll::Ready(None);
544        }
545        if this.is_terminated {
546            panic!("polled BinderRequestStream after completion");
547        }
548        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
549            |bytes, handles| {
550                match this.inner.channel().read_etc(cx, bytes, handles) {
551                    std::task::Poll::Ready(Ok(())) => {}
552                    std::task::Poll::Pending => return std::task::Poll::Pending,
553                    std::task::Poll::Ready(Err(None)) => {
554                        this.is_terminated = true;
555                        return std::task::Poll::Ready(None);
556                    }
557                    std::task::Poll::Ready(Err(Some(e))) => {
558                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
559                            e.into(),
560                        ))));
561                    }
562                }
563
564                // A message has been received from the channel
565                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
566
567                std::task::Poll::Ready(Some(match header.ordinal {
568                    _ => Err(fidl::Error::UnknownOrdinal {
569                        ordinal: header.ordinal,
570                        protocol_name:
571                            <BinderMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
572                    }),
573                }))
574            },
575        )
576    }
577}
578
579/// A framework-provided protocol that allows components that use it to bind to
580/// the component that exposes it. The act of connecting to this protocol will
581/// trigger the bind. Thus, this protocol contains no methods. For more details
582/// on binding, see
583/// https://fuchsia.dev/fuchsia-src/concepts/components/v2/lifecycle#binding.
584///
585/// When a component connects to protocol, the component exposing this capability
586/// will be started if it's not already running. Upon a failure to start, the
587/// component framework will close the server end of the channel with a
588/// zx.Status epitaph.
589#[derive(Debug)]
590pub enum BinderRequest {}
591
592impl BinderRequest {
593    /// Name of the method defined in FIDL
594    pub fn method_name(&self) -> &'static str {
595        match *self {}
596    }
597}
598
599#[derive(Debug, Clone)]
600pub struct BinderControlHandle {
601    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
602}
603
604impl fdomain_client::fidl::ControlHandle for BinderControlHandle {
605    fn shutdown(&self) {
606        self.inner.shutdown()
607    }
608
609    fn is_closed(&self) -> bool {
610        self.inner.channel().is_closed()
611    }
612    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
613        self.inner.channel().on_closed()
614    }
615}
616
617impl BinderControlHandle {}
618
619#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
620pub struct ChildIteratorMarker;
621
622impl fdomain_client::fidl::ProtocolMarker for ChildIteratorMarker {
623    type Proxy = ChildIteratorProxy;
624    type RequestStream = ChildIteratorRequestStream;
625
626    const DEBUG_NAME: &'static str = "(anonymous) ChildIterator";
627}
628
629pub trait ChildIteratorProxyInterface: Send + Sync {
630    type NextResponseFut: std::future::Future<
631            Output = Result<Vec<fdomain_fuchsia_component_decl::ChildRef>, fidl::Error>,
632        > + Send;
633    fn r#next(&self) -> Self::NextResponseFut;
634}
635
636#[derive(Debug, Clone)]
637pub struct ChildIteratorProxy {
638    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
639}
640
641impl fdomain_client::fidl::Proxy for ChildIteratorProxy {
642    type Protocol = ChildIteratorMarker;
643
644    fn from_channel(inner: fdomain_client::Channel) -> Self {
645        Self::new(inner)
646    }
647
648    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
649        self.client.into_channel().map_err(|client| Self { client })
650    }
651
652    fn as_channel(&self) -> &fdomain_client::Channel {
653        self.client.as_channel()
654    }
655}
656
657impl ChildIteratorProxy {
658    /// Create a new Proxy for fuchsia.component/ChildIterator.
659    pub fn new(channel: fdomain_client::Channel) -> Self {
660        let protocol_name =
661            <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
662        Self { client: fidl::client::Client::new(channel, protocol_name) }
663    }
664
665    /// Get a Stream of events from the remote end of the protocol.
666    ///
667    /// # Panics
668    ///
669    /// Panics if the event stream was already taken.
670    pub fn take_event_stream(&self) -> ChildIteratorEventStream {
671        ChildIteratorEventStream { event_receiver: self.client.take_event_receiver() }
672    }
673
674    /// Advance the iterator and return the next batch of children.
675    ///
676    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
677    /// no more children.
678    pub fn r#next(
679        &self,
680    ) -> fidl::client::QueryResponseFut<
681        Vec<fdomain_fuchsia_component_decl::ChildRef>,
682        fdomain_client::fidl::FDomainResourceDialect,
683    > {
684        ChildIteratorProxyInterface::r#next(self)
685    }
686}
687
688impl ChildIteratorProxyInterface for ChildIteratorProxy {
689    type NextResponseFut = fidl::client::QueryResponseFut<
690        Vec<fdomain_fuchsia_component_decl::ChildRef>,
691        fdomain_client::fidl::FDomainResourceDialect,
692    >;
693    fn r#next(&self) -> Self::NextResponseFut {
694        fn _decode(
695            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
696        ) -> Result<Vec<fdomain_fuchsia_component_decl::ChildRef>, fidl::Error> {
697            let _response = fidl::client::decode_transaction_body::<
698                ChildIteratorNextResponse,
699                fdomain_client::fidl::FDomainResourceDialect,
700                0x40e4c3882b050d08,
701            >(_buf?)?;
702            Ok(_response.children)
703        }
704        self.client.send_query_and_decode::<
705            fidl::encoding::EmptyPayload,
706            Vec<fdomain_fuchsia_component_decl::ChildRef>,
707        >(
708            (),
709            0x40e4c3882b050d08,
710            fidl::encoding::DynamicFlags::empty(),
711            _decode,
712        )
713    }
714}
715
716pub struct ChildIteratorEventStream {
717    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
718}
719
720impl std::marker::Unpin for ChildIteratorEventStream {}
721
722impl futures::stream::FusedStream for ChildIteratorEventStream {
723    fn is_terminated(&self) -> bool {
724        self.event_receiver.is_terminated()
725    }
726}
727
728impl futures::Stream for ChildIteratorEventStream {
729    type Item = Result<ChildIteratorEvent, fidl::Error>;
730
731    fn poll_next(
732        mut self: std::pin::Pin<&mut Self>,
733        cx: &mut std::task::Context<'_>,
734    ) -> std::task::Poll<Option<Self::Item>> {
735        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
736            &mut self.event_receiver,
737            cx
738        )?) {
739            Some(buf) => std::task::Poll::Ready(Some(ChildIteratorEvent::decode(buf))),
740            None => std::task::Poll::Ready(None),
741        }
742    }
743}
744
745#[derive(Debug)]
746pub enum ChildIteratorEvent {}
747
748impl ChildIteratorEvent {
749    /// Decodes a message buffer as a [`ChildIteratorEvent`].
750    fn decode(
751        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
752    ) -> Result<ChildIteratorEvent, fidl::Error> {
753        let (bytes, _handles) = buf.split_mut();
754        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
755        debug_assert_eq!(tx_header.tx_id, 0);
756        match tx_header.ordinal {
757            _ => Err(fidl::Error::UnknownOrdinal {
758                ordinal: tx_header.ordinal,
759                protocol_name:
760                    <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
761            }),
762        }
763    }
764}
765
766/// A Stream of incoming requests for fuchsia.component/ChildIterator.
767pub struct ChildIteratorRequestStream {
768    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
769    is_terminated: bool,
770}
771
772impl std::marker::Unpin for ChildIteratorRequestStream {}
773
774impl futures::stream::FusedStream for ChildIteratorRequestStream {
775    fn is_terminated(&self) -> bool {
776        self.is_terminated
777    }
778}
779
780impl fdomain_client::fidl::RequestStream for ChildIteratorRequestStream {
781    type Protocol = ChildIteratorMarker;
782    type ControlHandle = ChildIteratorControlHandle;
783
784    fn from_channel(channel: fdomain_client::Channel) -> Self {
785        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
786    }
787
788    fn control_handle(&self) -> Self::ControlHandle {
789        ChildIteratorControlHandle { inner: self.inner.clone() }
790    }
791
792    fn into_inner(
793        self,
794    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
795    {
796        (self.inner, self.is_terminated)
797    }
798
799    fn from_inner(
800        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
801        is_terminated: bool,
802    ) -> Self {
803        Self { inner, is_terminated }
804    }
805}
806
807impl futures::Stream for ChildIteratorRequestStream {
808    type Item = Result<ChildIteratorRequest, fidl::Error>;
809
810    fn poll_next(
811        mut self: std::pin::Pin<&mut Self>,
812        cx: &mut std::task::Context<'_>,
813    ) -> std::task::Poll<Option<Self::Item>> {
814        let this = &mut *self;
815        if this.inner.check_shutdown(cx) {
816            this.is_terminated = true;
817            return std::task::Poll::Ready(None);
818        }
819        if this.is_terminated {
820            panic!("polled ChildIteratorRequestStream after completion");
821        }
822        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
823            |bytes, handles| {
824                match this.inner.channel().read_etc(cx, bytes, handles) {
825                    std::task::Poll::Ready(Ok(())) => {}
826                    std::task::Poll::Pending => return std::task::Poll::Pending,
827                    std::task::Poll::Ready(Err(None)) => {
828                        this.is_terminated = true;
829                        return std::task::Poll::Ready(None);
830                    }
831                    std::task::Poll::Ready(Err(Some(e))) => {
832                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
833                            e.into(),
834                        ))));
835                    }
836                }
837
838                // A message has been received from the channel
839                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
840
841                std::task::Poll::Ready(Some(match header.ordinal {
842                0x40e4c3882b050d08 => {
843                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
844                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
845                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
846                    let control_handle = ChildIteratorControlHandle {
847                        inner: this.inner.clone(),
848                    };
849                    Ok(ChildIteratorRequest::Next {
850                        responder: ChildIteratorNextResponder {
851                            control_handle: std::mem::ManuallyDrop::new(control_handle),
852                            tx_id: header.tx_id,
853                        },
854                    })
855                }
856                _ => Err(fidl::Error::UnknownOrdinal {
857                    ordinal: header.ordinal,
858                    protocol_name: <ChildIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
859                }),
860            }))
861            },
862        )
863    }
864}
865
866/// A protocol to iterate over the list of children in a realm.
867#[derive(Debug)]
868pub enum ChildIteratorRequest {
869    /// Advance the iterator and return the next batch of children.
870    ///
871    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
872    /// no more children.
873    Next { responder: ChildIteratorNextResponder },
874}
875
876impl ChildIteratorRequest {
877    #[allow(irrefutable_let_patterns)]
878    pub fn into_next(self) -> Option<(ChildIteratorNextResponder)> {
879        if let ChildIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
880    }
881
882    /// Name of the method defined in FIDL
883    pub fn method_name(&self) -> &'static str {
884        match *self {
885            ChildIteratorRequest::Next { .. } => "next",
886        }
887    }
888}
889
890#[derive(Debug, Clone)]
891pub struct ChildIteratorControlHandle {
892    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
893}
894
895impl fdomain_client::fidl::ControlHandle for ChildIteratorControlHandle {
896    fn shutdown(&self) {
897        self.inner.shutdown()
898    }
899
900    fn is_closed(&self) -> bool {
901        self.inner.channel().is_closed()
902    }
903    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
904        self.inner.channel().on_closed()
905    }
906}
907
908impl ChildIteratorControlHandle {}
909
910#[must_use = "FIDL methods require a response to be sent"]
911#[derive(Debug)]
912pub struct ChildIteratorNextResponder {
913    control_handle: std::mem::ManuallyDrop<ChildIteratorControlHandle>,
914    tx_id: u32,
915}
916
917/// Set the the channel to be shutdown (see [`ChildIteratorControlHandle::shutdown`])
918/// if the responder is dropped without sending a response, so that the client
919/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
920impl std::ops::Drop for ChildIteratorNextResponder {
921    fn drop(&mut self) {
922        self.control_handle.shutdown();
923        // Safety: drops once, never accessed again
924        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
925    }
926}
927
928impl fdomain_client::fidl::Responder for ChildIteratorNextResponder {
929    type ControlHandle = ChildIteratorControlHandle;
930
931    fn control_handle(&self) -> &ChildIteratorControlHandle {
932        &self.control_handle
933    }
934
935    fn drop_without_shutdown(mut self) {
936        // Safety: drops once, never accessed again due to mem::forget
937        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
938        // Prevent Drop from running (which would shut down the channel)
939        std::mem::forget(self);
940    }
941}
942
943impl ChildIteratorNextResponder {
944    /// Sends a response to the FIDL transaction.
945    ///
946    /// Sets the channel to shutdown if an error occurs.
947    pub fn send(
948        self,
949        mut children: &[fdomain_fuchsia_component_decl::ChildRef],
950    ) -> Result<(), fidl::Error> {
951        let _result = self.send_raw(children);
952        if _result.is_err() {
953            self.control_handle.shutdown();
954        }
955        self.drop_without_shutdown();
956        _result
957    }
958
959    /// Similar to "send" but does not shutdown the channel if an error occurs.
960    pub fn send_no_shutdown_on_err(
961        self,
962        mut children: &[fdomain_fuchsia_component_decl::ChildRef],
963    ) -> Result<(), fidl::Error> {
964        let _result = self.send_raw(children);
965        self.drop_without_shutdown();
966        _result
967    }
968
969    fn send_raw(
970        &self,
971        mut children: &[fdomain_fuchsia_component_decl::ChildRef],
972    ) -> Result<(), fidl::Error> {
973        self.control_handle.inner.send::<ChildIteratorNextResponse>(
974            (children,),
975            self.tx_id,
976            0x40e4c3882b050d08,
977            fidl::encoding::DynamicFlags::empty(),
978        )
979    }
980}
981
982#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
983pub struct ControllerMarker;
984
985impl fdomain_client::fidl::ProtocolMarker for ControllerMarker {
986    type Proxy = ControllerProxy;
987    type RequestStream = ControllerRequestStream;
988
989    const DEBUG_NAME: &'static str = "(anonymous) Controller";
990}
991pub type ControllerStartResult = Result<(), Error>;
992pub type ControllerIsStartedResult = Result<bool, Error>;
993pub type ControllerGetExposedDictionaryResult =
994    Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>;
995pub type ControllerDestroyResult = Result<(), Error>;
996
997pub trait ControllerProxyInterface: Send + Sync {
998    type StartResponseFut: std::future::Future<Output = Result<ControllerStartResult, fidl::Error>>
999        + Send;
1000    fn r#start(
1001        &self,
1002        args: StartChildArgs,
1003        execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1004    ) -> Self::StartResponseFut;
1005    type IsStartedResponseFut: std::future::Future<Output = Result<ControllerIsStartedResult, fidl::Error>>
1006        + Send;
1007    fn r#is_started(&self) -> Self::IsStartedResponseFut;
1008    type GetExposedDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetExposedDictionaryResult, fidl::Error>>
1009        + Send;
1010    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut;
1011    type DestroyResponseFut: std::future::Future<Output = Result<ControllerDestroyResult, fidl::Error>>
1012        + Send;
1013    fn r#destroy(&self) -> Self::DestroyResponseFut;
1014}
1015
1016#[derive(Debug, Clone)]
1017pub struct ControllerProxy {
1018    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1019}
1020
1021impl fdomain_client::fidl::Proxy for ControllerProxy {
1022    type Protocol = ControllerMarker;
1023
1024    fn from_channel(inner: fdomain_client::Channel) -> Self {
1025        Self::new(inner)
1026    }
1027
1028    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1029        self.client.into_channel().map_err(|client| Self { client })
1030    }
1031
1032    fn as_channel(&self) -> &fdomain_client::Channel {
1033        self.client.as_channel()
1034    }
1035}
1036
1037impl ControllerProxy {
1038    /// Create a new Proxy for fuchsia.component/Controller.
1039    pub fn new(channel: fdomain_client::Channel) -> Self {
1040        let protocol_name = <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1041        Self { client: fidl::client::Client::new(channel, protocol_name) }
1042    }
1043
1044    /// Get a Stream of events from the remote end of the protocol.
1045    ///
1046    /// # Panics
1047    ///
1048    /// Panics if the event stream was already taken.
1049    pub fn take_event_stream(&self) -> ControllerEventStream {
1050        ControllerEventStream { event_receiver: self.client.take_event_receiver() }
1051    }
1052
1053    /// Start the component, optionally providing additional handles to be given
1054    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1055    /// currently running.
1056    pub fn r#start(
1057        &self,
1058        mut args: StartChildArgs,
1059        mut execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1060    ) -> fidl::client::QueryResponseFut<
1061        ControllerStartResult,
1062        fdomain_client::fidl::FDomainResourceDialect,
1063    > {
1064        ControllerProxyInterface::r#start(self, args, execution_controller)
1065    }
1066
1067    /// Returns true if this instance is currently running.
1068    pub fn r#is_started(
1069        &self,
1070    ) -> fidl::client::QueryResponseFut<
1071        ControllerIsStartedResult,
1072        fdomain_client::fidl::FDomainResourceDialect,
1073    > {
1074        ControllerProxyInterface::r#is_started(self)
1075    }
1076
1077    /// Returns the dictionary containing the component's exposed capabilities.
1078    pub fn r#get_exposed_dictionary(
1079        &self,
1080    ) -> fidl::client::QueryResponseFut<
1081        ControllerGetExposedDictionaryResult,
1082        fdomain_client::fidl::FDomainResourceDialect,
1083    > {
1084        ControllerProxyInterface::r#get_exposed_dictionary(self)
1085    }
1086
1087    /// Destroys this component. When this method returns, either:
1088    ///
1089    /// - Ok was returned, indicating destruction has begun.
1090    /// - An error was returned, and destruction will not be attempted.
1091    ///
1092    /// If Ok was returned, destruction will proceed in the background, but it
1093    /// hasn't necessarily completed yet. When it completes, the framework will
1094    /// close this [Controller] channel.
1095    ///
1096    /// Errors:
1097    ///
1098    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1099    /// Currently, this can happen if the component is a static child of its
1100    /// parent.
1101    pub fn r#destroy(
1102        &self,
1103    ) -> fidl::client::QueryResponseFut<
1104        ControllerDestroyResult,
1105        fdomain_client::fidl::FDomainResourceDialect,
1106    > {
1107        ControllerProxyInterface::r#destroy(self)
1108    }
1109}
1110
1111impl ControllerProxyInterface for ControllerProxy {
1112    type StartResponseFut = fidl::client::QueryResponseFut<
1113        ControllerStartResult,
1114        fdomain_client::fidl::FDomainResourceDialect,
1115    >;
1116    fn r#start(
1117        &self,
1118        mut args: StartChildArgs,
1119        mut execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1120    ) -> Self::StartResponseFut {
1121        fn _decode(
1122            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1123        ) -> Result<ControllerStartResult, fidl::Error> {
1124            let _response = fidl::client::decode_transaction_body::<
1125                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1126                fdomain_client::fidl::FDomainResourceDialect,
1127                0x68878076b8d2eac5,
1128            >(_buf?)?
1129            .into_result_fdomain::<ControllerMarker>("start")?;
1130            Ok(_response.map(|x| x))
1131        }
1132        self.client.send_query_and_decode::<ControllerStartRequest, ControllerStartResult>(
1133            (&mut args, execution_controller),
1134            0x68878076b8d2eac5,
1135            fidl::encoding::DynamicFlags::FLEXIBLE,
1136            _decode,
1137        )
1138    }
1139
1140    type IsStartedResponseFut = fidl::client::QueryResponseFut<
1141        ControllerIsStartedResult,
1142        fdomain_client::fidl::FDomainResourceDialect,
1143    >;
1144    fn r#is_started(&self) -> Self::IsStartedResponseFut {
1145        fn _decode(
1146            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1147        ) -> Result<ControllerIsStartedResult, fidl::Error> {
1148            let _response = fidl::client::decode_transaction_body::<
1149                fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1150                fdomain_client::fidl::FDomainResourceDialect,
1151                0x2155e6e1db2083c3,
1152            >(_buf?)?
1153            .into_result_fdomain::<ControllerMarker>("is_started")?;
1154            Ok(_response.map(|x| x.is_started))
1155        }
1156        self.client
1157            .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerIsStartedResult>(
1158                (),
1159                0x2155e6e1db2083c3,
1160                fidl::encoding::DynamicFlags::FLEXIBLE,
1161                _decode,
1162            )
1163    }
1164
1165    type GetExposedDictionaryResponseFut = fidl::client::QueryResponseFut<
1166        ControllerGetExposedDictionaryResult,
1167        fdomain_client::fidl::FDomainResourceDialect,
1168    >;
1169    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut {
1170        fn _decode(
1171            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1172        ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1173            let _response = fidl::client::decode_transaction_body::<
1174                fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1175                fdomain_client::fidl::FDomainResourceDialect,
1176                0x7e48373e5eda1f9b,
1177            >(_buf?)?
1178            .into_result_fdomain::<ControllerMarker>("get_exposed_dictionary")?;
1179            Ok(_response.map(|x| x.dictionary))
1180        }
1181        self.client.send_query_and_decode::<
1182            fidl::encoding::EmptyPayload,
1183            ControllerGetExposedDictionaryResult,
1184        >(
1185            (),
1186            0x7e48373e5eda1f9b,
1187            fidl::encoding::DynamicFlags::FLEXIBLE,
1188            _decode,
1189        )
1190    }
1191
1192    type DestroyResponseFut = fidl::client::QueryResponseFut<
1193        ControllerDestroyResult,
1194        fdomain_client::fidl::FDomainResourceDialect,
1195    >;
1196    fn r#destroy(&self) -> Self::DestroyResponseFut {
1197        fn _decode(
1198            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1199        ) -> Result<ControllerDestroyResult, fidl::Error> {
1200            let _response = fidl::client::decode_transaction_body::<
1201                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1202                fdomain_client::fidl::FDomainResourceDialect,
1203                0x74529fa68b5c1741,
1204            >(_buf?)?
1205            .into_result_fdomain::<ControllerMarker>("destroy")?;
1206            Ok(_response.map(|x| x))
1207        }
1208        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerDestroyResult>(
1209            (),
1210            0x74529fa68b5c1741,
1211            fidl::encoding::DynamicFlags::FLEXIBLE,
1212            _decode,
1213        )
1214    }
1215}
1216
1217pub struct ControllerEventStream {
1218    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1219}
1220
1221impl std::marker::Unpin for ControllerEventStream {}
1222
1223impl futures::stream::FusedStream for ControllerEventStream {
1224    fn is_terminated(&self) -> bool {
1225        self.event_receiver.is_terminated()
1226    }
1227}
1228
1229impl futures::Stream for ControllerEventStream {
1230    type Item = Result<ControllerEvent, fidl::Error>;
1231
1232    fn poll_next(
1233        mut self: std::pin::Pin<&mut Self>,
1234        cx: &mut std::task::Context<'_>,
1235    ) -> std::task::Poll<Option<Self::Item>> {
1236        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1237            &mut self.event_receiver,
1238            cx
1239        )?) {
1240            Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1241            None => std::task::Poll::Ready(None),
1242        }
1243    }
1244}
1245
1246#[derive(Debug)]
1247pub enum ControllerEvent {
1248    #[non_exhaustive]
1249    _UnknownEvent {
1250        /// Ordinal of the event that was sent.
1251        ordinal: u64,
1252    },
1253}
1254
1255impl ControllerEvent {
1256    /// Decodes a message buffer as a [`ControllerEvent`].
1257    fn decode(
1258        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1259    ) -> Result<ControllerEvent, fidl::Error> {
1260        let (bytes, _handles) = buf.split_mut();
1261        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1262        debug_assert_eq!(tx_header.tx_id, 0);
1263        match tx_header.ordinal {
1264            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1265                Ok(ControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1266            }
1267            _ => Err(fidl::Error::UnknownOrdinal {
1268                ordinal: tx_header.ordinal,
1269                protocol_name:
1270                    <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1271            }),
1272        }
1273    }
1274}
1275
1276/// A Stream of incoming requests for fuchsia.component/Controller.
1277pub struct ControllerRequestStream {
1278    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1279    is_terminated: bool,
1280}
1281
1282impl std::marker::Unpin for ControllerRequestStream {}
1283
1284impl futures::stream::FusedStream for ControllerRequestStream {
1285    fn is_terminated(&self) -> bool {
1286        self.is_terminated
1287    }
1288}
1289
1290impl fdomain_client::fidl::RequestStream for ControllerRequestStream {
1291    type Protocol = ControllerMarker;
1292    type ControlHandle = ControllerControlHandle;
1293
1294    fn from_channel(channel: fdomain_client::Channel) -> Self {
1295        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1296    }
1297
1298    fn control_handle(&self) -> Self::ControlHandle {
1299        ControllerControlHandle { inner: self.inner.clone() }
1300    }
1301
1302    fn into_inner(
1303        self,
1304    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
1305    {
1306        (self.inner, self.is_terminated)
1307    }
1308
1309    fn from_inner(
1310        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1311        is_terminated: bool,
1312    ) -> Self {
1313        Self { inner, is_terminated }
1314    }
1315}
1316
1317impl futures::Stream for ControllerRequestStream {
1318    type Item = Result<ControllerRequest, fidl::Error>;
1319
1320    fn poll_next(
1321        mut self: std::pin::Pin<&mut Self>,
1322        cx: &mut std::task::Context<'_>,
1323    ) -> std::task::Poll<Option<Self::Item>> {
1324        let this = &mut *self;
1325        if this.inner.check_shutdown(cx) {
1326            this.is_terminated = true;
1327            return std::task::Poll::Ready(None);
1328        }
1329        if this.is_terminated {
1330            panic!("polled ControllerRequestStream after completion");
1331        }
1332        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
1333            |bytes, handles| {
1334                match this.inner.channel().read_etc(cx, bytes, handles) {
1335                    std::task::Poll::Ready(Ok(())) => {}
1336                    std::task::Poll::Pending => return std::task::Poll::Pending,
1337                    std::task::Poll::Ready(Err(None)) => {
1338                        this.is_terminated = true;
1339                        return std::task::Poll::Ready(None);
1340                    }
1341                    std::task::Poll::Ready(Err(Some(e))) => {
1342                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1343                            e.into(),
1344                        ))));
1345                    }
1346                }
1347
1348                // A message has been received from the channel
1349                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1350
1351                std::task::Poll::Ready(Some(match header.ordinal {
1352                    0x68878076b8d2eac5 => {
1353                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1354                        let mut req = fidl::new_empty!(
1355                            ControllerStartRequest,
1356                            fdomain_client::fidl::FDomainResourceDialect
1357                        );
1358                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ControllerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1359                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1360                        Ok(ControllerRequest::Start {
1361                            args: req.args,
1362                            execution_controller: req.execution_controller,
1363
1364                            responder: ControllerStartResponder {
1365                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1366                                tx_id: header.tx_id,
1367                            },
1368                        })
1369                    }
1370                    0x2155e6e1db2083c3 => {
1371                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1372                        let mut req = fidl::new_empty!(
1373                            fidl::encoding::EmptyPayload,
1374                            fdomain_client::fidl::FDomainResourceDialect
1375                        );
1376                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1377                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1378                        Ok(ControllerRequest::IsStarted {
1379                            responder: ControllerIsStartedResponder {
1380                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1381                                tx_id: header.tx_id,
1382                            },
1383                        })
1384                    }
1385                    0x7e48373e5eda1f9b => {
1386                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1387                        let mut req = fidl::new_empty!(
1388                            fidl::encoding::EmptyPayload,
1389                            fdomain_client::fidl::FDomainResourceDialect
1390                        );
1391                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1392                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1393                        Ok(ControllerRequest::GetExposedDictionary {
1394                            responder: ControllerGetExposedDictionaryResponder {
1395                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1396                                tx_id: header.tx_id,
1397                            },
1398                        })
1399                    }
1400                    0x74529fa68b5c1741 => {
1401                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1402                        let mut req = fidl::new_empty!(
1403                            fidl::encoding::EmptyPayload,
1404                            fdomain_client::fidl::FDomainResourceDialect
1405                        );
1406                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1407                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1408                        Ok(ControllerRequest::Destroy {
1409                            responder: ControllerDestroyResponder {
1410                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1411                                tx_id: header.tx_id,
1412                            },
1413                        })
1414                    }
1415                    _ if header.tx_id == 0
1416                        && header
1417                            .dynamic_flags()
1418                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1419                    {
1420                        Ok(ControllerRequest::_UnknownMethod {
1421                            ordinal: header.ordinal,
1422                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
1423                            method_type: fidl::MethodType::OneWay,
1424                        })
1425                    }
1426                    _ if header
1427                        .dynamic_flags()
1428                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
1429                    {
1430                        this.inner.send_framework_err(
1431                            fidl::encoding::FrameworkErr::UnknownMethod,
1432                            header.tx_id,
1433                            header.ordinal,
1434                            header.dynamic_flags(),
1435                            (bytes, handles),
1436                        )?;
1437                        Ok(ControllerRequest::_UnknownMethod {
1438                            ordinal: header.ordinal,
1439                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
1440                            method_type: fidl::MethodType::TwoWay,
1441                        })
1442                    }
1443                    _ => Err(fidl::Error::UnknownOrdinal {
1444                        ordinal: header.ordinal,
1445                        protocol_name:
1446                            <ControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
1447                    }),
1448                }))
1449            },
1450        )
1451    }
1452}
1453
1454/// A protocol used to operate on a component.
1455///
1456/// One may get access to a `Controller` when creating a component with the
1457/// `Realm.CreateChild` method. You may also obtain a `Controller` for an
1458/// existing child component with the `Realm.OpenController` method.
1459#[derive(Debug)]
1460pub enum ControllerRequest {
1461    /// Start the component, optionally providing additional handles to be given
1462    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1463    /// currently running.
1464    Start {
1465        args: StartChildArgs,
1466        execution_controller: fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1467        responder: ControllerStartResponder,
1468    },
1469    /// Returns true if this instance is currently running.
1470    IsStarted { responder: ControllerIsStartedResponder },
1471    /// Returns the dictionary containing the component's exposed capabilities.
1472    GetExposedDictionary { responder: ControllerGetExposedDictionaryResponder },
1473    /// Destroys this component. When this method returns, either:
1474    ///
1475    /// - Ok was returned, indicating destruction has begun.
1476    /// - An error was returned, and destruction will not be attempted.
1477    ///
1478    /// If Ok was returned, destruction will proceed in the background, but it
1479    /// hasn't necessarily completed yet. When it completes, the framework will
1480    /// close this [Controller] channel.
1481    ///
1482    /// Errors:
1483    ///
1484    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1485    /// Currently, this can happen if the component is a static child of its
1486    /// parent.
1487    Destroy { responder: ControllerDestroyResponder },
1488    /// An interaction was received which does not match any known method.
1489    #[non_exhaustive]
1490    _UnknownMethod {
1491        /// Ordinal of the method that was called.
1492        ordinal: u64,
1493        control_handle: ControllerControlHandle,
1494        method_type: fidl::MethodType,
1495    },
1496}
1497
1498impl ControllerRequest {
1499    #[allow(irrefutable_let_patterns)]
1500    pub fn into_start(
1501        self,
1502    ) -> Option<(
1503        StartChildArgs,
1504        fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
1505        ControllerStartResponder,
1506    )> {
1507        if let ControllerRequest::Start { args, execution_controller, responder } = self {
1508            Some((args, execution_controller, responder))
1509        } else {
1510            None
1511        }
1512    }
1513
1514    #[allow(irrefutable_let_patterns)]
1515    pub fn into_is_started(self) -> Option<(ControllerIsStartedResponder)> {
1516        if let ControllerRequest::IsStarted { responder } = self { Some((responder)) } else { None }
1517    }
1518
1519    #[allow(irrefutable_let_patterns)]
1520    pub fn into_get_exposed_dictionary(self) -> Option<(ControllerGetExposedDictionaryResponder)> {
1521        if let ControllerRequest::GetExposedDictionary { responder } = self {
1522            Some((responder))
1523        } else {
1524            None
1525        }
1526    }
1527
1528    #[allow(irrefutable_let_patterns)]
1529    pub fn into_destroy(self) -> Option<(ControllerDestroyResponder)> {
1530        if let ControllerRequest::Destroy { responder } = self { Some((responder)) } else { None }
1531    }
1532
1533    /// Name of the method defined in FIDL
1534    pub fn method_name(&self) -> &'static str {
1535        match *self {
1536            ControllerRequest::Start { .. } => "start",
1537            ControllerRequest::IsStarted { .. } => "is_started",
1538            ControllerRequest::GetExposedDictionary { .. } => "get_exposed_dictionary",
1539            ControllerRequest::Destroy { .. } => "destroy",
1540            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
1541                "unknown one-way method"
1542            }
1543            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
1544                "unknown two-way method"
1545            }
1546        }
1547    }
1548}
1549
1550#[derive(Debug, Clone)]
1551pub struct ControllerControlHandle {
1552    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
1553}
1554
1555impl fdomain_client::fidl::ControlHandle for ControllerControlHandle {
1556    fn shutdown(&self) {
1557        self.inner.shutdown()
1558    }
1559
1560    fn is_closed(&self) -> bool {
1561        self.inner.channel().is_closed()
1562    }
1563    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
1564        self.inner.channel().on_closed()
1565    }
1566}
1567
1568impl ControllerControlHandle {}
1569
1570#[must_use = "FIDL methods require a response to be sent"]
1571#[derive(Debug)]
1572pub struct ControllerStartResponder {
1573    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1574    tx_id: u32,
1575}
1576
1577/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1578/// if the responder is dropped without sending a response, so that the client
1579/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1580impl std::ops::Drop for ControllerStartResponder {
1581    fn drop(&mut self) {
1582        self.control_handle.shutdown();
1583        // Safety: drops once, never accessed again
1584        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1585    }
1586}
1587
1588impl fdomain_client::fidl::Responder for ControllerStartResponder {
1589    type ControlHandle = ControllerControlHandle;
1590
1591    fn control_handle(&self) -> &ControllerControlHandle {
1592        &self.control_handle
1593    }
1594
1595    fn drop_without_shutdown(mut self) {
1596        // Safety: drops once, never accessed again due to mem::forget
1597        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1598        // Prevent Drop from running (which would shut down the channel)
1599        std::mem::forget(self);
1600    }
1601}
1602
1603impl ControllerStartResponder {
1604    /// Sends a response to the FIDL transaction.
1605    ///
1606    /// Sets the channel to shutdown if an error occurs.
1607    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1608        let _result = self.send_raw(result);
1609        if _result.is_err() {
1610            self.control_handle.shutdown();
1611        }
1612        self.drop_without_shutdown();
1613        _result
1614    }
1615
1616    /// Similar to "send" but does not shutdown the channel if an error occurs.
1617    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1618        let _result = self.send_raw(result);
1619        self.drop_without_shutdown();
1620        _result
1621    }
1622
1623    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1624        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1625            fidl::encoding::EmptyStruct,
1626            Error,
1627        >>(
1628            fidl::encoding::FlexibleResult::new(result),
1629            self.tx_id,
1630            0x68878076b8d2eac5,
1631            fidl::encoding::DynamicFlags::FLEXIBLE,
1632        )
1633    }
1634}
1635
1636#[must_use = "FIDL methods require a response to be sent"]
1637#[derive(Debug)]
1638pub struct ControllerIsStartedResponder {
1639    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1640    tx_id: u32,
1641}
1642
1643/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1644/// if the responder is dropped without sending a response, so that the client
1645/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1646impl std::ops::Drop for ControllerIsStartedResponder {
1647    fn drop(&mut self) {
1648        self.control_handle.shutdown();
1649        // Safety: drops once, never accessed again
1650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1651    }
1652}
1653
1654impl fdomain_client::fidl::Responder for ControllerIsStartedResponder {
1655    type ControlHandle = ControllerControlHandle;
1656
1657    fn control_handle(&self) -> &ControllerControlHandle {
1658        &self.control_handle
1659    }
1660
1661    fn drop_without_shutdown(mut self) {
1662        // Safety: drops once, never accessed again due to mem::forget
1663        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1664        // Prevent Drop from running (which would shut down the channel)
1665        std::mem::forget(self);
1666    }
1667}
1668
1669impl ControllerIsStartedResponder {
1670    /// Sends a response to the FIDL transaction.
1671    ///
1672    /// Sets the channel to shutdown if an error occurs.
1673    pub fn send(self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1674        let _result = self.send_raw(result);
1675        if _result.is_err() {
1676            self.control_handle.shutdown();
1677        }
1678        self.drop_without_shutdown();
1679        _result
1680    }
1681
1682    /// Similar to "send" but does not shutdown the channel if an error occurs.
1683    pub fn send_no_shutdown_on_err(
1684        self,
1685        mut result: Result<bool, Error>,
1686    ) -> Result<(), fidl::Error> {
1687        let _result = self.send_raw(result);
1688        self.drop_without_shutdown();
1689        _result
1690    }
1691
1692    fn send_raw(&self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
1693        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1694            ControllerIsStartedResponse,
1695            Error,
1696        >>(
1697            fidl::encoding::FlexibleResult::new(result.map(|is_started| (is_started,))),
1698            self.tx_id,
1699            0x2155e6e1db2083c3,
1700            fidl::encoding::DynamicFlags::FLEXIBLE,
1701        )
1702    }
1703}
1704
1705#[must_use = "FIDL methods require a response to be sent"]
1706#[derive(Debug)]
1707pub struct ControllerGetExposedDictionaryResponder {
1708    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1709    tx_id: u32,
1710}
1711
1712/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1713/// if the responder is dropped without sending a response, so that the client
1714/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1715impl std::ops::Drop for ControllerGetExposedDictionaryResponder {
1716    fn drop(&mut self) {
1717        self.control_handle.shutdown();
1718        // Safety: drops once, never accessed again
1719        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1720    }
1721}
1722
1723impl fdomain_client::fidl::Responder for ControllerGetExposedDictionaryResponder {
1724    type ControlHandle = ControllerControlHandle;
1725
1726    fn control_handle(&self) -> &ControllerControlHandle {
1727        &self.control_handle
1728    }
1729
1730    fn drop_without_shutdown(mut self) {
1731        // Safety: drops once, never accessed again due to mem::forget
1732        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1733        // Prevent Drop from running (which would shut down the channel)
1734        std::mem::forget(self);
1735    }
1736}
1737
1738impl ControllerGetExposedDictionaryResponder {
1739    /// Sends a response to the FIDL transaction.
1740    ///
1741    /// Sets the channel to shutdown if an error occurs.
1742    pub fn send(
1743        self,
1744        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
1745    ) -> Result<(), fidl::Error> {
1746        let _result = self.send_raw(result);
1747        if _result.is_err() {
1748            self.control_handle.shutdown();
1749        }
1750        self.drop_without_shutdown();
1751        _result
1752    }
1753
1754    /// Similar to "send" but does not shutdown the channel if an error occurs.
1755    pub fn send_no_shutdown_on_err(
1756        self,
1757        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
1758    ) -> Result<(), fidl::Error> {
1759        let _result = self.send_raw(result);
1760        self.drop_without_shutdown();
1761        _result
1762    }
1763
1764    fn send_raw(
1765        &self,
1766        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
1767    ) -> Result<(), fidl::Error> {
1768        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1769            ControllerGetExposedDictionaryResponse,
1770            Error,
1771        >>(
1772            fidl::encoding::FlexibleResult::new(
1773                result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
1774            ),
1775            self.tx_id,
1776            0x7e48373e5eda1f9b,
1777            fidl::encoding::DynamicFlags::FLEXIBLE,
1778        )
1779    }
1780}
1781
1782#[must_use = "FIDL methods require a response to be sent"]
1783#[derive(Debug)]
1784pub struct ControllerDestroyResponder {
1785    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1786    tx_id: u32,
1787}
1788
1789/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
1790/// if the responder is dropped without sending a response, so that the client
1791/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1792impl std::ops::Drop for ControllerDestroyResponder {
1793    fn drop(&mut self) {
1794        self.control_handle.shutdown();
1795        // Safety: drops once, never accessed again
1796        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1797    }
1798}
1799
1800impl fdomain_client::fidl::Responder for ControllerDestroyResponder {
1801    type ControlHandle = ControllerControlHandle;
1802
1803    fn control_handle(&self) -> &ControllerControlHandle {
1804        &self.control_handle
1805    }
1806
1807    fn drop_without_shutdown(mut self) {
1808        // Safety: drops once, never accessed again due to mem::forget
1809        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1810        // Prevent Drop from running (which would shut down the channel)
1811        std::mem::forget(self);
1812    }
1813}
1814
1815impl ControllerDestroyResponder {
1816    /// Sends a response to the FIDL transaction.
1817    ///
1818    /// Sets the channel to shutdown if an error occurs.
1819    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1820        let _result = self.send_raw(result);
1821        if _result.is_err() {
1822            self.control_handle.shutdown();
1823        }
1824        self.drop_without_shutdown();
1825        _result
1826    }
1827
1828    /// Similar to "send" but does not shutdown the channel if an error occurs.
1829    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1830        let _result = self.send_raw(result);
1831        self.drop_without_shutdown();
1832        _result
1833    }
1834
1835    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
1836        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
1837            fidl::encoding::EmptyStruct,
1838            Error,
1839        >>(
1840            fidl::encoding::FlexibleResult::new(result),
1841            self.tx_id,
1842            0x74529fa68b5c1741,
1843            fidl::encoding::DynamicFlags::FLEXIBLE,
1844        )
1845    }
1846}
1847
1848#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1849pub struct EventStreamMarker;
1850
1851impl fdomain_client::fidl::ProtocolMarker for EventStreamMarker {
1852    type Proxy = EventStreamProxy;
1853    type RequestStream = EventStreamRequestStream;
1854
1855    const DEBUG_NAME: &'static str = "fuchsia.component.EventStream";
1856}
1857impl fdomain_client::fidl::DiscoverableProtocolMarker for EventStreamMarker {}
1858
1859pub trait EventStreamProxyInterface: Send + Sync {
1860    type GetNextResponseFut: std::future::Future<Output = Result<Vec<Event>, fidl::Error>> + Send;
1861    fn r#get_next(&self) -> Self::GetNextResponseFut;
1862    type WaitForReadyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1863    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut;
1864}
1865
1866#[derive(Debug, Clone)]
1867pub struct EventStreamProxy {
1868    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
1869}
1870
1871impl fdomain_client::fidl::Proxy for EventStreamProxy {
1872    type Protocol = EventStreamMarker;
1873
1874    fn from_channel(inner: fdomain_client::Channel) -> Self {
1875        Self::new(inner)
1876    }
1877
1878    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
1879        self.client.into_channel().map_err(|client| Self { client })
1880    }
1881
1882    fn as_channel(&self) -> &fdomain_client::Channel {
1883        self.client.as_channel()
1884    }
1885}
1886
1887impl EventStreamProxy {
1888    /// Create a new Proxy for fuchsia.component/EventStream.
1889    pub fn new(channel: fdomain_client::Channel) -> Self {
1890        let protocol_name = <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
1891        Self { client: fidl::client::Client::new(channel, protocol_name) }
1892    }
1893
1894    /// Get a Stream of events from the remote end of the protocol.
1895    ///
1896    /// # Panics
1897    ///
1898    /// Panics if the event stream was already taken.
1899    pub fn take_event_stream(&self) -> EventStreamEventStream {
1900        EventStreamEventStream { event_receiver: self.client.take_event_receiver() }
1901    }
1902
1903    pub fn r#get_next(
1904        &self,
1905    ) -> fidl::client::QueryResponseFut<Vec<Event>, fdomain_client::fidl::FDomainResourceDialect>
1906    {
1907        EventStreamProxyInterface::r#get_next(self)
1908    }
1909
1910    /// Returns immediately. Used to indicate that the FIDL connection
1911    /// completed. This is needed for non-static streams to verify
1912    /// that subscribe has completed before components are started.
1913    pub fn r#wait_for_ready(
1914        &self,
1915    ) -> fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect> {
1916        EventStreamProxyInterface::r#wait_for_ready(self)
1917    }
1918}
1919
1920impl EventStreamProxyInterface for EventStreamProxy {
1921    type GetNextResponseFut =
1922        fidl::client::QueryResponseFut<Vec<Event>, fdomain_client::fidl::FDomainResourceDialect>;
1923    fn r#get_next(&self) -> Self::GetNextResponseFut {
1924        fn _decode(
1925            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1926        ) -> Result<Vec<Event>, fidl::Error> {
1927            let _response = fidl::client::decode_transaction_body::<
1928                EventStreamGetNextResponse,
1929                fdomain_client::fidl::FDomainResourceDialect,
1930                0x3f24c9495978eb86,
1931            >(_buf?)?;
1932            Ok(_response.events)
1933        }
1934        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Event>>(
1935            (),
1936            0x3f24c9495978eb86,
1937            fidl::encoding::DynamicFlags::empty(),
1938            _decode,
1939        )
1940    }
1941
1942    type WaitForReadyResponseFut =
1943        fidl::client::QueryResponseFut<(), fdomain_client::fidl::FDomainResourceDialect>;
1944    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut {
1945        fn _decode(
1946            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1947        ) -> Result<(), fidl::Error> {
1948            let _response = fidl::client::decode_transaction_body::<
1949                fidl::encoding::EmptyPayload,
1950                fdomain_client::fidl::FDomainResourceDialect,
1951                0x31331f9578d2e682,
1952            >(_buf?)?;
1953            Ok(_response)
1954        }
1955        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
1956            (),
1957            0x31331f9578d2e682,
1958            fidl::encoding::DynamicFlags::empty(),
1959            _decode,
1960        )
1961    }
1962}
1963
1964pub struct EventStreamEventStream {
1965    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
1966}
1967
1968impl std::marker::Unpin for EventStreamEventStream {}
1969
1970impl futures::stream::FusedStream for EventStreamEventStream {
1971    fn is_terminated(&self) -> bool {
1972        self.event_receiver.is_terminated()
1973    }
1974}
1975
1976impl futures::Stream for EventStreamEventStream {
1977    type Item = Result<EventStreamEvent, fidl::Error>;
1978
1979    fn poll_next(
1980        mut self: std::pin::Pin<&mut Self>,
1981        cx: &mut std::task::Context<'_>,
1982    ) -> std::task::Poll<Option<Self::Item>> {
1983        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1984            &mut self.event_receiver,
1985            cx
1986        )?) {
1987            Some(buf) => std::task::Poll::Ready(Some(EventStreamEvent::decode(buf))),
1988            None => std::task::Poll::Ready(None),
1989        }
1990    }
1991}
1992
1993#[derive(Debug)]
1994pub enum EventStreamEvent {}
1995
1996impl EventStreamEvent {
1997    /// Decodes a message buffer as a [`EventStreamEvent`].
1998    fn decode(
1999        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2000    ) -> Result<EventStreamEvent, fidl::Error> {
2001        let (bytes, _handles) = buf.split_mut();
2002        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2003        debug_assert_eq!(tx_header.tx_id, 0);
2004        match tx_header.ordinal {
2005            _ => Err(fidl::Error::UnknownOrdinal {
2006                ordinal: tx_header.ordinal,
2007                protocol_name:
2008                    <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2009            }),
2010        }
2011    }
2012}
2013
2014/// A Stream of incoming requests for fuchsia.component/EventStream.
2015pub struct EventStreamRequestStream {
2016    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2017    is_terminated: bool,
2018}
2019
2020impl std::marker::Unpin for EventStreamRequestStream {}
2021
2022impl futures::stream::FusedStream for EventStreamRequestStream {
2023    fn is_terminated(&self) -> bool {
2024        self.is_terminated
2025    }
2026}
2027
2028impl fdomain_client::fidl::RequestStream for EventStreamRequestStream {
2029    type Protocol = EventStreamMarker;
2030    type ControlHandle = EventStreamControlHandle;
2031
2032    fn from_channel(channel: fdomain_client::Channel) -> Self {
2033        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2034    }
2035
2036    fn control_handle(&self) -> Self::ControlHandle {
2037        EventStreamControlHandle { inner: self.inner.clone() }
2038    }
2039
2040    fn into_inner(
2041        self,
2042    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2043    {
2044        (self.inner, self.is_terminated)
2045    }
2046
2047    fn from_inner(
2048        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2049        is_terminated: bool,
2050    ) -> Self {
2051        Self { inner, is_terminated }
2052    }
2053}
2054
2055impl futures::Stream for EventStreamRequestStream {
2056    type Item = Result<EventStreamRequest, fidl::Error>;
2057
2058    fn poll_next(
2059        mut self: std::pin::Pin<&mut Self>,
2060        cx: &mut std::task::Context<'_>,
2061    ) -> std::task::Poll<Option<Self::Item>> {
2062        let this = &mut *self;
2063        if this.inner.check_shutdown(cx) {
2064            this.is_terminated = true;
2065            return std::task::Poll::Ready(None);
2066        }
2067        if this.is_terminated {
2068            panic!("polled EventStreamRequestStream after completion");
2069        }
2070        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2071            |bytes, handles| {
2072                match this.inner.channel().read_etc(cx, bytes, handles) {
2073                    std::task::Poll::Ready(Ok(())) => {}
2074                    std::task::Poll::Pending => return std::task::Poll::Pending,
2075                    std::task::Poll::Ready(Err(None)) => {
2076                        this.is_terminated = true;
2077                        return std::task::Poll::Ready(None);
2078                    }
2079                    std::task::Poll::Ready(Err(Some(e))) => {
2080                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2081                            e.into(),
2082                        ))));
2083                    }
2084                }
2085
2086                // A message has been received from the channel
2087                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2088
2089                std::task::Poll::Ready(Some(match header.ordinal {
2090                    0x3f24c9495978eb86 => {
2091                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2092                        let mut req = fidl::new_empty!(
2093                            fidl::encoding::EmptyPayload,
2094                            fdomain_client::fidl::FDomainResourceDialect
2095                        );
2096                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2097                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2098                        Ok(EventStreamRequest::GetNext {
2099                            responder: EventStreamGetNextResponder {
2100                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2101                                tx_id: header.tx_id,
2102                            },
2103                        })
2104                    }
2105                    0x31331f9578d2e682 => {
2106                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2107                        let mut req = fidl::new_empty!(
2108                            fidl::encoding::EmptyPayload,
2109                            fdomain_client::fidl::FDomainResourceDialect
2110                        );
2111                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2112                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2113                        Ok(EventStreamRequest::WaitForReady {
2114                            responder: EventStreamWaitForReadyResponder {
2115                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2116                                tx_id: header.tx_id,
2117                            },
2118                        })
2119                    }
2120                    _ => Err(fidl::Error::UnknownOrdinal {
2121                        ordinal: header.ordinal,
2122                        protocol_name:
2123                            <EventStreamMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2124                    }),
2125                }))
2126            },
2127        )
2128    }
2129}
2130
2131/// Listener for events on the component hierarchy.
2132/// Can't be used outside of the platform.
2133#[derive(Debug)]
2134pub enum EventStreamRequest {
2135    GetNext {
2136        responder: EventStreamGetNextResponder,
2137    },
2138    /// Returns immediately. Used to indicate that the FIDL connection
2139    /// completed. This is needed for non-static streams to verify
2140    /// that subscribe has completed before components are started.
2141    WaitForReady {
2142        responder: EventStreamWaitForReadyResponder,
2143    },
2144}
2145
2146impl EventStreamRequest {
2147    #[allow(irrefutable_let_patterns)]
2148    pub fn into_get_next(self) -> Option<(EventStreamGetNextResponder)> {
2149        if let EventStreamRequest::GetNext { responder } = self { Some((responder)) } else { None }
2150    }
2151
2152    #[allow(irrefutable_let_patterns)]
2153    pub fn into_wait_for_ready(self) -> Option<(EventStreamWaitForReadyResponder)> {
2154        if let EventStreamRequest::WaitForReady { responder } = self {
2155            Some((responder))
2156        } else {
2157            None
2158        }
2159    }
2160
2161    /// Name of the method defined in FIDL
2162    pub fn method_name(&self) -> &'static str {
2163        match *self {
2164            EventStreamRequest::GetNext { .. } => "get_next",
2165            EventStreamRequest::WaitForReady { .. } => "wait_for_ready",
2166        }
2167    }
2168}
2169
2170#[derive(Debug, Clone)]
2171pub struct EventStreamControlHandle {
2172    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2173}
2174
2175impl fdomain_client::fidl::ControlHandle for EventStreamControlHandle {
2176    fn shutdown(&self) {
2177        self.inner.shutdown()
2178    }
2179
2180    fn is_closed(&self) -> bool {
2181        self.inner.channel().is_closed()
2182    }
2183    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2184        self.inner.channel().on_closed()
2185    }
2186}
2187
2188impl EventStreamControlHandle {}
2189
2190#[must_use = "FIDL methods require a response to be sent"]
2191#[derive(Debug)]
2192pub struct EventStreamGetNextResponder {
2193    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2194    tx_id: u32,
2195}
2196
2197/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
2198/// if the responder is dropped without sending a response, so that the client
2199/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2200impl std::ops::Drop for EventStreamGetNextResponder {
2201    fn drop(&mut self) {
2202        self.control_handle.shutdown();
2203        // Safety: drops once, never accessed again
2204        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2205    }
2206}
2207
2208impl fdomain_client::fidl::Responder for EventStreamGetNextResponder {
2209    type ControlHandle = EventStreamControlHandle;
2210
2211    fn control_handle(&self) -> &EventStreamControlHandle {
2212        &self.control_handle
2213    }
2214
2215    fn drop_without_shutdown(mut self) {
2216        // Safety: drops once, never accessed again due to mem::forget
2217        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2218        // Prevent Drop from running (which would shut down the channel)
2219        std::mem::forget(self);
2220    }
2221}
2222
2223impl EventStreamGetNextResponder {
2224    /// Sends a response to the FIDL transaction.
2225    ///
2226    /// Sets the channel to shutdown if an error occurs.
2227    pub fn send(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2228        let _result = self.send_raw(events);
2229        if _result.is_err() {
2230            self.control_handle.shutdown();
2231        }
2232        self.drop_without_shutdown();
2233        _result
2234    }
2235
2236    /// Similar to "send" but does not shutdown the channel if an error occurs.
2237    pub fn send_no_shutdown_on_err(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2238        let _result = self.send_raw(events);
2239        self.drop_without_shutdown();
2240        _result
2241    }
2242
2243    fn send_raw(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
2244        self.control_handle.inner.send::<EventStreamGetNextResponse>(
2245            (events.as_mut(),),
2246            self.tx_id,
2247            0x3f24c9495978eb86,
2248            fidl::encoding::DynamicFlags::empty(),
2249        )
2250    }
2251}
2252
2253#[must_use = "FIDL methods require a response to be sent"]
2254#[derive(Debug)]
2255pub struct EventStreamWaitForReadyResponder {
2256    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
2257    tx_id: u32,
2258}
2259
2260/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
2261/// if the responder is dropped without sending a response, so that the client
2262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2263impl std::ops::Drop for EventStreamWaitForReadyResponder {
2264    fn drop(&mut self) {
2265        self.control_handle.shutdown();
2266        // Safety: drops once, never accessed again
2267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2268    }
2269}
2270
2271impl fdomain_client::fidl::Responder for EventStreamWaitForReadyResponder {
2272    type ControlHandle = EventStreamControlHandle;
2273
2274    fn control_handle(&self) -> &EventStreamControlHandle {
2275        &self.control_handle
2276    }
2277
2278    fn drop_without_shutdown(mut self) {
2279        // Safety: drops once, never accessed again due to mem::forget
2280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2281        // Prevent Drop from running (which would shut down the channel)
2282        std::mem::forget(self);
2283    }
2284}
2285
2286impl EventStreamWaitForReadyResponder {
2287    /// Sends a response to the FIDL transaction.
2288    ///
2289    /// Sets the channel to shutdown if an error occurs.
2290    pub fn send(self) -> Result<(), fidl::Error> {
2291        let _result = self.send_raw();
2292        if _result.is_err() {
2293            self.control_handle.shutdown();
2294        }
2295        self.drop_without_shutdown();
2296        _result
2297    }
2298
2299    /// Similar to "send" but does not shutdown the channel if an error occurs.
2300    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
2301        let _result = self.send_raw();
2302        self.drop_without_shutdown();
2303        _result
2304    }
2305
2306    fn send_raw(&self) -> Result<(), fidl::Error> {
2307        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2308            (),
2309            self.tx_id,
2310            0x31331f9578d2e682,
2311            fidl::encoding::DynamicFlags::empty(),
2312        )
2313    }
2314}
2315
2316#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2317pub struct ExecutionControllerMarker;
2318
2319impl fdomain_client::fidl::ProtocolMarker for ExecutionControllerMarker {
2320    type Proxy = ExecutionControllerProxy;
2321    type RequestStream = ExecutionControllerRequestStream;
2322
2323    const DEBUG_NAME: &'static str = "(anonymous) ExecutionController";
2324}
2325
2326pub trait ExecutionControllerProxyInterface: Send + Sync {
2327    fn r#stop(&self) -> Result<(), fidl::Error>;
2328}
2329
2330#[derive(Debug, Clone)]
2331pub struct ExecutionControllerProxy {
2332    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2333}
2334
2335impl fdomain_client::fidl::Proxy for ExecutionControllerProxy {
2336    type Protocol = ExecutionControllerMarker;
2337
2338    fn from_channel(inner: fdomain_client::Channel) -> Self {
2339        Self::new(inner)
2340    }
2341
2342    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2343        self.client.into_channel().map_err(|client| Self { client })
2344    }
2345
2346    fn as_channel(&self) -> &fdomain_client::Channel {
2347        self.client.as_channel()
2348    }
2349}
2350
2351impl ExecutionControllerProxy {
2352    /// Create a new Proxy for fuchsia.component/ExecutionController.
2353    pub fn new(channel: fdomain_client::Channel) -> Self {
2354        let protocol_name =
2355            <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2356        Self { client: fidl::client::Client::new(channel, protocol_name) }
2357    }
2358
2359    /// Get a Stream of events from the remote end of the protocol.
2360    ///
2361    /// # Panics
2362    ///
2363    /// Panics if the event stream was already taken.
2364    pub fn take_event_stream(&self) -> ExecutionControllerEventStream {
2365        ExecutionControllerEventStream { event_receiver: self.client.take_event_receiver() }
2366    }
2367
2368    /// Initiates a stop action on this component. Once complete, OnStop will be
2369    /// called with the stopped payload and this channel is closed.
2370    ///
2371    /// Note that a component may stop running on its own at any time, so it is
2372    /// possible for `OnStop` to be received before `Stop` is called.
2373    pub fn r#stop(&self) -> Result<(), fidl::Error> {
2374        ExecutionControllerProxyInterface::r#stop(self)
2375    }
2376}
2377
2378impl ExecutionControllerProxyInterface for ExecutionControllerProxy {
2379    fn r#stop(&self) -> Result<(), fidl::Error> {
2380        self.client.send::<fidl::encoding::EmptyPayload>(
2381            (),
2382            0x56d23cec21036117,
2383            fidl::encoding::DynamicFlags::FLEXIBLE,
2384        )
2385    }
2386}
2387
2388pub struct ExecutionControllerEventStream {
2389    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2390}
2391
2392impl std::marker::Unpin for ExecutionControllerEventStream {}
2393
2394impl futures::stream::FusedStream for ExecutionControllerEventStream {
2395    fn is_terminated(&self) -> bool {
2396        self.event_receiver.is_terminated()
2397    }
2398}
2399
2400impl futures::Stream for ExecutionControllerEventStream {
2401    type Item = Result<ExecutionControllerEvent, fidl::Error>;
2402
2403    fn poll_next(
2404        mut self: std::pin::Pin<&mut Self>,
2405        cx: &mut std::task::Context<'_>,
2406    ) -> std::task::Poll<Option<Self::Item>> {
2407        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2408            &mut self.event_receiver,
2409            cx
2410        )?) {
2411            Some(buf) => std::task::Poll::Ready(Some(ExecutionControllerEvent::decode(buf))),
2412            None => std::task::Poll::Ready(None),
2413        }
2414    }
2415}
2416
2417#[derive(Debug)]
2418pub enum ExecutionControllerEvent {
2419    OnStop {
2420        stopped_payload: StoppedPayload,
2421    },
2422    #[non_exhaustive]
2423    _UnknownEvent {
2424        /// Ordinal of the event that was sent.
2425        ordinal: u64,
2426    },
2427}
2428
2429impl ExecutionControllerEvent {
2430    #[allow(irrefutable_let_patterns)]
2431    pub fn into_on_stop(self) -> Option<StoppedPayload> {
2432        if let ExecutionControllerEvent::OnStop { stopped_payload } = self {
2433            Some((stopped_payload))
2434        } else {
2435            None
2436        }
2437    }
2438
2439    /// Decodes a message buffer as a [`ExecutionControllerEvent`].
2440    fn decode(
2441        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2442    ) -> Result<ExecutionControllerEvent, fidl::Error> {
2443        let (bytes, _handles) = buf.split_mut();
2444        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2445        debug_assert_eq!(tx_header.tx_id, 0);
2446        match tx_header.ordinal {
2447            0x62d5018e2174f57f => {
2448                let mut out = fidl::new_empty!(
2449                    ExecutionControllerOnStopRequest,
2450                    fdomain_client::fidl::FDomainResourceDialect
2451                );
2452                fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<ExecutionControllerOnStopRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
2453                Ok((ExecutionControllerEvent::OnStop { stopped_payload: out.stopped_payload }))
2454            }
2455            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2456                Ok(ExecutionControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2457            }
2458            _ => Err(fidl::Error::UnknownOrdinal {
2459                ordinal: tx_header.ordinal,
2460                protocol_name:
2461                    <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2462            }),
2463        }
2464    }
2465}
2466
2467/// A Stream of incoming requests for fuchsia.component/ExecutionController.
2468pub struct ExecutionControllerRequestStream {
2469    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2470    is_terminated: bool,
2471}
2472
2473impl std::marker::Unpin for ExecutionControllerRequestStream {}
2474
2475impl futures::stream::FusedStream for ExecutionControllerRequestStream {
2476    fn is_terminated(&self) -> bool {
2477        self.is_terminated
2478    }
2479}
2480
2481impl fdomain_client::fidl::RequestStream for ExecutionControllerRequestStream {
2482    type Protocol = ExecutionControllerMarker;
2483    type ControlHandle = ExecutionControllerControlHandle;
2484
2485    fn from_channel(channel: fdomain_client::Channel) -> Self {
2486        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2487    }
2488
2489    fn control_handle(&self) -> Self::ControlHandle {
2490        ExecutionControllerControlHandle { inner: self.inner.clone() }
2491    }
2492
2493    fn into_inner(
2494        self,
2495    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2496    {
2497        (self.inner, self.is_terminated)
2498    }
2499
2500    fn from_inner(
2501        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2502        is_terminated: bool,
2503    ) -> Self {
2504        Self { inner, is_terminated }
2505    }
2506}
2507
2508impl futures::Stream for ExecutionControllerRequestStream {
2509    type Item = Result<ExecutionControllerRequest, fidl::Error>;
2510
2511    fn poll_next(
2512        mut self: std::pin::Pin<&mut Self>,
2513        cx: &mut std::task::Context<'_>,
2514    ) -> std::task::Poll<Option<Self::Item>> {
2515        let this = &mut *self;
2516        if this.inner.check_shutdown(cx) {
2517            this.is_terminated = true;
2518            return std::task::Poll::Ready(None);
2519        }
2520        if this.is_terminated {
2521            panic!("polled ExecutionControllerRequestStream after completion");
2522        }
2523        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2524            |bytes, handles| {
2525                match this.inner.channel().read_etc(cx, bytes, handles) {
2526                    std::task::Poll::Ready(Ok(())) => {}
2527                    std::task::Poll::Pending => return std::task::Poll::Pending,
2528                    std::task::Poll::Ready(Err(None)) => {
2529                        this.is_terminated = true;
2530                        return std::task::Poll::Ready(None);
2531                    }
2532                    std::task::Poll::Ready(Err(Some(e))) => {
2533                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2534                            e.into(),
2535                        ))));
2536                    }
2537                }
2538
2539                // A message has been received from the channel
2540                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2541
2542                std::task::Poll::Ready(Some(match header.ordinal {
2543                0x56d23cec21036117 => {
2544                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2545                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
2546                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2547                    let control_handle = ExecutionControllerControlHandle {
2548                        inner: this.inner.clone(),
2549                    };
2550                    Ok(ExecutionControllerRequest::Stop {
2551                        control_handle,
2552                    })
2553                }
2554                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2555                    Ok(ExecutionControllerRequest::_UnknownMethod {
2556                        ordinal: header.ordinal,
2557                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
2558                        method_type: fidl::MethodType::OneWay,
2559                    })
2560                }
2561                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2562                    this.inner.send_framework_err(
2563                        fidl::encoding::FrameworkErr::UnknownMethod,
2564                        header.tx_id,
2565                        header.ordinal,
2566                        header.dynamic_flags(),
2567                        (bytes, handles),
2568                    )?;
2569                    Ok(ExecutionControllerRequest::_UnknownMethod {
2570                        ordinal: header.ordinal,
2571                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
2572                        method_type: fidl::MethodType::TwoWay,
2573                    })
2574                }
2575                _ => Err(fidl::Error::UnknownOrdinal {
2576                    ordinal: header.ordinal,
2577                    protocol_name: <ExecutionControllerMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2578                }),
2579            }))
2580            },
2581        )
2582    }
2583}
2584
2585#[derive(Debug)]
2586pub enum ExecutionControllerRequest {
2587    /// Initiates a stop action on this component. Once complete, OnStop will be
2588    /// called with the stopped payload and this channel is closed.
2589    ///
2590    /// Note that a component may stop running on its own at any time, so it is
2591    /// possible for `OnStop` to be received before `Stop` is called.
2592    Stop { control_handle: ExecutionControllerControlHandle },
2593    /// An interaction was received which does not match any known method.
2594    #[non_exhaustive]
2595    _UnknownMethod {
2596        /// Ordinal of the method that was called.
2597        ordinal: u64,
2598        control_handle: ExecutionControllerControlHandle,
2599        method_type: fidl::MethodType,
2600    },
2601}
2602
2603impl ExecutionControllerRequest {
2604    #[allow(irrefutable_let_patterns)]
2605    pub fn into_stop(self) -> Option<(ExecutionControllerControlHandle)> {
2606        if let ExecutionControllerRequest::Stop { control_handle } = self {
2607            Some((control_handle))
2608        } else {
2609            None
2610        }
2611    }
2612
2613    /// Name of the method defined in FIDL
2614    pub fn method_name(&self) -> &'static str {
2615        match *self {
2616            ExecutionControllerRequest::Stop { .. } => "stop",
2617            ExecutionControllerRequest::_UnknownMethod {
2618                method_type: fidl::MethodType::OneWay,
2619                ..
2620            } => "unknown one-way method",
2621            ExecutionControllerRequest::_UnknownMethod {
2622                method_type: fidl::MethodType::TwoWay,
2623                ..
2624            } => "unknown two-way method",
2625        }
2626    }
2627}
2628
2629#[derive(Debug, Clone)]
2630pub struct ExecutionControllerControlHandle {
2631    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2632}
2633
2634impl fdomain_client::fidl::ControlHandle for ExecutionControllerControlHandle {
2635    fn shutdown(&self) {
2636        self.inner.shutdown()
2637    }
2638
2639    fn is_closed(&self) -> bool {
2640        self.inner.channel().is_closed()
2641    }
2642    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
2643        self.inner.channel().on_closed()
2644    }
2645}
2646
2647impl ExecutionControllerControlHandle {
2648    pub fn send_on_stop(&self, mut stopped_payload: &StoppedPayload) -> Result<(), fidl::Error> {
2649        self.inner.send::<ExecutionControllerOnStopRequest>(
2650            (stopped_payload,),
2651            0,
2652            0x62d5018e2174f57f,
2653            fidl::encoding::DynamicFlags::FLEXIBLE,
2654        )
2655    }
2656}
2657
2658#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2659pub struct IntrospectorMarker;
2660
2661impl fdomain_client::fidl::ProtocolMarker for IntrospectorMarker {
2662    type Proxy = IntrospectorProxy;
2663    type RequestStream = IntrospectorRequestStream;
2664
2665    const DEBUG_NAME: &'static str = "fuchsia.component.Introspector";
2666}
2667impl fdomain_client::fidl::DiscoverableProtocolMarker for IntrospectorMarker {}
2668pub type IntrospectorGetMonikerResult = Result<String, Error>;
2669
2670pub trait IntrospectorProxyInterface: Send + Sync {
2671    type GetMonikerResponseFut: std::future::Future<Output = Result<IntrospectorGetMonikerResult, fidl::Error>>
2672        + Send;
2673    fn r#get_moniker(
2674        &self,
2675        component_instance: fdomain_client::Event,
2676    ) -> Self::GetMonikerResponseFut;
2677}
2678
2679#[derive(Debug, Clone)]
2680pub struct IntrospectorProxy {
2681    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
2682}
2683
2684impl fdomain_client::fidl::Proxy for IntrospectorProxy {
2685    type Protocol = IntrospectorMarker;
2686
2687    fn from_channel(inner: fdomain_client::Channel) -> Self {
2688        Self::new(inner)
2689    }
2690
2691    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
2692        self.client.into_channel().map_err(|client| Self { client })
2693    }
2694
2695    fn as_channel(&self) -> &fdomain_client::Channel {
2696        self.client.as_channel()
2697    }
2698}
2699
2700impl IntrospectorProxy {
2701    /// Create a new Proxy for fuchsia.component/Introspector.
2702    pub fn new(channel: fdomain_client::Channel) -> Self {
2703        let protocol_name =
2704            <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
2705        Self { client: fidl::client::Client::new(channel, protocol_name) }
2706    }
2707
2708    /// Get a Stream of events from the remote end of the protocol.
2709    ///
2710    /// # Panics
2711    ///
2712    /// Panics if the event stream was already taken.
2713    pub fn take_event_stream(&self) -> IntrospectorEventStream {
2714        IntrospectorEventStream { event_receiver: self.client.take_event_receiver() }
2715    }
2716
2717    /// Obtains the moniker relative to this realm of the component
2718    /// corresponding to the provided token. Runners may obtain the token via
2719    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
2720    ///
2721    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
2722    /// does not correspond to a component under this realm.
2723    pub fn r#get_moniker(
2724        &self,
2725        mut component_instance: fdomain_client::Event,
2726    ) -> fidl::client::QueryResponseFut<
2727        IntrospectorGetMonikerResult,
2728        fdomain_client::fidl::FDomainResourceDialect,
2729    > {
2730        IntrospectorProxyInterface::r#get_moniker(self, component_instance)
2731    }
2732}
2733
2734impl IntrospectorProxyInterface for IntrospectorProxy {
2735    type GetMonikerResponseFut = fidl::client::QueryResponseFut<
2736        IntrospectorGetMonikerResult,
2737        fdomain_client::fidl::FDomainResourceDialect,
2738    >;
2739    fn r#get_moniker(
2740        &self,
2741        mut component_instance: fdomain_client::Event,
2742    ) -> Self::GetMonikerResponseFut {
2743        fn _decode(
2744            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2745        ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
2746            let _response = fidl::client::decode_transaction_body::<
2747                fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
2748                fdomain_client::fidl::FDomainResourceDialect,
2749                0x2f980ceb37bf458,
2750            >(_buf?)?
2751            .into_result_fdomain::<IntrospectorMarker>("get_moniker")?;
2752            Ok(_response.map(|x| x.moniker))
2753        }
2754        self.client
2755            .send_query_and_decode::<IntrospectorGetMonikerRequest, IntrospectorGetMonikerResult>(
2756                (component_instance,),
2757                0x2f980ceb37bf458,
2758                fidl::encoding::DynamicFlags::FLEXIBLE,
2759                _decode,
2760            )
2761    }
2762}
2763
2764pub struct IntrospectorEventStream {
2765    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
2766}
2767
2768impl std::marker::Unpin for IntrospectorEventStream {}
2769
2770impl futures::stream::FusedStream for IntrospectorEventStream {
2771    fn is_terminated(&self) -> bool {
2772        self.event_receiver.is_terminated()
2773    }
2774}
2775
2776impl futures::Stream for IntrospectorEventStream {
2777    type Item = Result<IntrospectorEvent, fidl::Error>;
2778
2779    fn poll_next(
2780        mut self: std::pin::Pin<&mut Self>,
2781        cx: &mut std::task::Context<'_>,
2782    ) -> std::task::Poll<Option<Self::Item>> {
2783        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2784            &mut self.event_receiver,
2785            cx
2786        )?) {
2787            Some(buf) => std::task::Poll::Ready(Some(IntrospectorEvent::decode(buf))),
2788            None => std::task::Poll::Ready(None),
2789        }
2790    }
2791}
2792
2793#[derive(Debug)]
2794pub enum IntrospectorEvent {
2795    #[non_exhaustive]
2796    _UnknownEvent {
2797        /// Ordinal of the event that was sent.
2798        ordinal: u64,
2799    },
2800}
2801
2802impl IntrospectorEvent {
2803    /// Decodes a message buffer as a [`IntrospectorEvent`].
2804    fn decode(
2805        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2806    ) -> Result<IntrospectorEvent, fidl::Error> {
2807        let (bytes, _handles) = buf.split_mut();
2808        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2809        debug_assert_eq!(tx_header.tx_id, 0);
2810        match tx_header.ordinal {
2811            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
2812                Ok(IntrospectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
2813            }
2814            _ => Err(fidl::Error::UnknownOrdinal {
2815                ordinal: tx_header.ordinal,
2816                protocol_name:
2817                    <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2818            }),
2819        }
2820    }
2821}
2822
2823/// A Stream of incoming requests for fuchsia.component/Introspector.
2824pub struct IntrospectorRequestStream {
2825    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2826    is_terminated: bool,
2827}
2828
2829impl std::marker::Unpin for IntrospectorRequestStream {}
2830
2831impl futures::stream::FusedStream for IntrospectorRequestStream {
2832    fn is_terminated(&self) -> bool {
2833        self.is_terminated
2834    }
2835}
2836
2837impl fdomain_client::fidl::RequestStream for IntrospectorRequestStream {
2838    type Protocol = IntrospectorMarker;
2839    type ControlHandle = IntrospectorControlHandle;
2840
2841    fn from_channel(channel: fdomain_client::Channel) -> Self {
2842        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2843    }
2844
2845    fn control_handle(&self) -> Self::ControlHandle {
2846        IntrospectorControlHandle { inner: self.inner.clone() }
2847    }
2848
2849    fn into_inner(
2850        self,
2851    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
2852    {
2853        (self.inner, self.is_terminated)
2854    }
2855
2856    fn from_inner(
2857        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
2858        is_terminated: bool,
2859    ) -> Self {
2860        Self { inner, is_terminated }
2861    }
2862}
2863
2864impl futures::Stream for IntrospectorRequestStream {
2865    type Item = Result<IntrospectorRequest, fidl::Error>;
2866
2867    fn poll_next(
2868        mut self: std::pin::Pin<&mut Self>,
2869        cx: &mut std::task::Context<'_>,
2870    ) -> std::task::Poll<Option<Self::Item>> {
2871        let this = &mut *self;
2872        if this.inner.check_shutdown(cx) {
2873            this.is_terminated = true;
2874            return std::task::Poll::Ready(None);
2875        }
2876        if this.is_terminated {
2877            panic!("polled IntrospectorRequestStream after completion");
2878        }
2879        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
2880            |bytes, handles| {
2881                match this.inner.channel().read_etc(cx, bytes, handles) {
2882                    std::task::Poll::Ready(Ok(())) => {}
2883                    std::task::Poll::Pending => return std::task::Poll::Pending,
2884                    std::task::Poll::Ready(Err(None)) => {
2885                        this.is_terminated = true;
2886                        return std::task::Poll::Ready(None);
2887                    }
2888                    std::task::Poll::Ready(Err(Some(e))) => {
2889                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2890                            e.into(),
2891                        ))));
2892                    }
2893                }
2894
2895                // A message has been received from the channel
2896                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2897
2898                std::task::Poll::Ready(Some(match header.ordinal {
2899                    0x2f980ceb37bf458 => {
2900                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2901                        let mut req = fidl::new_empty!(
2902                            IntrospectorGetMonikerRequest,
2903                            fdomain_client::fidl::FDomainResourceDialect
2904                        );
2905                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<IntrospectorGetMonikerRequest>(&header, _body_bytes, handles, &mut req)?;
2906                        let control_handle =
2907                            IntrospectorControlHandle { inner: this.inner.clone() };
2908                        Ok(IntrospectorRequest::GetMoniker {
2909                            component_instance: req.component_instance,
2910
2911                            responder: IntrospectorGetMonikerResponder {
2912                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2913                                tx_id: header.tx_id,
2914                            },
2915                        })
2916                    }
2917                    _ if header.tx_id == 0
2918                        && header
2919                            .dynamic_flags()
2920                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2921                    {
2922                        Ok(IntrospectorRequest::_UnknownMethod {
2923                            ordinal: header.ordinal,
2924                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
2925                            method_type: fidl::MethodType::OneWay,
2926                        })
2927                    }
2928                    _ if header
2929                        .dynamic_flags()
2930                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2931                    {
2932                        this.inner.send_framework_err(
2933                            fidl::encoding::FrameworkErr::UnknownMethod,
2934                            header.tx_id,
2935                            header.ordinal,
2936                            header.dynamic_flags(),
2937                            (bytes, handles),
2938                        )?;
2939                        Ok(IntrospectorRequest::_UnknownMethod {
2940                            ordinal: header.ordinal,
2941                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
2942                            method_type: fidl::MethodType::TwoWay,
2943                        })
2944                    }
2945                    _ => Err(fidl::Error::UnknownOrdinal {
2946                        ordinal: header.ordinal,
2947                        protocol_name:
2948                            <IntrospectorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
2949                    }),
2950                }))
2951            },
2952        )
2953    }
2954}
2955
2956/// A protocol used by a component instance to obtain information about
2957/// components in its own realm.
2958///
2959/// This protocol only supports getting the moniker at the moment but could
2960/// expand to other privileged information such as the URL of a component.
2961///
2962/// The component framework provides this capability to components that use
2963/// `fuchsia.component.Introspector` from framework.
2964#[derive(Debug)]
2965pub enum IntrospectorRequest {
2966    /// Obtains the moniker relative to this realm of the component
2967    /// corresponding to the provided token. Runners may obtain the token via
2968    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
2969    ///
2970    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
2971    /// does not correspond to a component under this realm.
2972    GetMoniker {
2973        component_instance: fdomain_client::Event,
2974        responder: IntrospectorGetMonikerResponder,
2975    },
2976    /// An interaction was received which does not match any known method.
2977    #[non_exhaustive]
2978    _UnknownMethod {
2979        /// Ordinal of the method that was called.
2980        ordinal: u64,
2981        control_handle: IntrospectorControlHandle,
2982        method_type: fidl::MethodType,
2983    },
2984}
2985
2986impl IntrospectorRequest {
2987    #[allow(irrefutable_let_patterns)]
2988    pub fn into_get_moniker(
2989        self,
2990    ) -> Option<(fdomain_client::Event, IntrospectorGetMonikerResponder)> {
2991        if let IntrospectorRequest::GetMoniker { component_instance, responder } = self {
2992            Some((component_instance, responder))
2993        } else {
2994            None
2995        }
2996    }
2997
2998    /// Name of the method defined in FIDL
2999    pub fn method_name(&self) -> &'static str {
3000        match *self {
3001            IntrospectorRequest::GetMoniker { .. } => "get_moniker",
3002            IntrospectorRequest::_UnknownMethod {
3003                method_type: fidl::MethodType::OneWay, ..
3004            } => "unknown one-way method",
3005            IntrospectorRequest::_UnknownMethod {
3006                method_type: fidl::MethodType::TwoWay, ..
3007            } => "unknown two-way method",
3008        }
3009    }
3010}
3011
3012#[derive(Debug, Clone)]
3013pub struct IntrospectorControlHandle {
3014    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3015}
3016
3017impl fdomain_client::fidl::ControlHandle for IntrospectorControlHandle {
3018    fn shutdown(&self) {
3019        self.inner.shutdown()
3020    }
3021
3022    fn is_closed(&self) -> bool {
3023        self.inner.channel().is_closed()
3024    }
3025    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
3026        self.inner.channel().on_closed()
3027    }
3028}
3029
3030impl IntrospectorControlHandle {}
3031
3032#[must_use = "FIDL methods require a response to be sent"]
3033#[derive(Debug)]
3034pub struct IntrospectorGetMonikerResponder {
3035    control_handle: std::mem::ManuallyDrop<IntrospectorControlHandle>,
3036    tx_id: u32,
3037}
3038
3039/// Set the the channel to be shutdown (see [`IntrospectorControlHandle::shutdown`])
3040/// if the responder is dropped without sending a response, so that the client
3041/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3042impl std::ops::Drop for IntrospectorGetMonikerResponder {
3043    fn drop(&mut self) {
3044        self.control_handle.shutdown();
3045        // Safety: drops once, never accessed again
3046        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3047    }
3048}
3049
3050impl fdomain_client::fidl::Responder for IntrospectorGetMonikerResponder {
3051    type ControlHandle = IntrospectorControlHandle;
3052
3053    fn control_handle(&self) -> &IntrospectorControlHandle {
3054        &self.control_handle
3055    }
3056
3057    fn drop_without_shutdown(mut self) {
3058        // Safety: drops once, never accessed again due to mem::forget
3059        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3060        // Prevent Drop from running (which would shut down the channel)
3061        std::mem::forget(self);
3062    }
3063}
3064
3065impl IntrospectorGetMonikerResponder {
3066    /// Sends a response to the FIDL transaction.
3067    ///
3068    /// Sets the channel to shutdown if an error occurs.
3069    pub fn send(self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3070        let _result = self.send_raw(result);
3071        if _result.is_err() {
3072            self.control_handle.shutdown();
3073        }
3074        self.drop_without_shutdown();
3075        _result
3076    }
3077
3078    /// Similar to "send" but does not shutdown the channel if an error occurs.
3079    pub fn send_no_shutdown_on_err(
3080        self,
3081        mut result: Result<&str, Error>,
3082    ) -> Result<(), fidl::Error> {
3083        let _result = self.send_raw(result);
3084        self.drop_without_shutdown();
3085        _result
3086    }
3087
3088    fn send_raw(&self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
3089        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3090            IntrospectorGetMonikerResponse,
3091            Error,
3092        >>(
3093            fidl::encoding::FlexibleResult::new(result.map(|moniker| (moniker,))),
3094            self.tx_id,
3095            0x2f980ceb37bf458,
3096            fidl::encoding::DynamicFlags::FLEXIBLE,
3097        )
3098    }
3099}
3100
3101#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3102pub struct NamespaceMarker;
3103
3104impl fdomain_client::fidl::ProtocolMarker for NamespaceMarker {
3105    type Proxy = NamespaceProxy;
3106    type RequestStream = NamespaceRequestStream;
3107
3108    const DEBUG_NAME: &'static str = "fuchsia.component.Namespace";
3109}
3110impl fdomain_client::fidl::DiscoverableProtocolMarker for NamespaceMarker {}
3111pub type NamespaceCreateResult = Result<Vec<NamespaceEntry>, NamespaceError>;
3112
3113pub trait NamespaceProxyInterface: Send + Sync {
3114    type CreateResponseFut: std::future::Future<Output = Result<NamespaceCreateResult, fidl::Error>>
3115        + Send;
3116    fn r#create(&self, entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut;
3117}
3118
3119#[derive(Debug, Clone)]
3120pub struct NamespaceProxy {
3121    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3122}
3123
3124impl fdomain_client::fidl::Proxy for NamespaceProxy {
3125    type Protocol = NamespaceMarker;
3126
3127    fn from_channel(inner: fdomain_client::Channel) -> Self {
3128        Self::new(inner)
3129    }
3130
3131    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3132        self.client.into_channel().map_err(|client| Self { client })
3133    }
3134
3135    fn as_channel(&self) -> &fdomain_client::Channel {
3136        self.client.as_channel()
3137    }
3138}
3139
3140impl NamespaceProxy {
3141    /// Create a new Proxy for fuchsia.component/Namespace.
3142    pub fn new(channel: fdomain_client::Channel) -> Self {
3143        let protocol_name = <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3144        Self { client: fidl::client::Client::new(channel, protocol_name) }
3145    }
3146
3147    /// Get a Stream of events from the remote end of the protocol.
3148    ///
3149    /// # Panics
3150    ///
3151    /// Panics if the event stream was already taken.
3152    pub fn take_event_stream(&self) -> NamespaceEventStream {
3153        NamespaceEventStream { event_receiver: self.client.take_event_receiver() }
3154    }
3155
3156    pub fn r#create(
3157        &self,
3158        mut entries: Vec<NamespaceInputEntry>,
3159    ) -> fidl::client::QueryResponseFut<
3160        NamespaceCreateResult,
3161        fdomain_client::fidl::FDomainResourceDialect,
3162    > {
3163        NamespaceProxyInterface::r#create(self, entries)
3164    }
3165}
3166
3167impl NamespaceProxyInterface for NamespaceProxy {
3168    type CreateResponseFut = fidl::client::QueryResponseFut<
3169        NamespaceCreateResult,
3170        fdomain_client::fidl::FDomainResourceDialect,
3171    >;
3172    fn r#create(&self, mut entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut {
3173        fn _decode(
3174            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3175        ) -> Result<NamespaceCreateResult, fidl::Error> {
3176            let _response = fidl::client::decode_transaction_body::<
3177                fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
3178                fdomain_client::fidl::FDomainResourceDialect,
3179                0x4329fe12b2a790f9,
3180            >(_buf?)?
3181            .into_result_fdomain::<NamespaceMarker>("create")?;
3182            Ok(_response.map(|x| x.entries))
3183        }
3184        self.client.send_query_and_decode::<NamespaceCreateRequest, NamespaceCreateResult>(
3185            (entries.as_mut(),),
3186            0x4329fe12b2a790f9,
3187            fidl::encoding::DynamicFlags::FLEXIBLE,
3188            _decode,
3189        )
3190    }
3191}
3192
3193pub struct NamespaceEventStream {
3194    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3195}
3196
3197impl std::marker::Unpin for NamespaceEventStream {}
3198
3199impl futures::stream::FusedStream for NamespaceEventStream {
3200    fn is_terminated(&self) -> bool {
3201        self.event_receiver.is_terminated()
3202    }
3203}
3204
3205impl futures::Stream for NamespaceEventStream {
3206    type Item = Result<NamespaceEvent, fidl::Error>;
3207
3208    fn poll_next(
3209        mut self: std::pin::Pin<&mut Self>,
3210        cx: &mut std::task::Context<'_>,
3211    ) -> std::task::Poll<Option<Self::Item>> {
3212        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3213            &mut self.event_receiver,
3214            cx
3215        )?) {
3216            Some(buf) => std::task::Poll::Ready(Some(NamespaceEvent::decode(buf))),
3217            None => std::task::Poll::Ready(None),
3218        }
3219    }
3220}
3221
3222#[derive(Debug)]
3223pub enum NamespaceEvent {
3224    #[non_exhaustive]
3225    _UnknownEvent {
3226        /// Ordinal of the event that was sent.
3227        ordinal: u64,
3228    },
3229}
3230
3231impl NamespaceEvent {
3232    /// Decodes a message buffer as a [`NamespaceEvent`].
3233    fn decode(
3234        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3235    ) -> Result<NamespaceEvent, fidl::Error> {
3236        let (bytes, _handles) = buf.split_mut();
3237        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3238        debug_assert_eq!(tx_header.tx_id, 0);
3239        match tx_header.ordinal {
3240            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3241                Ok(NamespaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3242            }
3243            _ => Err(fidl::Error::UnknownOrdinal {
3244                ordinal: tx_header.ordinal,
3245                protocol_name:
3246                    <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3247            }),
3248        }
3249    }
3250}
3251
3252/// A Stream of incoming requests for fuchsia.component/Namespace.
3253pub struct NamespaceRequestStream {
3254    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3255    is_terminated: bool,
3256}
3257
3258impl std::marker::Unpin for NamespaceRequestStream {}
3259
3260impl futures::stream::FusedStream for NamespaceRequestStream {
3261    fn is_terminated(&self) -> bool {
3262        self.is_terminated
3263    }
3264}
3265
3266impl fdomain_client::fidl::RequestStream for NamespaceRequestStream {
3267    type Protocol = NamespaceMarker;
3268    type ControlHandle = NamespaceControlHandle;
3269
3270    fn from_channel(channel: fdomain_client::Channel) -> Self {
3271        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3272    }
3273
3274    fn control_handle(&self) -> Self::ControlHandle {
3275        NamespaceControlHandle { inner: self.inner.clone() }
3276    }
3277
3278    fn into_inner(
3279        self,
3280    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
3281    {
3282        (self.inner, self.is_terminated)
3283    }
3284
3285    fn from_inner(
3286        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3287        is_terminated: bool,
3288    ) -> Self {
3289        Self { inner, is_terminated }
3290    }
3291}
3292
3293impl futures::Stream for NamespaceRequestStream {
3294    type Item = Result<NamespaceRequest, fidl::Error>;
3295
3296    fn poll_next(
3297        mut self: std::pin::Pin<&mut Self>,
3298        cx: &mut std::task::Context<'_>,
3299    ) -> std::task::Poll<Option<Self::Item>> {
3300        let this = &mut *self;
3301        if this.inner.check_shutdown(cx) {
3302            this.is_terminated = true;
3303            return std::task::Poll::Ready(None);
3304        }
3305        if this.is_terminated {
3306            panic!("polled NamespaceRequestStream after completion");
3307        }
3308        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
3309            |bytes, handles| {
3310                match this.inner.channel().read_etc(cx, bytes, handles) {
3311                    std::task::Poll::Ready(Ok(())) => {}
3312                    std::task::Poll::Pending => return std::task::Poll::Pending,
3313                    std::task::Poll::Ready(Err(None)) => {
3314                        this.is_terminated = true;
3315                        return std::task::Poll::Ready(None);
3316                    }
3317                    std::task::Poll::Ready(Err(Some(e))) => {
3318                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3319                            e.into(),
3320                        ))));
3321                    }
3322                }
3323
3324                // A message has been received from the channel
3325                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3326
3327                std::task::Poll::Ready(Some(match header.ordinal {
3328                    0x4329fe12b2a790f9 => {
3329                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3330                        let mut req = fidl::new_empty!(
3331                            NamespaceCreateRequest,
3332                            fdomain_client::fidl::FDomainResourceDialect
3333                        );
3334                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<NamespaceCreateRequest>(&header, _body_bytes, handles, &mut req)?;
3335                        let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
3336                        Ok(NamespaceRequest::Create {
3337                            entries: req.entries,
3338
3339                            responder: NamespaceCreateResponder {
3340                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3341                                tx_id: header.tx_id,
3342                            },
3343                        })
3344                    }
3345                    _ if header.tx_id == 0
3346                        && header
3347                            .dynamic_flags()
3348                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3349                    {
3350                        Ok(NamespaceRequest::_UnknownMethod {
3351                            ordinal: header.ordinal,
3352                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
3353                            method_type: fidl::MethodType::OneWay,
3354                        })
3355                    }
3356                    _ if header
3357                        .dynamic_flags()
3358                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3359                    {
3360                        this.inner.send_framework_err(
3361                            fidl::encoding::FrameworkErr::UnknownMethod,
3362                            header.tx_id,
3363                            header.ordinal,
3364                            header.dynamic_flags(),
3365                            (bytes, handles),
3366                        )?;
3367                        Ok(NamespaceRequest::_UnknownMethod {
3368                            ordinal: header.ordinal,
3369                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
3370                            method_type: fidl::MethodType::TwoWay,
3371                        })
3372                    }
3373                    _ => Err(fidl::Error::UnknownOrdinal {
3374                        ordinal: header.ordinal,
3375                        protocol_name:
3376                            <NamespaceMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
3377                    }),
3378                }))
3379            },
3380        )
3381    }
3382}
3383
3384/// Protocol for performing namespace operations.
3385#[derive(Debug)]
3386pub enum NamespaceRequest {
3387    Create {
3388        entries: Vec<NamespaceInputEntry>,
3389        responder: NamespaceCreateResponder,
3390    },
3391    /// An interaction was received which does not match any known method.
3392    #[non_exhaustive]
3393    _UnknownMethod {
3394        /// Ordinal of the method that was called.
3395        ordinal: u64,
3396        control_handle: NamespaceControlHandle,
3397        method_type: fidl::MethodType,
3398    },
3399}
3400
3401impl NamespaceRequest {
3402    #[allow(irrefutable_let_patterns)]
3403    pub fn into_create(self) -> Option<(Vec<NamespaceInputEntry>, NamespaceCreateResponder)> {
3404        if let NamespaceRequest::Create { entries, responder } = self {
3405            Some((entries, responder))
3406        } else {
3407            None
3408        }
3409    }
3410
3411    /// Name of the method defined in FIDL
3412    pub fn method_name(&self) -> &'static str {
3413        match *self {
3414            NamespaceRequest::Create { .. } => "create",
3415            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
3416                "unknown one-way method"
3417            }
3418            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
3419                "unknown two-way method"
3420            }
3421        }
3422    }
3423}
3424
3425#[derive(Debug, Clone)]
3426pub struct NamespaceControlHandle {
3427    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
3428}
3429
3430impl fdomain_client::fidl::ControlHandle for NamespaceControlHandle {
3431    fn shutdown(&self) {
3432        self.inner.shutdown()
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 NamespaceControlHandle {}
3444
3445#[must_use = "FIDL methods require a response to be sent"]
3446#[derive(Debug)]
3447pub struct NamespaceCreateResponder {
3448    control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
3449    tx_id: u32,
3450}
3451
3452/// Set the the channel to be shutdown (see [`NamespaceControlHandle::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 NamespaceCreateResponder {
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 NamespaceCreateResponder {
3464    type ControlHandle = NamespaceControlHandle;
3465
3466    fn control_handle(&self) -> &NamespaceControlHandle {
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 NamespaceCreateResponder {
3479    /// Sends a response to the FIDL transaction.
3480    ///
3481    /// Sets the channel to shutdown if an error occurs.
3482    pub fn send(
3483        self,
3484        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3485    ) -> Result<(), fidl::Error> {
3486        let _result = self.send_raw(result);
3487        if _result.is_err() {
3488            self.control_handle.shutdown();
3489        }
3490        self.drop_without_shutdown();
3491        _result
3492    }
3493
3494    /// Similar to "send" but does not shutdown the channel if an error occurs.
3495    pub fn send_no_shutdown_on_err(
3496        self,
3497        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3498    ) -> Result<(), fidl::Error> {
3499        let _result = self.send_raw(result);
3500        self.drop_without_shutdown();
3501        _result
3502    }
3503
3504    fn send_raw(
3505        &self,
3506        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
3507    ) -> Result<(), fidl::Error> {
3508        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
3509            NamespaceCreateResponse,
3510            NamespaceError,
3511        >>(
3512            fidl::encoding::FlexibleResult::new(
3513                result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
3514            ),
3515            self.tx_id,
3516            0x4329fe12b2a790f9,
3517            fidl::encoding::DynamicFlags::FLEXIBLE,
3518        )
3519    }
3520}
3521
3522#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3523pub struct RealmMarker;
3524
3525impl fdomain_client::fidl::ProtocolMarker for RealmMarker {
3526    type Proxy = RealmProxy;
3527    type RequestStream = RealmRequestStream;
3528
3529    const DEBUG_NAME: &'static str = "fuchsia.component.Realm";
3530}
3531impl fdomain_client::fidl::DiscoverableProtocolMarker for RealmMarker {}
3532pub type RealmOpenControllerResult = Result<(), Error>;
3533pub type RealmOpenExposedDirResult = Result<(), Error>;
3534pub type RealmCreateChildResult = Result<(), Error>;
3535pub type RealmDestroyChildResult = Result<(), Error>;
3536pub type RealmListChildrenResult = Result<(), Error>;
3537pub type RealmGetResolvedInfoResult =
3538    Result<fdomain_fuchsia_component_resolution::Component, Error>;
3539pub type RealmGetChildOutputDictionaryResult =
3540    Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>;
3541
3542pub trait RealmProxyInterface: Send + Sync {
3543    type OpenControllerResponseFut: std::future::Future<Output = Result<RealmOpenControllerResult, fidl::Error>>
3544        + Send;
3545    fn r#open_controller(
3546        &self,
3547        child: &fdomain_fuchsia_component_decl::ChildRef,
3548        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
3549    ) -> Self::OpenControllerResponseFut;
3550    type OpenExposedDirResponseFut: std::future::Future<Output = Result<RealmOpenExposedDirResult, fidl::Error>>
3551        + Send;
3552    fn r#open_exposed_dir(
3553        &self,
3554        child: &fdomain_fuchsia_component_decl::ChildRef,
3555        exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
3556    ) -> Self::OpenExposedDirResponseFut;
3557    type CreateChildResponseFut: std::future::Future<Output = Result<RealmCreateChildResult, fidl::Error>>
3558        + Send;
3559    fn r#create_child(
3560        &self,
3561        collection: &fdomain_fuchsia_component_decl::CollectionRef,
3562        decl: &fdomain_fuchsia_component_decl::Child,
3563        args: CreateChildArgs,
3564    ) -> Self::CreateChildResponseFut;
3565    type DestroyChildResponseFut: std::future::Future<Output = Result<RealmDestroyChildResult, fidl::Error>>
3566        + Send;
3567    fn r#destroy_child(
3568        &self,
3569        child: &fdomain_fuchsia_component_decl::ChildRef,
3570    ) -> Self::DestroyChildResponseFut;
3571    type ListChildrenResponseFut: std::future::Future<Output = Result<RealmListChildrenResult, fidl::Error>>
3572        + Send;
3573    fn r#list_children(
3574        &self,
3575        collection: &fdomain_fuchsia_component_decl::CollectionRef,
3576        iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
3577    ) -> Self::ListChildrenResponseFut;
3578    type GetResolvedInfoResponseFut: std::future::Future<Output = Result<RealmGetResolvedInfoResult, fidl::Error>>
3579        + Send;
3580    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut;
3581    type GetChildOutputDictionaryResponseFut: std::future::Future<Output = Result<RealmGetChildOutputDictionaryResult, fidl::Error>>
3582        + Send;
3583    fn r#get_child_output_dictionary(
3584        &self,
3585        child: &fdomain_fuchsia_component_decl::ChildRef,
3586    ) -> Self::GetChildOutputDictionaryResponseFut;
3587}
3588
3589#[derive(Debug, Clone)]
3590pub struct RealmProxy {
3591    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
3592}
3593
3594impl fdomain_client::fidl::Proxy for RealmProxy {
3595    type Protocol = RealmMarker;
3596
3597    fn from_channel(inner: fdomain_client::Channel) -> Self {
3598        Self::new(inner)
3599    }
3600
3601    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
3602        self.client.into_channel().map_err(|client| Self { client })
3603    }
3604
3605    fn as_channel(&self) -> &fdomain_client::Channel {
3606        self.client.as_channel()
3607    }
3608}
3609
3610impl RealmProxy {
3611    /// Create a new Proxy for fuchsia.component/Realm.
3612    pub fn new(channel: fdomain_client::Channel) -> Self {
3613        let protocol_name = <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
3614        Self { client: fidl::client::Client::new(channel, protocol_name) }
3615    }
3616
3617    /// Get a Stream of events from the remote end of the protocol.
3618    ///
3619    /// # Panics
3620    ///
3621    /// Panics if the event stream was already taken.
3622    pub fn take_event_stream(&self) -> RealmEventStream {
3623        RealmEventStream { event_receiver: self.client.take_event_receiver() }
3624    }
3625
3626    /// Operate on a child component. See documentation for [`Controller`].
3627    ///
3628    /// Errors:
3629    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
3630    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
3631    /// - `INSTANCE_DIED`: This realm no longer exists.
3632    pub fn r#open_controller(
3633        &self,
3634        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3635        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
3636    ) -> fidl::client::QueryResponseFut<
3637        RealmOpenControllerResult,
3638        fdomain_client::fidl::FDomainResourceDialect,
3639    > {
3640        RealmProxyInterface::r#open_controller(self, child, controller)
3641    }
3642
3643    /// Opens the exposed directory of a child component instance. When this
3644    /// function successfully returns, `exposed_dir` is bound to a directory
3645    /// that contains the capabilities which the child exposed to its realm
3646    /// via `ComponentDecl.exposes` (specified via "expose" declarations in
3647    /// the component's manifest). The child component will not start as a
3648    /// result of this call. Instead, starting will occur iff the parent binds
3649    /// to one of the capabilities contained within `exposed_dir`.
3650    ///
3651    /// `exposed_dir` is open as long as `child` exists.
3652    ///
3653    /// Errors:
3654    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
3655    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
3656    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
3657    /// - `INSTANCE_DIED`: This realm no longer exists.
3658    pub fn r#open_exposed_dir(
3659        &self,
3660        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3661        mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
3662    ) -> fidl::client::QueryResponseFut<
3663        RealmOpenExposedDirResult,
3664        fdomain_client::fidl::FDomainResourceDialect,
3665    > {
3666        RealmProxyInterface::r#open_exposed_dir(self, child, exposed_dir)
3667    }
3668
3669    /// Creates a child component instance dynamically. When this function
3670    /// returns successfully, the instance exists, but it may not be running.
3671    ///
3672    /// The environment of the child instance is determined by the environment
3673    /// of the collection. `decl` must not set `environment`.
3674    ///
3675    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
3676    /// [CreateChild] will start the component and return once the component is
3677    /// started. Otherwise, [CreateChild] will return immediately after creating
3678    /// the component and will not start or resolve it.
3679    ///
3680    /// Errors:
3681    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
3682    ///   is not a valid declaration.
3683    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
3684    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
3685    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
3686    ///   in a `SingleRun` collection.
3687    /// - `NO_SPACE`: Could not allocate storage for the new instance.
3688    /// - `INSTANCE_DIED`: This realm no longer exists.
3689    pub fn r#create_child(
3690        &self,
3691        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3692        mut decl: &fdomain_fuchsia_component_decl::Child,
3693        mut args: CreateChildArgs,
3694    ) -> fidl::client::QueryResponseFut<
3695        RealmCreateChildResult,
3696        fdomain_client::fidl::FDomainResourceDialect,
3697    > {
3698        RealmProxyInterface::r#create_child(self, collection, decl, args)
3699    }
3700
3701    /// Destroys a dynamically-created component instance. When this function
3702    /// returns, the instance is destroyed and has stopped running.  However,
3703    /// cleanup of the component's resources (such as its isolated storage) may
3704    /// happen in the background after this function returns.
3705    ///
3706    /// Errors:
3707    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
3708    ///   to a dynamic instance.
3709    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
3710    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
3711    /// - `INSTANCE_DIED`: This realm no longer exists.
3712    pub fn r#destroy_child(
3713        &self,
3714        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3715    ) -> fidl::client::QueryResponseFut<
3716        RealmDestroyChildResult,
3717        fdomain_client::fidl::FDomainResourceDialect,
3718    > {
3719        RealmProxyInterface::r#destroy_child(self, child)
3720    }
3721
3722    /// Returns an iterator that lists all instances in a collection.
3723    ///
3724    /// NOTE: The results are not guaranteed to be consistent. Instances may be
3725    /// created or destroyed while the iterator is live, but those changes
3726    /// won't be observed by the iterator after this method returns.
3727    ///
3728    /// Errors:
3729    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
3730    /// does not have `ZX_RIGHT_WAIT`.
3731    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
3732    /// - `INSTANCE_DIED`: This realm no longer exists.
3733    /// - If `iter` does not have standard channel rights, this function may
3734    ///   return `ACCESS_DENIED` or component manager may close `iter`.
3735    pub fn r#list_children(
3736        &self,
3737        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3738        mut iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
3739    ) -> fidl::client::QueryResponseFut<
3740        RealmListChildrenResult,
3741        fdomain_client::fidl::FDomainResourceDialect,
3742    > {
3743        RealmProxyInterface::r#list_children(self, collection, iter)
3744    }
3745
3746    /// Returns the set of information that was given to the component framework
3747    /// by this component's resolver.
3748    pub fn r#get_resolved_info(
3749        &self,
3750    ) -> fidl::client::QueryResponseFut<
3751        RealmGetResolvedInfoResult,
3752        fdomain_client::fidl::FDomainResourceDialect,
3753    > {
3754        RealmProxyInterface::r#get_resolved_info(self)
3755    }
3756
3757    pub fn r#get_child_output_dictionary(
3758        &self,
3759        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3760    ) -> fidl::client::QueryResponseFut<
3761        RealmGetChildOutputDictionaryResult,
3762        fdomain_client::fidl::FDomainResourceDialect,
3763    > {
3764        RealmProxyInterface::r#get_child_output_dictionary(self, child)
3765    }
3766}
3767
3768impl RealmProxyInterface for RealmProxy {
3769    type OpenControllerResponseFut = fidl::client::QueryResponseFut<
3770        RealmOpenControllerResult,
3771        fdomain_client::fidl::FDomainResourceDialect,
3772    >;
3773    fn r#open_controller(
3774        &self,
3775        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3776        mut controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
3777    ) -> Self::OpenControllerResponseFut {
3778        fn _decode(
3779            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3780        ) -> Result<RealmOpenControllerResult, fidl::Error> {
3781            let _response = fidl::client::decode_transaction_body::<
3782                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3783                fdomain_client::fidl::FDomainResourceDialect,
3784                0x7150b7898d1b1180,
3785            >(_buf?)?;
3786            Ok(_response.map(|x| x))
3787        }
3788        self.client.send_query_and_decode::<RealmOpenControllerRequest, RealmOpenControllerResult>(
3789            (child, controller),
3790            0x7150b7898d1b1180,
3791            fidl::encoding::DynamicFlags::empty(),
3792            _decode,
3793        )
3794    }
3795
3796    type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
3797        RealmOpenExposedDirResult,
3798        fdomain_client::fidl::FDomainResourceDialect,
3799    >;
3800    fn r#open_exposed_dir(
3801        &self,
3802        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3803        mut exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
3804    ) -> Self::OpenExposedDirResponseFut {
3805        fn _decode(
3806            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3807        ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
3808            let _response = fidl::client::decode_transaction_body::<
3809                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3810                fdomain_client::fidl::FDomainResourceDialect,
3811                0x7f993235ca59f92c,
3812            >(_buf?)?;
3813            Ok(_response.map(|x| x))
3814        }
3815        self.client.send_query_and_decode::<RealmOpenExposedDirRequest, RealmOpenExposedDirResult>(
3816            (child, exposed_dir),
3817            0x7f993235ca59f92c,
3818            fidl::encoding::DynamicFlags::empty(),
3819            _decode,
3820        )
3821    }
3822
3823    type CreateChildResponseFut = fidl::client::QueryResponseFut<
3824        RealmCreateChildResult,
3825        fdomain_client::fidl::FDomainResourceDialect,
3826    >;
3827    fn r#create_child(
3828        &self,
3829        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3830        mut decl: &fdomain_fuchsia_component_decl::Child,
3831        mut args: CreateChildArgs,
3832    ) -> Self::CreateChildResponseFut {
3833        fn _decode(
3834            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3835        ) -> Result<RealmCreateChildResult, fidl::Error> {
3836            let _response = fidl::client::decode_transaction_body::<
3837                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3838                fdomain_client::fidl::FDomainResourceDialect,
3839                0x43e48ce8483d7560,
3840            >(_buf?)?;
3841            Ok(_response.map(|x| x))
3842        }
3843        self.client.send_query_and_decode::<RealmCreateChildRequest, RealmCreateChildResult>(
3844            (collection, decl, &mut args),
3845            0x43e48ce8483d7560,
3846            fidl::encoding::DynamicFlags::empty(),
3847            _decode,
3848        )
3849    }
3850
3851    type DestroyChildResponseFut = fidl::client::QueryResponseFut<
3852        RealmDestroyChildResult,
3853        fdomain_client::fidl::FDomainResourceDialect,
3854    >;
3855    fn r#destroy_child(
3856        &self,
3857        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3858    ) -> Self::DestroyChildResponseFut {
3859        fn _decode(
3860            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3861        ) -> Result<RealmDestroyChildResult, fidl::Error> {
3862            let _response = fidl::client::decode_transaction_body::<
3863                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3864                fdomain_client::fidl::FDomainResourceDialect,
3865                0x71d8caf8850c9222,
3866            >(_buf?)?;
3867            Ok(_response.map(|x| x))
3868        }
3869        self.client.send_query_and_decode::<RealmDestroyChildRequest, RealmDestroyChildResult>(
3870            (child,),
3871            0x71d8caf8850c9222,
3872            fidl::encoding::DynamicFlags::empty(),
3873            _decode,
3874        )
3875    }
3876
3877    type ListChildrenResponseFut = fidl::client::QueryResponseFut<
3878        RealmListChildrenResult,
3879        fdomain_client::fidl::FDomainResourceDialect,
3880    >;
3881    fn r#list_children(
3882        &self,
3883        mut collection: &fdomain_fuchsia_component_decl::CollectionRef,
3884        mut iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
3885    ) -> Self::ListChildrenResponseFut {
3886        fn _decode(
3887            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3888        ) -> Result<RealmListChildrenResult, fidl::Error> {
3889            let _response = fidl::client::decode_transaction_body::<
3890                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
3891                fdomain_client::fidl::FDomainResourceDialect,
3892                0x6888a76683efc0a1,
3893            >(_buf?)?;
3894            Ok(_response.map(|x| x))
3895        }
3896        self.client.send_query_and_decode::<RealmListChildrenRequest, RealmListChildrenResult>(
3897            (collection, iter),
3898            0x6888a76683efc0a1,
3899            fidl::encoding::DynamicFlags::empty(),
3900            _decode,
3901        )
3902    }
3903
3904    type GetResolvedInfoResponseFut = fidl::client::QueryResponseFut<
3905        RealmGetResolvedInfoResult,
3906        fdomain_client::fidl::FDomainResourceDialect,
3907    >;
3908    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut {
3909        fn _decode(
3910            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3911        ) -> Result<RealmGetResolvedInfoResult, fidl::Error> {
3912            let _response = fidl::client::decode_transaction_body::<
3913                fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>,
3914                fdomain_client::fidl::FDomainResourceDialect,
3915                0x734f744cb7d210a2,
3916            >(_buf?)?;
3917            Ok(_response.map(|x| x.resolved_info))
3918        }
3919        self.client
3920            .send_query_and_decode::<fidl::encoding::EmptyPayload, RealmGetResolvedInfoResult>(
3921                (),
3922                0x734f744cb7d210a2,
3923                fidl::encoding::DynamicFlags::empty(),
3924                _decode,
3925            )
3926    }
3927
3928    type GetChildOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
3929        RealmGetChildOutputDictionaryResult,
3930        fdomain_client::fidl::FDomainResourceDialect,
3931    >;
3932    fn r#get_child_output_dictionary(
3933        &self,
3934        mut child: &fdomain_fuchsia_component_decl::ChildRef,
3935    ) -> Self::GetChildOutputDictionaryResponseFut {
3936        fn _decode(
3937            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3938        ) -> Result<RealmGetChildOutputDictionaryResult, fidl::Error> {
3939            let _response = fidl::client::decode_transaction_body::<
3940                fidl::encoding::ResultType<RealmGetChildOutputDictionaryResponse, Error>,
3941                fdomain_client::fidl::FDomainResourceDialect,
3942                0x4259d08d261d5610,
3943            >(_buf?)?;
3944            Ok(_response.map(|x| x.dictionary))
3945        }
3946        self.client.send_query_and_decode::<
3947            RealmGetChildOutputDictionaryRequest,
3948            RealmGetChildOutputDictionaryResult,
3949        >(
3950            (child,),
3951            0x4259d08d261d5610,
3952            fidl::encoding::DynamicFlags::empty(),
3953            _decode,
3954        )
3955    }
3956}
3957
3958pub struct RealmEventStream {
3959    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
3960}
3961
3962impl std::marker::Unpin for RealmEventStream {}
3963
3964impl futures::stream::FusedStream for RealmEventStream {
3965    fn is_terminated(&self) -> bool {
3966        self.event_receiver.is_terminated()
3967    }
3968}
3969
3970impl futures::Stream for RealmEventStream {
3971    type Item = Result<RealmEvent, fidl::Error>;
3972
3973    fn poll_next(
3974        mut self: std::pin::Pin<&mut Self>,
3975        cx: &mut std::task::Context<'_>,
3976    ) -> std::task::Poll<Option<Self::Item>> {
3977        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3978            &mut self.event_receiver,
3979            cx
3980        )?) {
3981            Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
3982            None => std::task::Poll::Ready(None),
3983        }
3984    }
3985}
3986
3987#[derive(Debug)]
3988pub enum RealmEvent {}
3989
3990impl RealmEvent {
3991    /// Decodes a message buffer as a [`RealmEvent`].
3992    fn decode(
3993        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3994    ) -> Result<RealmEvent, fidl::Error> {
3995        let (bytes, _handles) = buf.split_mut();
3996        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3997        debug_assert_eq!(tx_header.tx_id, 0);
3998        match tx_header.ordinal {
3999            _ => Err(fidl::Error::UnknownOrdinal {
4000                ordinal: tx_header.ordinal,
4001                protocol_name: <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4002            }),
4003        }
4004    }
4005}
4006
4007/// A Stream of incoming requests for fuchsia.component/Realm.
4008pub struct RealmRequestStream {
4009    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4010    is_terminated: bool,
4011}
4012
4013impl std::marker::Unpin for RealmRequestStream {}
4014
4015impl futures::stream::FusedStream for RealmRequestStream {
4016    fn is_terminated(&self) -> bool {
4017        self.is_terminated
4018    }
4019}
4020
4021impl fdomain_client::fidl::RequestStream for RealmRequestStream {
4022    type Protocol = RealmMarker;
4023    type ControlHandle = RealmControlHandle;
4024
4025    fn from_channel(channel: fdomain_client::Channel) -> Self {
4026        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4027    }
4028
4029    fn control_handle(&self) -> Self::ControlHandle {
4030        RealmControlHandle { inner: self.inner.clone() }
4031    }
4032
4033    fn into_inner(
4034        self,
4035    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
4036    {
4037        (self.inner, self.is_terminated)
4038    }
4039
4040    fn from_inner(
4041        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4042        is_terminated: bool,
4043    ) -> Self {
4044        Self { inner, is_terminated }
4045    }
4046}
4047
4048impl futures::Stream for RealmRequestStream {
4049    type Item = Result<RealmRequest, fidl::Error>;
4050
4051    fn poll_next(
4052        mut self: std::pin::Pin<&mut Self>,
4053        cx: &mut std::task::Context<'_>,
4054    ) -> std::task::Poll<Option<Self::Item>> {
4055        let this = &mut *self;
4056        if this.inner.check_shutdown(cx) {
4057            this.is_terminated = true;
4058            return std::task::Poll::Ready(None);
4059        }
4060        if this.is_terminated {
4061            panic!("polled RealmRequestStream after completion");
4062        }
4063        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
4064            |bytes, handles| {
4065                match this.inner.channel().read_etc(cx, bytes, handles) {
4066                    std::task::Poll::Ready(Ok(())) => {}
4067                    std::task::Poll::Pending => return std::task::Poll::Pending,
4068                    std::task::Poll::Ready(Err(None)) => {
4069                        this.is_terminated = true;
4070                        return std::task::Poll::Ready(None);
4071                    }
4072                    std::task::Poll::Ready(Err(Some(e))) => {
4073                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4074                            e.into(),
4075                        ))));
4076                    }
4077                }
4078
4079                // A message has been received from the channel
4080                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4081
4082                std::task::Poll::Ready(Some(match header.ordinal {
4083                    0x7150b7898d1b1180 => {
4084                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4085                        let mut req = fidl::new_empty!(
4086                            RealmOpenControllerRequest,
4087                            fdomain_client::fidl::FDomainResourceDialect
4088                        );
4089                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmOpenControllerRequest>(&header, _body_bytes, handles, &mut req)?;
4090                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4091                        Ok(RealmRequest::OpenController {
4092                            child: req.child,
4093                            controller: req.controller,
4094
4095                            responder: RealmOpenControllerResponder {
4096                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4097                                tx_id: header.tx_id,
4098                            },
4099                        })
4100                    }
4101                    0x7f993235ca59f92c => {
4102                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4103                        let mut req = fidl::new_empty!(
4104                            RealmOpenExposedDirRequest,
4105                            fdomain_client::fidl::FDomainResourceDialect
4106                        );
4107                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
4108                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4109                        Ok(RealmRequest::OpenExposedDir {
4110                            child: req.child,
4111                            exposed_dir: req.exposed_dir,
4112
4113                            responder: RealmOpenExposedDirResponder {
4114                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4115                                tx_id: header.tx_id,
4116                            },
4117                        })
4118                    }
4119                    0x43e48ce8483d7560 => {
4120                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4121                        let mut req = fidl::new_empty!(
4122                            RealmCreateChildRequest,
4123                            fdomain_client::fidl::FDomainResourceDialect
4124                        );
4125                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmCreateChildRequest>(&header, _body_bytes, handles, &mut req)?;
4126                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4127                        Ok(RealmRequest::CreateChild {
4128                            collection: req.collection,
4129                            decl: req.decl,
4130                            args: req.args,
4131
4132                            responder: RealmCreateChildResponder {
4133                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4134                                tx_id: header.tx_id,
4135                            },
4136                        })
4137                    }
4138                    0x71d8caf8850c9222 => {
4139                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4140                        let mut req = fidl::new_empty!(
4141                            RealmDestroyChildRequest,
4142                            fdomain_client::fidl::FDomainResourceDialect
4143                        );
4144                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmDestroyChildRequest>(&header, _body_bytes, handles, &mut req)?;
4145                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4146                        Ok(RealmRequest::DestroyChild {
4147                            child: req.child,
4148
4149                            responder: RealmDestroyChildResponder {
4150                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4151                                tx_id: header.tx_id,
4152                            },
4153                        })
4154                    }
4155                    0x6888a76683efc0a1 => {
4156                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4157                        let mut req = fidl::new_empty!(
4158                            RealmListChildrenRequest,
4159                            fdomain_client::fidl::FDomainResourceDialect
4160                        );
4161                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmListChildrenRequest>(&header, _body_bytes, handles, &mut req)?;
4162                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4163                        Ok(RealmRequest::ListChildren {
4164                            collection: req.collection,
4165                            iter: req.iter,
4166
4167                            responder: RealmListChildrenResponder {
4168                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4169                                tx_id: header.tx_id,
4170                            },
4171                        })
4172                    }
4173                    0x734f744cb7d210a2 => {
4174                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4175                        let mut req = fidl::new_empty!(
4176                            fidl::encoding::EmptyPayload,
4177                            fdomain_client::fidl::FDomainResourceDialect
4178                        );
4179                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4180                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4181                        Ok(RealmRequest::GetResolvedInfo {
4182                            responder: RealmGetResolvedInfoResponder {
4183                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4184                                tx_id: header.tx_id,
4185                            },
4186                        })
4187                    }
4188                    0x4259d08d261d5610 => {
4189                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4190                        let mut req = fidl::new_empty!(
4191                            RealmGetChildOutputDictionaryRequest,
4192                            fdomain_client::fidl::FDomainResourceDialect
4193                        );
4194                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<RealmGetChildOutputDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
4195                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
4196                        Ok(RealmRequest::GetChildOutputDictionary {
4197                            child: req.child,
4198
4199                            responder: RealmGetChildOutputDictionaryResponder {
4200                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4201                                tx_id: header.tx_id,
4202                            },
4203                        })
4204                    }
4205                    _ => Err(fidl::Error::UnknownOrdinal {
4206                        ordinal: header.ordinal,
4207                        protocol_name:
4208                            <RealmMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
4209                    }),
4210                }))
4211            },
4212        )
4213    }
4214}
4215
4216/// A protocol used by a component instance to manage its own realm, such as for
4217/// binding to its children.
4218///
4219/// Requests to this protocol are processed in the order they are received.
4220/// Clients that wish to send requests in parallel should open multiple
4221/// connections.
4222///
4223/// The component framework provides this service to components that use
4224/// `fuchsia.component.Realm`.
4225#[derive(Debug)]
4226pub enum RealmRequest {
4227    /// Operate on a child component. See documentation for [`Controller`].
4228    ///
4229    /// Errors:
4230    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4231    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4232    /// - `INSTANCE_DIED`: This realm no longer exists.
4233    OpenController {
4234        child: fdomain_fuchsia_component_decl::ChildRef,
4235        controller: fdomain_client::fidl::ServerEnd<ControllerMarker>,
4236        responder: RealmOpenControllerResponder,
4237    },
4238    /// Opens the exposed directory of a child component instance. When this
4239    /// function successfully returns, `exposed_dir` is bound to a directory
4240    /// that contains the capabilities which the child exposed to its realm
4241    /// via `ComponentDecl.exposes` (specified via "expose" declarations in
4242    /// the component's manifest). The child component will not start as a
4243    /// result of this call. Instead, starting will occur iff the parent binds
4244    /// to one of the capabilities contained within `exposed_dir`.
4245    ///
4246    /// `exposed_dir` is open as long as `child` exists.
4247    ///
4248    /// Errors:
4249    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4250    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4251    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
4252    /// - `INSTANCE_DIED`: This realm no longer exists.
4253    OpenExposedDir {
4254        child: fdomain_fuchsia_component_decl::ChildRef,
4255        exposed_dir: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4256        responder: RealmOpenExposedDirResponder,
4257    },
4258    /// Creates a child component instance dynamically. When this function
4259    /// returns successfully, the instance exists, but it may not be running.
4260    ///
4261    /// The environment of the child instance is determined by the environment
4262    /// of the collection. `decl` must not set `environment`.
4263    ///
4264    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
4265    /// [CreateChild] will start the component and return once the component is
4266    /// started. Otherwise, [CreateChild] will return immediately after creating
4267    /// the component and will not start or resolve it.
4268    ///
4269    /// Errors:
4270    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
4271    ///   is not a valid declaration.
4272    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4273    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
4274    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
4275    ///   in a `SingleRun` collection.
4276    /// - `NO_SPACE`: Could not allocate storage for the new instance.
4277    /// - `INSTANCE_DIED`: This realm no longer exists.
4278    CreateChild {
4279        collection: fdomain_fuchsia_component_decl::CollectionRef,
4280        decl: fdomain_fuchsia_component_decl::Child,
4281        args: CreateChildArgs,
4282        responder: RealmCreateChildResponder,
4283    },
4284    /// Destroys a dynamically-created component instance. When this function
4285    /// returns, the instance is destroyed and has stopped running.  However,
4286    /// cleanup of the component's resources (such as its isolated storage) may
4287    /// happen in the background after this function returns.
4288    ///
4289    /// Errors:
4290    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
4291    ///   to a dynamic instance.
4292    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4293    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4294    /// - `INSTANCE_DIED`: This realm no longer exists.
4295    DestroyChild {
4296        child: fdomain_fuchsia_component_decl::ChildRef,
4297        responder: RealmDestroyChildResponder,
4298    },
4299    /// Returns an iterator that lists all instances in a collection.
4300    ///
4301    /// NOTE: The results are not guaranteed to be consistent. Instances may be
4302    /// created or destroyed while the iterator is live, but those changes
4303    /// won't be observed by the iterator after this method returns.
4304    ///
4305    /// Errors:
4306    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
4307    /// does not have `ZX_RIGHT_WAIT`.
4308    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4309    /// - `INSTANCE_DIED`: This realm no longer exists.
4310    /// - If `iter` does not have standard channel rights, this function may
4311    ///   return `ACCESS_DENIED` or component manager may close `iter`.
4312    ListChildren {
4313        collection: fdomain_fuchsia_component_decl::CollectionRef,
4314        iter: fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4315        responder: RealmListChildrenResponder,
4316    },
4317    /// Returns the set of information that was given to the component framework
4318    /// by this component's resolver.
4319    GetResolvedInfo { responder: RealmGetResolvedInfoResponder },
4320    GetChildOutputDictionary {
4321        child: fdomain_fuchsia_component_decl::ChildRef,
4322        responder: RealmGetChildOutputDictionaryResponder,
4323    },
4324}
4325
4326impl RealmRequest {
4327    #[allow(irrefutable_let_patterns)]
4328    pub fn into_open_controller(
4329        self,
4330    ) -> Option<(
4331        fdomain_fuchsia_component_decl::ChildRef,
4332        fdomain_client::fidl::ServerEnd<ControllerMarker>,
4333        RealmOpenControllerResponder,
4334    )> {
4335        if let RealmRequest::OpenController { child, controller, responder } = self {
4336            Some((child, controller, responder))
4337        } else {
4338            None
4339        }
4340    }
4341
4342    #[allow(irrefutable_let_patterns)]
4343    pub fn into_open_exposed_dir(
4344        self,
4345    ) -> Option<(
4346        fdomain_fuchsia_component_decl::ChildRef,
4347        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
4348        RealmOpenExposedDirResponder,
4349    )> {
4350        if let RealmRequest::OpenExposedDir { child, exposed_dir, responder } = self {
4351            Some((child, exposed_dir, responder))
4352        } else {
4353            None
4354        }
4355    }
4356
4357    #[allow(irrefutable_let_patterns)]
4358    pub fn into_create_child(
4359        self,
4360    ) -> Option<(
4361        fdomain_fuchsia_component_decl::CollectionRef,
4362        fdomain_fuchsia_component_decl::Child,
4363        CreateChildArgs,
4364        RealmCreateChildResponder,
4365    )> {
4366        if let RealmRequest::CreateChild { collection, decl, args, responder } = self {
4367            Some((collection, decl, args, responder))
4368        } else {
4369            None
4370        }
4371    }
4372
4373    #[allow(irrefutable_let_patterns)]
4374    pub fn into_destroy_child(
4375        self,
4376    ) -> Option<(fdomain_fuchsia_component_decl::ChildRef, RealmDestroyChildResponder)> {
4377        if let RealmRequest::DestroyChild { child, responder } = self {
4378            Some((child, responder))
4379        } else {
4380            None
4381        }
4382    }
4383
4384    #[allow(irrefutable_let_patterns)]
4385    pub fn into_list_children(
4386        self,
4387    ) -> Option<(
4388        fdomain_fuchsia_component_decl::CollectionRef,
4389        fdomain_client::fidl::ServerEnd<ChildIteratorMarker>,
4390        RealmListChildrenResponder,
4391    )> {
4392        if let RealmRequest::ListChildren { collection, iter, responder } = self {
4393            Some((collection, iter, responder))
4394        } else {
4395            None
4396        }
4397    }
4398
4399    #[allow(irrefutable_let_patterns)]
4400    pub fn into_get_resolved_info(self) -> Option<(RealmGetResolvedInfoResponder)> {
4401        if let RealmRequest::GetResolvedInfo { responder } = self {
4402            Some((responder))
4403        } else {
4404            None
4405        }
4406    }
4407
4408    #[allow(irrefutable_let_patterns)]
4409    pub fn into_get_child_output_dictionary(
4410        self,
4411    ) -> Option<(fdomain_fuchsia_component_decl::ChildRef, RealmGetChildOutputDictionaryResponder)>
4412    {
4413        if let RealmRequest::GetChildOutputDictionary { child, responder } = self {
4414            Some((child, responder))
4415        } else {
4416            None
4417        }
4418    }
4419
4420    /// Name of the method defined in FIDL
4421    pub fn method_name(&self) -> &'static str {
4422        match *self {
4423            RealmRequest::OpenController { .. } => "open_controller",
4424            RealmRequest::OpenExposedDir { .. } => "open_exposed_dir",
4425            RealmRequest::CreateChild { .. } => "create_child",
4426            RealmRequest::DestroyChild { .. } => "destroy_child",
4427            RealmRequest::ListChildren { .. } => "list_children",
4428            RealmRequest::GetResolvedInfo { .. } => "get_resolved_info",
4429            RealmRequest::GetChildOutputDictionary { .. } => "get_child_output_dictionary",
4430        }
4431    }
4432}
4433
4434#[derive(Debug, Clone)]
4435pub struct RealmControlHandle {
4436    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
4437}
4438
4439impl fdomain_client::fidl::ControlHandle for RealmControlHandle {
4440    fn shutdown(&self) {
4441        self.inner.shutdown()
4442    }
4443
4444    fn is_closed(&self) -> bool {
4445        self.inner.channel().is_closed()
4446    }
4447    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
4448        self.inner.channel().on_closed()
4449    }
4450}
4451
4452impl RealmControlHandle {}
4453
4454#[must_use = "FIDL methods require a response to be sent"]
4455#[derive(Debug)]
4456pub struct RealmOpenControllerResponder {
4457    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4458    tx_id: u32,
4459}
4460
4461/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4462/// if the responder is dropped without sending a response, so that the client
4463/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4464impl std::ops::Drop for RealmOpenControllerResponder {
4465    fn drop(&mut self) {
4466        self.control_handle.shutdown();
4467        // Safety: drops once, never accessed again
4468        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4469    }
4470}
4471
4472impl fdomain_client::fidl::Responder for RealmOpenControllerResponder {
4473    type ControlHandle = RealmControlHandle;
4474
4475    fn control_handle(&self) -> &RealmControlHandle {
4476        &self.control_handle
4477    }
4478
4479    fn drop_without_shutdown(mut self) {
4480        // Safety: drops once, never accessed again due to mem::forget
4481        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4482        // Prevent Drop from running (which would shut down the channel)
4483        std::mem::forget(self);
4484    }
4485}
4486
4487impl RealmOpenControllerResponder {
4488    /// Sends a response to the FIDL transaction.
4489    ///
4490    /// Sets the channel to shutdown if an error occurs.
4491    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4492        let _result = self.send_raw(result);
4493        if _result.is_err() {
4494            self.control_handle.shutdown();
4495        }
4496        self.drop_without_shutdown();
4497        _result
4498    }
4499
4500    /// Similar to "send" but does not shutdown the channel if an error occurs.
4501    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4502        let _result = self.send_raw(result);
4503        self.drop_without_shutdown();
4504        _result
4505    }
4506
4507    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4508        self.control_handle
4509            .inner
4510            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4511                result,
4512                self.tx_id,
4513                0x7150b7898d1b1180,
4514                fidl::encoding::DynamicFlags::empty(),
4515            )
4516    }
4517}
4518
4519#[must_use = "FIDL methods require a response to be sent"]
4520#[derive(Debug)]
4521pub struct RealmOpenExposedDirResponder {
4522    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4523    tx_id: u32,
4524}
4525
4526/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4527/// if the responder is dropped without sending a response, so that the client
4528/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4529impl std::ops::Drop for RealmOpenExposedDirResponder {
4530    fn drop(&mut self) {
4531        self.control_handle.shutdown();
4532        // Safety: drops once, never accessed again
4533        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4534    }
4535}
4536
4537impl fdomain_client::fidl::Responder for RealmOpenExposedDirResponder {
4538    type ControlHandle = RealmControlHandle;
4539
4540    fn control_handle(&self) -> &RealmControlHandle {
4541        &self.control_handle
4542    }
4543
4544    fn drop_without_shutdown(mut self) {
4545        // Safety: drops once, never accessed again due to mem::forget
4546        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4547        // Prevent Drop from running (which would shut down the channel)
4548        std::mem::forget(self);
4549    }
4550}
4551
4552impl RealmOpenExposedDirResponder {
4553    /// Sends a response to the FIDL transaction.
4554    ///
4555    /// Sets the channel to shutdown if an error occurs.
4556    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4557        let _result = self.send_raw(result);
4558        if _result.is_err() {
4559            self.control_handle.shutdown();
4560        }
4561        self.drop_without_shutdown();
4562        _result
4563    }
4564
4565    /// Similar to "send" but does not shutdown the channel if an error occurs.
4566    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4567        let _result = self.send_raw(result);
4568        self.drop_without_shutdown();
4569        _result
4570    }
4571
4572    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4573        self.control_handle
4574            .inner
4575            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4576                result,
4577                self.tx_id,
4578                0x7f993235ca59f92c,
4579                fidl::encoding::DynamicFlags::empty(),
4580            )
4581    }
4582}
4583
4584#[must_use = "FIDL methods require a response to be sent"]
4585#[derive(Debug)]
4586pub struct RealmCreateChildResponder {
4587    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4588    tx_id: u32,
4589}
4590
4591/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4592/// if the responder is dropped without sending a response, so that the client
4593/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4594impl std::ops::Drop for RealmCreateChildResponder {
4595    fn drop(&mut self) {
4596        self.control_handle.shutdown();
4597        // Safety: drops once, never accessed again
4598        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4599    }
4600}
4601
4602impl fdomain_client::fidl::Responder for RealmCreateChildResponder {
4603    type ControlHandle = RealmControlHandle;
4604
4605    fn control_handle(&self) -> &RealmControlHandle {
4606        &self.control_handle
4607    }
4608
4609    fn drop_without_shutdown(mut self) {
4610        // Safety: drops once, never accessed again due to mem::forget
4611        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4612        // Prevent Drop from running (which would shut down the channel)
4613        std::mem::forget(self);
4614    }
4615}
4616
4617impl RealmCreateChildResponder {
4618    /// Sends a response to the FIDL transaction.
4619    ///
4620    /// Sets the channel to shutdown if an error occurs.
4621    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4622        let _result = self.send_raw(result);
4623        if _result.is_err() {
4624            self.control_handle.shutdown();
4625        }
4626        self.drop_without_shutdown();
4627        _result
4628    }
4629
4630    /// Similar to "send" but does not shutdown the channel if an error occurs.
4631    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4632        let _result = self.send_raw(result);
4633        self.drop_without_shutdown();
4634        _result
4635    }
4636
4637    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4638        self.control_handle
4639            .inner
4640            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4641                result,
4642                self.tx_id,
4643                0x43e48ce8483d7560,
4644                fidl::encoding::DynamicFlags::empty(),
4645            )
4646    }
4647}
4648
4649#[must_use = "FIDL methods require a response to be sent"]
4650#[derive(Debug)]
4651pub struct RealmDestroyChildResponder {
4652    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4653    tx_id: u32,
4654}
4655
4656/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4657/// if the responder is dropped without sending a response, so that the client
4658/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4659impl std::ops::Drop for RealmDestroyChildResponder {
4660    fn drop(&mut self) {
4661        self.control_handle.shutdown();
4662        // Safety: drops once, never accessed again
4663        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4664    }
4665}
4666
4667impl fdomain_client::fidl::Responder for RealmDestroyChildResponder {
4668    type ControlHandle = RealmControlHandle;
4669
4670    fn control_handle(&self) -> &RealmControlHandle {
4671        &self.control_handle
4672    }
4673
4674    fn drop_without_shutdown(mut self) {
4675        // Safety: drops once, never accessed again due to mem::forget
4676        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4677        // Prevent Drop from running (which would shut down the channel)
4678        std::mem::forget(self);
4679    }
4680}
4681
4682impl RealmDestroyChildResponder {
4683    /// Sends a response to the FIDL transaction.
4684    ///
4685    /// Sets the channel to shutdown if an error occurs.
4686    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4687        let _result = self.send_raw(result);
4688        if _result.is_err() {
4689            self.control_handle.shutdown();
4690        }
4691        self.drop_without_shutdown();
4692        _result
4693    }
4694
4695    /// Similar to "send" but does not shutdown the channel if an error occurs.
4696    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4697        let _result = self.send_raw(result);
4698        self.drop_without_shutdown();
4699        _result
4700    }
4701
4702    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4703        self.control_handle
4704            .inner
4705            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4706                result,
4707                self.tx_id,
4708                0x71d8caf8850c9222,
4709                fidl::encoding::DynamicFlags::empty(),
4710            )
4711    }
4712}
4713
4714#[must_use = "FIDL methods require a response to be sent"]
4715#[derive(Debug)]
4716pub struct RealmListChildrenResponder {
4717    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4718    tx_id: u32,
4719}
4720
4721/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4722/// if the responder is dropped without sending a response, so that the client
4723/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4724impl std::ops::Drop for RealmListChildrenResponder {
4725    fn drop(&mut self) {
4726        self.control_handle.shutdown();
4727        // Safety: drops once, never accessed again
4728        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4729    }
4730}
4731
4732impl fdomain_client::fidl::Responder for RealmListChildrenResponder {
4733    type ControlHandle = RealmControlHandle;
4734
4735    fn control_handle(&self) -> &RealmControlHandle {
4736        &self.control_handle
4737    }
4738
4739    fn drop_without_shutdown(mut self) {
4740        // Safety: drops once, never accessed again due to mem::forget
4741        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4742        // Prevent Drop from running (which would shut down the channel)
4743        std::mem::forget(self);
4744    }
4745}
4746
4747impl RealmListChildrenResponder {
4748    /// Sends a response to the FIDL transaction.
4749    ///
4750    /// Sets the channel to shutdown if an error occurs.
4751    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4752        let _result = self.send_raw(result);
4753        if _result.is_err() {
4754            self.control_handle.shutdown();
4755        }
4756        self.drop_without_shutdown();
4757        _result
4758    }
4759
4760    /// Similar to "send" but does not shutdown the channel if an error occurs.
4761    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4762        let _result = self.send_raw(result);
4763        self.drop_without_shutdown();
4764        _result
4765    }
4766
4767    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
4768        self.control_handle
4769            .inner
4770            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
4771                result,
4772                self.tx_id,
4773                0x6888a76683efc0a1,
4774                fidl::encoding::DynamicFlags::empty(),
4775            )
4776    }
4777}
4778
4779#[must_use = "FIDL methods require a response to be sent"]
4780#[derive(Debug)]
4781pub struct RealmGetResolvedInfoResponder {
4782    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4783    tx_id: u32,
4784}
4785
4786/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4787/// if the responder is dropped without sending a response, so that the client
4788/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4789impl std::ops::Drop for RealmGetResolvedInfoResponder {
4790    fn drop(&mut self) {
4791        self.control_handle.shutdown();
4792        // Safety: drops once, never accessed again
4793        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4794    }
4795}
4796
4797impl fdomain_client::fidl::Responder for RealmGetResolvedInfoResponder {
4798    type ControlHandle = RealmControlHandle;
4799
4800    fn control_handle(&self) -> &RealmControlHandle {
4801        &self.control_handle
4802    }
4803
4804    fn drop_without_shutdown(mut self) {
4805        // Safety: drops once, never accessed again due to mem::forget
4806        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4807        // Prevent Drop from running (which would shut down the channel)
4808        std::mem::forget(self);
4809    }
4810}
4811
4812impl RealmGetResolvedInfoResponder {
4813    /// Sends a response to the FIDL transaction.
4814    ///
4815    /// Sets the channel to shutdown if an error occurs.
4816    pub fn send(
4817        self,
4818        mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
4819    ) -> Result<(), fidl::Error> {
4820        let _result = self.send_raw(result);
4821        if _result.is_err() {
4822            self.control_handle.shutdown();
4823        }
4824        self.drop_without_shutdown();
4825        _result
4826    }
4827
4828    /// Similar to "send" but does not shutdown the channel if an error occurs.
4829    pub fn send_no_shutdown_on_err(
4830        self,
4831        mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
4832    ) -> Result<(), fidl::Error> {
4833        let _result = self.send_raw(result);
4834        self.drop_without_shutdown();
4835        _result
4836    }
4837
4838    fn send_raw(
4839        &self,
4840        mut result: Result<fdomain_fuchsia_component_resolution::Component, Error>,
4841    ) -> Result<(), fidl::Error> {
4842        self.control_handle
4843            .inner
4844            .send::<fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>>(
4845                result.as_mut().map_err(|e| *e).map(|resolved_info| (resolved_info,)),
4846                self.tx_id,
4847                0x734f744cb7d210a2,
4848                fidl::encoding::DynamicFlags::empty(),
4849            )
4850    }
4851}
4852
4853#[must_use = "FIDL methods require a response to be sent"]
4854#[derive(Debug)]
4855pub struct RealmGetChildOutputDictionaryResponder {
4856    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
4857    tx_id: u32,
4858}
4859
4860/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
4861/// if the responder is dropped without sending a response, so that the client
4862/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4863impl std::ops::Drop for RealmGetChildOutputDictionaryResponder {
4864    fn drop(&mut self) {
4865        self.control_handle.shutdown();
4866        // Safety: drops once, never accessed again
4867        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4868    }
4869}
4870
4871impl fdomain_client::fidl::Responder for RealmGetChildOutputDictionaryResponder {
4872    type ControlHandle = RealmControlHandle;
4873
4874    fn control_handle(&self) -> &RealmControlHandle {
4875        &self.control_handle
4876    }
4877
4878    fn drop_without_shutdown(mut self) {
4879        // Safety: drops once, never accessed again due to mem::forget
4880        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4881        // Prevent Drop from running (which would shut down the channel)
4882        std::mem::forget(self);
4883    }
4884}
4885
4886impl RealmGetChildOutputDictionaryResponder {
4887    /// Sends a response to the FIDL transaction.
4888    ///
4889    /// Sets the channel to shutdown if an error occurs.
4890    pub fn send(
4891        self,
4892        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
4893    ) -> Result<(), fidl::Error> {
4894        let _result = self.send_raw(result);
4895        if _result.is_err() {
4896            self.control_handle.shutdown();
4897        }
4898        self.drop_without_shutdown();
4899        _result
4900    }
4901
4902    /// Similar to "send" but does not shutdown the channel if an error occurs.
4903    pub fn send_no_shutdown_on_err(
4904        self,
4905        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
4906    ) -> Result<(), fidl::Error> {
4907        let _result = self.send_raw(result);
4908        self.drop_without_shutdown();
4909        _result
4910    }
4911
4912    fn send_raw(
4913        &self,
4914        mut result: Result<fdomain_fuchsia_component_sandbox::DictionaryRef, Error>,
4915    ) -> Result<(), fidl::Error> {
4916        self.control_handle.inner.send::<fidl::encoding::ResultType<
4917            RealmGetChildOutputDictionaryResponse,
4918            Error,
4919        >>(
4920            result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
4921            self.tx_id,
4922            0x4259d08d261d5610,
4923            fidl::encoding::DynamicFlags::empty(),
4924        )
4925    }
4926}
4927
4928#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4929pub struct StorageAdminMarker;
4930
4931impl fdomain_client::fidl::ProtocolMarker for StorageAdminMarker {
4932    type Proxy = StorageAdminProxy;
4933    type RequestStream = StorageAdminRequestStream;
4934
4935    const DEBUG_NAME: &'static str = "fuchsia.component.StorageAdmin";
4936}
4937impl fdomain_client::fidl::DiscoverableProtocolMarker for StorageAdminMarker {}
4938pub type StorageAdminOpenStorageResult = Result<(), Error>;
4939pub type StorageAdminListStorageInRealmResult = Result<(), Error>;
4940pub type StorageAdminOpenComponentStorageByIdResult = Result<(), Error>;
4941pub type StorageAdminDeleteComponentStorageResult = Result<(), Error>;
4942pub type StorageAdminGetStatusResult = Result<StorageStatus, StatusError>;
4943pub type StorageAdminDeleteAllStorageContentsResult = Result<(), DeletionError>;
4944
4945pub trait StorageAdminProxyInterface: Send + Sync {
4946    type OpenStorageResponseFut: std::future::Future<Output = Result<StorageAdminOpenStorageResult, fidl::Error>>
4947        + Send;
4948    fn r#open_storage(
4949        &self,
4950        relative_moniker: &str,
4951        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
4952    ) -> Self::OpenStorageResponseFut;
4953    type ListStorageInRealmResponseFut: std::future::Future<Output = Result<StorageAdminListStorageInRealmResult, fidl::Error>>
4954        + Send;
4955    fn r#list_storage_in_realm(
4956        &self,
4957        relative_moniker: &str,
4958        iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
4959    ) -> Self::ListStorageInRealmResponseFut;
4960    type OpenComponentStorageByIdResponseFut: std::future::Future<
4961            Output = Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error>,
4962        > + Send;
4963    fn r#open_component_storage_by_id(
4964        &self,
4965        id: &str,
4966        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
4967    ) -> Self::OpenComponentStorageByIdResponseFut;
4968    type DeleteComponentStorageResponseFut: std::future::Future<Output = Result<StorageAdminDeleteComponentStorageResult, fidl::Error>>
4969        + Send;
4970    fn r#delete_component_storage(
4971        &self,
4972        relative_moniker: &str,
4973    ) -> Self::DeleteComponentStorageResponseFut;
4974    type GetStatusResponseFut: std::future::Future<Output = Result<StorageAdminGetStatusResult, fidl::Error>>
4975        + Send;
4976    fn r#get_status(&self) -> Self::GetStatusResponseFut;
4977    type DeleteAllStorageContentsResponseFut: std::future::Future<
4978            Output = Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error>,
4979        > + Send;
4980    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut;
4981}
4982
4983#[derive(Debug, Clone)]
4984pub struct StorageAdminProxy {
4985    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
4986}
4987
4988impl fdomain_client::fidl::Proxy for StorageAdminProxy {
4989    type Protocol = StorageAdminMarker;
4990
4991    fn from_channel(inner: fdomain_client::Channel) -> Self {
4992        Self::new(inner)
4993    }
4994
4995    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
4996        self.client.into_channel().map_err(|client| Self { client })
4997    }
4998
4999    fn as_channel(&self) -> &fdomain_client::Channel {
5000        self.client.as_channel()
5001    }
5002}
5003
5004impl StorageAdminProxy {
5005    /// Create a new Proxy for fuchsia.component/StorageAdmin.
5006    pub fn new(channel: fdomain_client::Channel) -> Self {
5007        let protocol_name =
5008            <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
5009        Self { client: fidl::client::Client::new(channel, protocol_name) }
5010    }
5011
5012    /// Get a Stream of events from the remote end of the protocol.
5013    ///
5014    /// # Panics
5015    ///
5016    /// Panics if the event stream was already taken.
5017    pub fn take_event_stream(&self) -> StorageAdminEventStream {
5018        StorageAdminEventStream { event_receiver: self.client.take_event_receiver() }
5019    }
5020
5021    /// Opens the isolated directory for the given component. The provided
5022    /// moniker is relative to the component that declares the storage
5023    /// capability. Creates the backing sub-directory for this storage if it
5024    /// hasn't yet been created.
5025    pub fn r#open_storage(
5026        &self,
5027        mut relative_moniker: &str,
5028        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5029    ) -> fidl::client::QueryResponseFut<
5030        StorageAdminOpenStorageResult,
5031        fdomain_client::fidl::FDomainResourceDialect,
5032    > {
5033        StorageAdminProxyInterface::r#open_storage(self, relative_moniker, object)
5034    }
5035
5036    /// Lists the descendant components under the specified realm that use the
5037    /// storage capability. The provided moniker is relative to the component
5038    /// that declares the storage capability.
5039    ///
5040    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
5041    /// if |relative_moniker| is malformed.
5042    pub fn r#list_storage_in_realm(
5043        &self,
5044        mut relative_moniker: &str,
5045        mut iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
5046    ) -> fidl::client::QueryResponseFut<
5047        StorageAdminListStorageInRealmResult,
5048        fdomain_client::fidl::FDomainResourceDialect,
5049    > {
5050        StorageAdminProxyInterface::r#list_storage_in_realm(self, relative_moniker, iterator)
5051    }
5052
5053    /// Opens the isolated directory for the given storage ID. Creates the
5054    /// backing sub-directory for this storage if it hasn't yet been created.
5055    pub fn r#open_component_storage_by_id(
5056        &self,
5057        mut id: &str,
5058        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5059    ) -> fidl::client::QueryResponseFut<
5060        StorageAdminOpenComponentStorageByIdResult,
5061        fdomain_client::fidl::FDomainResourceDialect,
5062    > {
5063        StorageAdminProxyInterface::r#open_component_storage_by_id(self, id, object)
5064    }
5065
5066    /// Deletes the contents of the storage for this component. Preserves the
5067    /// component's subdirectory itself within the storage backing directory.
5068    /// The provided moniker is relative to the component that declares the
5069    /// storage capability.
5070    pub fn r#delete_component_storage(
5071        &self,
5072        mut relative_moniker: &str,
5073    ) -> fidl::client::QueryResponseFut<
5074        StorageAdminDeleteComponentStorageResult,
5075        fdomain_client::fidl::FDomainResourceDialect,
5076    > {
5077        StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
5078    }
5079
5080    /// Get the current status of the storage.
5081    pub fn r#get_status(
5082        &self,
5083    ) -> fidl::client::QueryResponseFut<
5084        StorageAdminGetStatusResult,
5085        fdomain_client::fidl::FDomainResourceDialect,
5086    > {
5087        StorageAdminProxyInterface::r#get_status(self)
5088    }
5089
5090    /// Deletes the contents of all the storage. Storage directories are
5091    /// retained so any components using storage will be able to continue using
5092    /// it to create new files and directories.
5093    ///
5094    /// Returns Error::INTERNAL only if no storage at all could be cleared.
5095    /// Returns successfully even if some errors happen during the deletion
5096    /// progress.
5097    pub fn r#delete_all_storage_contents(
5098        &self,
5099    ) -> fidl::client::QueryResponseFut<
5100        StorageAdminDeleteAllStorageContentsResult,
5101        fdomain_client::fidl::FDomainResourceDialect,
5102    > {
5103        StorageAdminProxyInterface::r#delete_all_storage_contents(self)
5104    }
5105}
5106
5107impl StorageAdminProxyInterface for StorageAdminProxy {
5108    type OpenStorageResponseFut = fidl::client::QueryResponseFut<
5109        StorageAdminOpenStorageResult,
5110        fdomain_client::fidl::FDomainResourceDialect,
5111    >;
5112    fn r#open_storage(
5113        &self,
5114        mut relative_moniker: &str,
5115        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5116    ) -> Self::OpenStorageResponseFut {
5117        fn _decode(
5118            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5119        ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
5120            let _response = fidl::client::decode_transaction_body::<
5121                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5122                fdomain_client::fidl::FDomainResourceDialect,
5123                0x6ceaa5904cfe4377,
5124            >(_buf?)?;
5125            Ok(_response.map(|x| x))
5126        }
5127        self.client
5128            .send_query_and_decode::<StorageAdminOpenStorageRequest, StorageAdminOpenStorageResult>(
5129                (relative_moniker, object),
5130                0x6ceaa5904cfe4377,
5131                fidl::encoding::DynamicFlags::empty(),
5132                _decode,
5133            )
5134    }
5135
5136    type ListStorageInRealmResponseFut = fidl::client::QueryResponseFut<
5137        StorageAdminListStorageInRealmResult,
5138        fdomain_client::fidl::FDomainResourceDialect,
5139    >;
5140    fn r#list_storage_in_realm(
5141        &self,
5142        mut relative_moniker: &str,
5143        mut iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
5144    ) -> Self::ListStorageInRealmResponseFut {
5145        fn _decode(
5146            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5147        ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
5148            let _response = fidl::client::decode_transaction_body::<
5149                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5150                fdomain_client::fidl::FDomainResourceDialect,
5151                0x764f6d1f083e8bfb,
5152            >(_buf?)?;
5153            Ok(_response.map(|x| x))
5154        }
5155        self.client.send_query_and_decode::<
5156            StorageAdminListStorageInRealmRequest,
5157            StorageAdminListStorageInRealmResult,
5158        >(
5159            (relative_moniker, iterator,),
5160            0x764f6d1f083e8bfb,
5161            fidl::encoding::DynamicFlags::empty(),
5162            _decode,
5163        )
5164    }
5165
5166    type OpenComponentStorageByIdResponseFut = fidl::client::QueryResponseFut<
5167        StorageAdminOpenComponentStorageByIdResult,
5168        fdomain_client::fidl::FDomainResourceDialect,
5169    >;
5170    fn r#open_component_storage_by_id(
5171        &self,
5172        mut id: &str,
5173        mut object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5174    ) -> Self::OpenComponentStorageByIdResponseFut {
5175        fn _decode(
5176            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5177        ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
5178            let _response = fidl::client::decode_transaction_body::<
5179                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5180                fdomain_client::fidl::FDomainResourceDialect,
5181                0x4802102cc55d5df1,
5182            >(_buf?)?;
5183            Ok(_response.map(|x| x))
5184        }
5185        self.client.send_query_and_decode::<
5186            StorageAdminOpenComponentStorageByIdRequest,
5187            StorageAdminOpenComponentStorageByIdResult,
5188        >(
5189            (id, object,),
5190            0x4802102cc55d5df1,
5191            fidl::encoding::DynamicFlags::empty(),
5192            _decode,
5193        )
5194    }
5195
5196    type DeleteComponentStorageResponseFut = fidl::client::QueryResponseFut<
5197        StorageAdminDeleteComponentStorageResult,
5198        fdomain_client::fidl::FDomainResourceDialect,
5199    >;
5200    fn r#delete_component_storage(
5201        &self,
5202        mut relative_moniker: &str,
5203    ) -> Self::DeleteComponentStorageResponseFut {
5204        fn _decode(
5205            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5206        ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
5207            let _response = fidl::client::decode_transaction_body::<
5208                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5209                fdomain_client::fidl::FDomainResourceDialect,
5210                0x1677c1cdfcdbf45a,
5211            >(_buf?)?;
5212            Ok(_response.map(|x| x))
5213        }
5214        self.client.send_query_and_decode::<
5215            StorageAdminDeleteComponentStorageRequest,
5216            StorageAdminDeleteComponentStorageResult,
5217        >(
5218            (relative_moniker,),
5219            0x1677c1cdfcdbf45a,
5220            fidl::encoding::DynamicFlags::empty(),
5221            _decode,
5222        )
5223    }
5224
5225    type GetStatusResponseFut = fidl::client::QueryResponseFut<
5226        StorageAdminGetStatusResult,
5227        fdomain_client::fidl::FDomainResourceDialect,
5228    >;
5229    fn r#get_status(&self) -> Self::GetStatusResponseFut {
5230        fn _decode(
5231            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5232        ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
5233            let _response = fidl::client::decode_transaction_body::<
5234                fidl::encoding::ResultType<StorageStatus, StatusError>,
5235                fdomain_client::fidl::FDomainResourceDialect,
5236                0x7729e325a6c526c8,
5237            >(_buf?)?;
5238            Ok(_response.map(|x| x))
5239        }
5240        self.client
5241            .send_query_and_decode::<fidl::encoding::EmptyPayload, StorageAdminGetStatusResult>(
5242                (),
5243                0x7729e325a6c526c8,
5244                fidl::encoding::DynamicFlags::empty(),
5245                _decode,
5246            )
5247    }
5248
5249    type DeleteAllStorageContentsResponseFut = fidl::client::QueryResponseFut<
5250        StorageAdminDeleteAllStorageContentsResult,
5251        fdomain_client::fidl::FDomainResourceDialect,
5252    >;
5253    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
5254        fn _decode(
5255            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5256        ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
5257            let _response = fidl::client::decode_transaction_body::<
5258                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
5259                fdomain_client::fidl::FDomainResourceDialect,
5260                0x2ee980b4b2d24adb,
5261            >(_buf?)?;
5262            Ok(_response.map(|x| x))
5263        }
5264        self.client.send_query_and_decode::<
5265            fidl::encoding::EmptyPayload,
5266            StorageAdminDeleteAllStorageContentsResult,
5267        >(
5268            (),
5269            0x2ee980b4b2d24adb,
5270            fidl::encoding::DynamicFlags::empty(),
5271            _decode,
5272        )
5273    }
5274}
5275
5276pub struct StorageAdminEventStream {
5277    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
5278}
5279
5280impl std::marker::Unpin for StorageAdminEventStream {}
5281
5282impl futures::stream::FusedStream for StorageAdminEventStream {
5283    fn is_terminated(&self) -> bool {
5284        self.event_receiver.is_terminated()
5285    }
5286}
5287
5288impl futures::Stream for StorageAdminEventStream {
5289    type Item = Result<StorageAdminEvent, fidl::Error>;
5290
5291    fn poll_next(
5292        mut self: std::pin::Pin<&mut Self>,
5293        cx: &mut std::task::Context<'_>,
5294    ) -> std::task::Poll<Option<Self::Item>> {
5295        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5296            &mut self.event_receiver,
5297            cx
5298        )?) {
5299            Some(buf) => std::task::Poll::Ready(Some(StorageAdminEvent::decode(buf))),
5300            None => std::task::Poll::Ready(None),
5301        }
5302    }
5303}
5304
5305#[derive(Debug)]
5306pub enum StorageAdminEvent {}
5307
5308impl StorageAdminEvent {
5309    /// Decodes a message buffer as a [`StorageAdminEvent`].
5310    fn decode(
5311        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5312    ) -> Result<StorageAdminEvent, fidl::Error> {
5313        let (bytes, _handles) = buf.split_mut();
5314        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5315        debug_assert_eq!(tx_header.tx_id, 0);
5316        match tx_header.ordinal {
5317            _ => Err(fidl::Error::UnknownOrdinal {
5318                ordinal: tx_header.ordinal,
5319                protocol_name:
5320                    <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5321            }),
5322        }
5323    }
5324}
5325
5326/// A Stream of incoming requests for fuchsia.component/StorageAdmin.
5327pub struct StorageAdminRequestStream {
5328    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5329    is_terminated: bool,
5330}
5331
5332impl std::marker::Unpin for StorageAdminRequestStream {}
5333
5334impl futures::stream::FusedStream for StorageAdminRequestStream {
5335    fn is_terminated(&self) -> bool {
5336        self.is_terminated
5337    }
5338}
5339
5340impl fdomain_client::fidl::RequestStream for StorageAdminRequestStream {
5341    type Protocol = StorageAdminMarker;
5342    type ControlHandle = StorageAdminControlHandle;
5343
5344    fn from_channel(channel: fdomain_client::Channel) -> Self {
5345        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5346    }
5347
5348    fn control_handle(&self) -> Self::ControlHandle {
5349        StorageAdminControlHandle { inner: self.inner.clone() }
5350    }
5351
5352    fn into_inner(
5353        self,
5354    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
5355    {
5356        (self.inner, self.is_terminated)
5357    }
5358
5359    fn from_inner(
5360        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5361        is_terminated: bool,
5362    ) -> Self {
5363        Self { inner, is_terminated }
5364    }
5365}
5366
5367impl futures::Stream for StorageAdminRequestStream {
5368    type Item = Result<StorageAdminRequest, fidl::Error>;
5369
5370    fn poll_next(
5371        mut self: std::pin::Pin<&mut Self>,
5372        cx: &mut std::task::Context<'_>,
5373    ) -> std::task::Poll<Option<Self::Item>> {
5374        let this = &mut *self;
5375        if this.inner.check_shutdown(cx) {
5376            this.is_terminated = true;
5377            return std::task::Poll::Ready(None);
5378        }
5379        if this.is_terminated {
5380            panic!("polled StorageAdminRequestStream after completion");
5381        }
5382        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
5383            |bytes, handles| {
5384                match this.inner.channel().read_etc(cx, bytes, handles) {
5385                    std::task::Poll::Ready(Ok(())) => {}
5386                    std::task::Poll::Pending => return std::task::Poll::Pending,
5387                    std::task::Poll::Ready(Err(None)) => {
5388                        this.is_terminated = true;
5389                        return std::task::Poll::Ready(None);
5390                    }
5391                    std::task::Poll::Ready(Err(Some(e))) => {
5392                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5393                            e.into(),
5394                        ))));
5395                    }
5396                }
5397
5398                // A message has been received from the channel
5399                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5400
5401                std::task::Poll::Ready(Some(match header.ordinal {
5402                    0x6ceaa5904cfe4377 => {
5403                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5404                        let mut req = fidl::new_empty!(
5405                            StorageAdminOpenStorageRequest,
5406                            fdomain_client::fidl::FDomainResourceDialect
5407                        );
5408                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminOpenStorageRequest>(&header, _body_bytes, handles, &mut req)?;
5409                        let control_handle =
5410                            StorageAdminControlHandle { inner: this.inner.clone() };
5411                        Ok(StorageAdminRequest::OpenStorage {
5412                            relative_moniker: req.relative_moniker,
5413                            object: req.object,
5414
5415                            responder: StorageAdminOpenStorageResponder {
5416                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5417                                tx_id: header.tx_id,
5418                            },
5419                        })
5420                    }
5421                    0x764f6d1f083e8bfb => {
5422                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5423                        let mut req = fidl::new_empty!(
5424                            StorageAdminListStorageInRealmRequest,
5425                            fdomain_client::fidl::FDomainResourceDialect
5426                        );
5427                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminListStorageInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
5428                        let control_handle =
5429                            StorageAdminControlHandle { inner: this.inner.clone() };
5430                        Ok(StorageAdminRequest::ListStorageInRealm {
5431                            relative_moniker: req.relative_moniker,
5432                            iterator: req.iterator,
5433
5434                            responder: StorageAdminListStorageInRealmResponder {
5435                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5436                                tx_id: header.tx_id,
5437                            },
5438                        })
5439                    }
5440                    0x4802102cc55d5df1 => {
5441                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5442                        let mut req = fidl::new_empty!(
5443                            StorageAdminOpenComponentStorageByIdRequest,
5444                            fdomain_client::fidl::FDomainResourceDialect
5445                        );
5446                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminOpenComponentStorageByIdRequest>(&header, _body_bytes, handles, &mut req)?;
5447                        let control_handle =
5448                            StorageAdminControlHandle { inner: this.inner.clone() };
5449                        Ok(StorageAdminRequest::OpenComponentStorageById {
5450                            id: req.id,
5451                            object: req.object,
5452
5453                            responder: StorageAdminOpenComponentStorageByIdResponder {
5454                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5455                                tx_id: header.tx_id,
5456                            },
5457                        })
5458                    }
5459                    0x1677c1cdfcdbf45a => {
5460                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5461                        let mut req = fidl::new_empty!(
5462                            StorageAdminDeleteComponentStorageRequest,
5463                            fdomain_client::fidl::FDomainResourceDialect
5464                        );
5465                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<StorageAdminDeleteComponentStorageRequest>(&header, _body_bytes, handles, &mut req)?;
5466                        let control_handle =
5467                            StorageAdminControlHandle { inner: this.inner.clone() };
5468                        Ok(StorageAdminRequest::DeleteComponentStorage {
5469                            relative_moniker: req.relative_moniker,
5470
5471                            responder: StorageAdminDeleteComponentStorageResponder {
5472                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5473                                tx_id: header.tx_id,
5474                            },
5475                        })
5476                    }
5477                    0x7729e325a6c526c8 => {
5478                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5479                        let mut req = fidl::new_empty!(
5480                            fidl::encoding::EmptyPayload,
5481                            fdomain_client::fidl::FDomainResourceDialect
5482                        );
5483                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5484                        let control_handle =
5485                            StorageAdminControlHandle { inner: this.inner.clone() };
5486                        Ok(StorageAdminRequest::GetStatus {
5487                            responder: StorageAdminGetStatusResponder {
5488                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5489                                tx_id: header.tx_id,
5490                            },
5491                        })
5492                    }
5493                    0x2ee980b4b2d24adb => {
5494                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5495                        let mut req = fidl::new_empty!(
5496                            fidl::encoding::EmptyPayload,
5497                            fdomain_client::fidl::FDomainResourceDialect
5498                        );
5499                        fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5500                        let control_handle =
5501                            StorageAdminControlHandle { inner: this.inner.clone() };
5502                        Ok(StorageAdminRequest::DeleteAllStorageContents {
5503                            responder: StorageAdminDeleteAllStorageContentsResponder {
5504                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5505                                tx_id: header.tx_id,
5506                            },
5507                        })
5508                    }
5509                    _ => Err(fidl::Error::UnknownOrdinal {
5510                        ordinal: header.ordinal,
5511                        protocol_name:
5512                            <StorageAdminMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
5513                    }),
5514                }))
5515            },
5516        )
5517    }
5518}
5519
5520#[derive(Debug)]
5521pub enum StorageAdminRequest {
5522    /// Opens the isolated directory for the given component. The provided
5523    /// moniker is relative to the component that declares the storage
5524    /// capability. Creates the backing sub-directory for this storage if it
5525    /// hasn't yet been created.
5526    OpenStorage {
5527        relative_moniker: String,
5528        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5529        responder: StorageAdminOpenStorageResponder,
5530    },
5531    /// Lists the descendant components under the specified realm that use the
5532    /// storage capability. The provided moniker is relative to the component
5533    /// that declares the storage capability.
5534    ///
5535    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
5536    /// if |relative_moniker| is malformed.
5537    ListStorageInRealm {
5538        relative_moniker: String,
5539        iterator: fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
5540        responder: StorageAdminListStorageInRealmResponder,
5541    },
5542    /// Opens the isolated directory for the given storage ID. Creates the
5543    /// backing sub-directory for this storage if it hasn't yet been created.
5544    OpenComponentStorageById {
5545        id: String,
5546        object: fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5547        responder: StorageAdminOpenComponentStorageByIdResponder,
5548    },
5549    /// Deletes the contents of the storage for this component. Preserves the
5550    /// component's subdirectory itself within the storage backing directory.
5551    /// The provided moniker is relative to the component that declares the
5552    /// storage capability.
5553    DeleteComponentStorage {
5554        relative_moniker: String,
5555        responder: StorageAdminDeleteComponentStorageResponder,
5556    },
5557    /// Get the current status of the storage.
5558    GetStatus { responder: StorageAdminGetStatusResponder },
5559    /// Deletes the contents of all the storage. Storage directories are
5560    /// retained so any components using storage will be able to continue using
5561    /// it to create new files and directories.
5562    ///
5563    /// Returns Error::INTERNAL only if no storage at all could be cleared.
5564    /// Returns successfully even if some errors happen during the deletion
5565    /// progress.
5566    DeleteAllStorageContents { responder: StorageAdminDeleteAllStorageContentsResponder },
5567}
5568
5569impl StorageAdminRequest {
5570    #[allow(irrefutable_let_patterns)]
5571    pub fn into_open_storage(
5572        self,
5573    ) -> Option<(
5574        String,
5575        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5576        StorageAdminOpenStorageResponder,
5577    )> {
5578        if let StorageAdminRequest::OpenStorage { relative_moniker, object, responder } = self {
5579            Some((relative_moniker, object, responder))
5580        } else {
5581            None
5582        }
5583    }
5584
5585    #[allow(irrefutable_let_patterns)]
5586    pub fn into_list_storage_in_realm(
5587        self,
5588    ) -> Option<(
5589        String,
5590        fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
5591        StorageAdminListStorageInRealmResponder,
5592    )> {
5593        if let StorageAdminRequest::ListStorageInRealm { relative_moniker, iterator, responder } =
5594            self
5595        {
5596            Some((relative_moniker, iterator, responder))
5597        } else {
5598            None
5599        }
5600    }
5601
5602    #[allow(irrefutable_let_patterns)]
5603    pub fn into_open_component_storage_by_id(
5604        self,
5605    ) -> Option<(
5606        String,
5607        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
5608        StorageAdminOpenComponentStorageByIdResponder,
5609    )> {
5610        if let StorageAdminRequest::OpenComponentStorageById { id, object, responder } = self {
5611            Some((id, object, responder))
5612        } else {
5613            None
5614        }
5615    }
5616
5617    #[allow(irrefutable_let_patterns)]
5618    pub fn into_delete_component_storage(
5619        self,
5620    ) -> Option<(String, StorageAdminDeleteComponentStorageResponder)> {
5621        if let StorageAdminRequest::DeleteComponentStorage { relative_moniker, responder } = self {
5622            Some((relative_moniker, responder))
5623        } else {
5624            None
5625        }
5626    }
5627
5628    #[allow(irrefutable_let_patterns)]
5629    pub fn into_get_status(self) -> Option<(StorageAdminGetStatusResponder)> {
5630        if let StorageAdminRequest::GetStatus { responder } = self {
5631            Some((responder))
5632        } else {
5633            None
5634        }
5635    }
5636
5637    #[allow(irrefutable_let_patterns)]
5638    pub fn into_delete_all_storage_contents(
5639        self,
5640    ) -> Option<(StorageAdminDeleteAllStorageContentsResponder)> {
5641        if let StorageAdminRequest::DeleteAllStorageContents { responder } = self {
5642            Some((responder))
5643        } else {
5644            None
5645        }
5646    }
5647
5648    /// Name of the method defined in FIDL
5649    pub fn method_name(&self) -> &'static str {
5650        match *self {
5651            StorageAdminRequest::OpenStorage { .. } => "open_storage",
5652            StorageAdminRequest::ListStorageInRealm { .. } => "list_storage_in_realm",
5653            StorageAdminRequest::OpenComponentStorageById { .. } => "open_component_storage_by_id",
5654            StorageAdminRequest::DeleteComponentStorage { .. } => "delete_component_storage",
5655            StorageAdminRequest::GetStatus { .. } => "get_status",
5656            StorageAdminRequest::DeleteAllStorageContents { .. } => "delete_all_storage_contents",
5657        }
5658    }
5659}
5660
5661#[derive(Debug, Clone)]
5662pub struct StorageAdminControlHandle {
5663    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
5664}
5665
5666impl fdomain_client::fidl::ControlHandle for StorageAdminControlHandle {
5667    fn shutdown(&self) {
5668        self.inner.shutdown()
5669    }
5670
5671    fn is_closed(&self) -> bool {
5672        self.inner.channel().is_closed()
5673    }
5674    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
5675        self.inner.channel().on_closed()
5676    }
5677}
5678
5679impl StorageAdminControlHandle {}
5680
5681#[must_use = "FIDL methods require a response to be sent"]
5682#[derive(Debug)]
5683pub struct StorageAdminOpenStorageResponder {
5684    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
5685    tx_id: u32,
5686}
5687
5688/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
5689/// if the responder is dropped without sending a response, so that the client
5690/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5691impl std::ops::Drop for StorageAdminOpenStorageResponder {
5692    fn drop(&mut self) {
5693        self.control_handle.shutdown();
5694        // Safety: drops once, never accessed again
5695        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5696    }
5697}
5698
5699impl fdomain_client::fidl::Responder for StorageAdminOpenStorageResponder {
5700    type ControlHandle = StorageAdminControlHandle;
5701
5702    fn control_handle(&self) -> &StorageAdminControlHandle {
5703        &self.control_handle
5704    }
5705
5706    fn drop_without_shutdown(mut self) {
5707        // Safety: drops once, never accessed again due to mem::forget
5708        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5709        // Prevent Drop from running (which would shut down the channel)
5710        std::mem::forget(self);
5711    }
5712}
5713
5714impl StorageAdminOpenStorageResponder {
5715    /// Sends a response to the FIDL transaction.
5716    ///
5717    /// Sets the channel to shutdown if an error occurs.
5718    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5719        let _result = self.send_raw(result);
5720        if _result.is_err() {
5721            self.control_handle.shutdown();
5722        }
5723        self.drop_without_shutdown();
5724        _result
5725    }
5726
5727    /// Similar to "send" but does not shutdown the channel if an error occurs.
5728    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5729        let _result = self.send_raw(result);
5730        self.drop_without_shutdown();
5731        _result
5732    }
5733
5734    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5735        self.control_handle
5736            .inner
5737            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5738                result,
5739                self.tx_id,
5740                0x6ceaa5904cfe4377,
5741                fidl::encoding::DynamicFlags::empty(),
5742            )
5743    }
5744}
5745
5746#[must_use = "FIDL methods require a response to be sent"]
5747#[derive(Debug)]
5748pub struct StorageAdminListStorageInRealmResponder {
5749    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
5750    tx_id: u32,
5751}
5752
5753/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
5754/// if the responder is dropped without sending a response, so that the client
5755/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5756impl std::ops::Drop for StorageAdminListStorageInRealmResponder {
5757    fn drop(&mut self) {
5758        self.control_handle.shutdown();
5759        // Safety: drops once, never accessed again
5760        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5761    }
5762}
5763
5764impl fdomain_client::fidl::Responder for StorageAdminListStorageInRealmResponder {
5765    type ControlHandle = StorageAdminControlHandle;
5766
5767    fn control_handle(&self) -> &StorageAdminControlHandle {
5768        &self.control_handle
5769    }
5770
5771    fn drop_without_shutdown(mut self) {
5772        // Safety: drops once, never accessed again due to mem::forget
5773        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5774        // Prevent Drop from running (which would shut down the channel)
5775        std::mem::forget(self);
5776    }
5777}
5778
5779impl StorageAdminListStorageInRealmResponder {
5780    /// Sends a response to the FIDL transaction.
5781    ///
5782    /// Sets the channel to shutdown if an error occurs.
5783    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5784        let _result = self.send_raw(result);
5785        if _result.is_err() {
5786            self.control_handle.shutdown();
5787        }
5788        self.drop_without_shutdown();
5789        _result
5790    }
5791
5792    /// Similar to "send" but does not shutdown the channel if an error occurs.
5793    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5794        let _result = self.send_raw(result);
5795        self.drop_without_shutdown();
5796        _result
5797    }
5798
5799    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5800        self.control_handle
5801            .inner
5802            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5803                result,
5804                self.tx_id,
5805                0x764f6d1f083e8bfb,
5806                fidl::encoding::DynamicFlags::empty(),
5807            )
5808    }
5809}
5810
5811#[must_use = "FIDL methods require a response to be sent"]
5812#[derive(Debug)]
5813pub struct StorageAdminOpenComponentStorageByIdResponder {
5814    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
5815    tx_id: u32,
5816}
5817
5818/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
5819/// if the responder is dropped without sending a response, so that the client
5820/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5821impl std::ops::Drop for StorageAdminOpenComponentStorageByIdResponder {
5822    fn drop(&mut self) {
5823        self.control_handle.shutdown();
5824        // Safety: drops once, never accessed again
5825        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5826    }
5827}
5828
5829impl fdomain_client::fidl::Responder for StorageAdminOpenComponentStorageByIdResponder {
5830    type ControlHandle = StorageAdminControlHandle;
5831
5832    fn control_handle(&self) -> &StorageAdminControlHandle {
5833        &self.control_handle
5834    }
5835
5836    fn drop_without_shutdown(mut self) {
5837        // Safety: drops once, never accessed again due to mem::forget
5838        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5839        // Prevent Drop from running (which would shut down the channel)
5840        std::mem::forget(self);
5841    }
5842}
5843
5844impl StorageAdminOpenComponentStorageByIdResponder {
5845    /// Sends a response to the FIDL transaction.
5846    ///
5847    /// Sets the channel to shutdown if an error occurs.
5848    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5849        let _result = self.send_raw(result);
5850        if _result.is_err() {
5851            self.control_handle.shutdown();
5852        }
5853        self.drop_without_shutdown();
5854        _result
5855    }
5856
5857    /// Similar to "send" but does not shutdown the channel if an error occurs.
5858    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5859        let _result = self.send_raw(result);
5860        self.drop_without_shutdown();
5861        _result
5862    }
5863
5864    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5865        self.control_handle
5866            .inner
5867            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5868                result,
5869                self.tx_id,
5870                0x4802102cc55d5df1,
5871                fidl::encoding::DynamicFlags::empty(),
5872            )
5873    }
5874}
5875
5876#[must_use = "FIDL methods require a response to be sent"]
5877#[derive(Debug)]
5878pub struct StorageAdminDeleteComponentStorageResponder {
5879    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
5880    tx_id: u32,
5881}
5882
5883/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
5884/// if the responder is dropped without sending a response, so that the client
5885/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5886impl std::ops::Drop for StorageAdminDeleteComponentStorageResponder {
5887    fn drop(&mut self) {
5888        self.control_handle.shutdown();
5889        // Safety: drops once, never accessed again
5890        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5891    }
5892}
5893
5894impl fdomain_client::fidl::Responder for StorageAdminDeleteComponentStorageResponder {
5895    type ControlHandle = StorageAdminControlHandle;
5896
5897    fn control_handle(&self) -> &StorageAdminControlHandle {
5898        &self.control_handle
5899    }
5900
5901    fn drop_without_shutdown(mut self) {
5902        // Safety: drops once, never accessed again due to mem::forget
5903        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5904        // Prevent Drop from running (which would shut down the channel)
5905        std::mem::forget(self);
5906    }
5907}
5908
5909impl StorageAdminDeleteComponentStorageResponder {
5910    /// Sends a response to the FIDL transaction.
5911    ///
5912    /// Sets the channel to shutdown if an error occurs.
5913    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5914        let _result = self.send_raw(result);
5915        if _result.is_err() {
5916            self.control_handle.shutdown();
5917        }
5918        self.drop_without_shutdown();
5919        _result
5920    }
5921
5922    /// Similar to "send" but does not shutdown the channel if an error occurs.
5923    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5924        let _result = self.send_raw(result);
5925        self.drop_without_shutdown();
5926        _result
5927    }
5928
5929    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
5930        self.control_handle
5931            .inner
5932            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
5933                result,
5934                self.tx_id,
5935                0x1677c1cdfcdbf45a,
5936                fidl::encoding::DynamicFlags::empty(),
5937            )
5938    }
5939}
5940
5941#[must_use = "FIDL methods require a response to be sent"]
5942#[derive(Debug)]
5943pub struct StorageAdminGetStatusResponder {
5944    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
5945    tx_id: u32,
5946}
5947
5948/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
5949/// if the responder is dropped without sending a response, so that the client
5950/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5951impl std::ops::Drop for StorageAdminGetStatusResponder {
5952    fn drop(&mut self) {
5953        self.control_handle.shutdown();
5954        // Safety: drops once, never accessed again
5955        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5956    }
5957}
5958
5959impl fdomain_client::fidl::Responder for StorageAdminGetStatusResponder {
5960    type ControlHandle = StorageAdminControlHandle;
5961
5962    fn control_handle(&self) -> &StorageAdminControlHandle {
5963        &self.control_handle
5964    }
5965
5966    fn drop_without_shutdown(mut self) {
5967        // Safety: drops once, never accessed again due to mem::forget
5968        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5969        // Prevent Drop from running (which would shut down the channel)
5970        std::mem::forget(self);
5971    }
5972}
5973
5974impl StorageAdminGetStatusResponder {
5975    /// Sends a response to the FIDL transaction.
5976    ///
5977    /// Sets the channel to shutdown if an error occurs.
5978    pub fn send(self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
5979        let _result = self.send_raw(result);
5980        if _result.is_err() {
5981            self.control_handle.shutdown();
5982        }
5983        self.drop_without_shutdown();
5984        _result
5985    }
5986
5987    /// Similar to "send" but does not shutdown the channel if an error occurs.
5988    pub fn send_no_shutdown_on_err(
5989        self,
5990        mut result: Result<&StorageStatus, StatusError>,
5991    ) -> Result<(), fidl::Error> {
5992        let _result = self.send_raw(result);
5993        self.drop_without_shutdown();
5994        _result
5995    }
5996
5997    fn send_raw(&self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
5998        self.control_handle.inner.send::<fidl::encoding::ResultType<StorageStatus, StatusError>>(
5999            result,
6000            self.tx_id,
6001            0x7729e325a6c526c8,
6002            fidl::encoding::DynamicFlags::empty(),
6003        )
6004    }
6005}
6006
6007#[must_use = "FIDL methods require a response to be sent"]
6008#[derive(Debug)]
6009pub struct StorageAdminDeleteAllStorageContentsResponder {
6010    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
6011    tx_id: u32,
6012}
6013
6014/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
6015/// if the responder is dropped without sending a response, so that the client
6016/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6017impl std::ops::Drop for StorageAdminDeleteAllStorageContentsResponder {
6018    fn drop(&mut self) {
6019        self.control_handle.shutdown();
6020        // Safety: drops once, never accessed again
6021        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6022    }
6023}
6024
6025impl fdomain_client::fidl::Responder for StorageAdminDeleteAllStorageContentsResponder {
6026    type ControlHandle = StorageAdminControlHandle;
6027
6028    fn control_handle(&self) -> &StorageAdminControlHandle {
6029        &self.control_handle
6030    }
6031
6032    fn drop_without_shutdown(mut self) {
6033        // Safety: drops once, never accessed again due to mem::forget
6034        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6035        // Prevent Drop from running (which would shut down the channel)
6036        std::mem::forget(self);
6037    }
6038}
6039
6040impl StorageAdminDeleteAllStorageContentsResponder {
6041    /// Sends a response to the FIDL transaction.
6042    ///
6043    /// Sets the channel to shutdown if an error occurs.
6044    pub fn send(self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
6045        let _result = self.send_raw(result);
6046        if _result.is_err() {
6047            self.control_handle.shutdown();
6048        }
6049        self.drop_without_shutdown();
6050        _result
6051    }
6052
6053    /// Similar to "send" but does not shutdown the channel if an error occurs.
6054    pub fn send_no_shutdown_on_err(
6055        self,
6056        mut result: Result<(), DeletionError>,
6057    ) -> Result<(), fidl::Error> {
6058        let _result = self.send_raw(result);
6059        self.drop_without_shutdown();
6060        _result
6061    }
6062
6063    fn send_raw(&self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
6064        self.control_handle.inner.send::<fidl::encoding::ResultType<
6065            fidl::encoding::EmptyStruct,
6066            DeletionError,
6067        >>(
6068            result,
6069            self.tx_id,
6070            0x2ee980b4b2d24adb,
6071            fidl::encoding::DynamicFlags::empty(),
6072        )
6073    }
6074}
6075
6076#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6077pub struct StorageIteratorMarker;
6078
6079impl fdomain_client::fidl::ProtocolMarker for StorageIteratorMarker {
6080    type Proxy = StorageIteratorProxy;
6081    type RequestStream = StorageIteratorRequestStream;
6082
6083    const DEBUG_NAME: &'static str = "(anonymous) StorageIterator";
6084}
6085
6086pub trait StorageIteratorProxyInterface: Send + Sync {
6087    type NextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
6088    fn r#next(&self) -> Self::NextResponseFut;
6089}
6090
6091#[derive(Debug, Clone)]
6092pub struct StorageIteratorProxy {
6093    client: fidl::client::Client<fdomain_client::fidl::FDomainResourceDialect>,
6094}
6095
6096impl fdomain_client::fidl::Proxy for StorageIteratorProxy {
6097    type Protocol = StorageIteratorMarker;
6098
6099    fn from_channel(inner: fdomain_client::Channel) -> Self {
6100        Self::new(inner)
6101    }
6102
6103    fn into_channel(self) -> Result<fdomain_client::Channel, Self> {
6104        self.client.into_channel().map_err(|client| Self { client })
6105    }
6106
6107    fn as_channel(&self) -> &fdomain_client::Channel {
6108        self.client.as_channel()
6109    }
6110}
6111
6112impl StorageIteratorProxy {
6113    /// Create a new Proxy for fuchsia.component/StorageIterator.
6114    pub fn new(channel: fdomain_client::Channel) -> Self {
6115        let protocol_name =
6116            <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME;
6117        Self { client: fidl::client::Client::new(channel, protocol_name) }
6118    }
6119
6120    /// Get a Stream of events from the remote end of the protocol.
6121    ///
6122    /// # Panics
6123    ///
6124    /// Panics if the event stream was already taken.
6125    pub fn take_event_stream(&self) -> StorageIteratorEventStream {
6126        StorageIteratorEventStream { event_receiver: self.client.take_event_receiver() }
6127    }
6128
6129    /// Retrieve the next set of components using the storage capability. The
6130    /// returned monikers are relative to the component that declares the
6131    /// storage capability. Returns an empty vector after all components have
6132    /// been returned.
6133    pub fn r#next(
6134        &self,
6135    ) -> fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>
6136    {
6137        StorageIteratorProxyInterface::r#next(self)
6138    }
6139}
6140
6141impl StorageIteratorProxyInterface for StorageIteratorProxy {
6142    type NextResponseFut =
6143        fidl::client::QueryResponseFut<Vec<String>, fdomain_client::fidl::FDomainResourceDialect>;
6144    fn r#next(&self) -> Self::NextResponseFut {
6145        fn _decode(
6146            mut _buf: Result<<fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6147        ) -> Result<Vec<String>, fidl::Error> {
6148            let _response = fidl::client::decode_transaction_body::<
6149                StorageIteratorNextResponse,
6150                fdomain_client::fidl::FDomainResourceDialect,
6151                0x7a6b21f15fd01b72,
6152            >(_buf?)?;
6153            Ok(_response.relative_monikers)
6154        }
6155        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
6156            (),
6157            0x7a6b21f15fd01b72,
6158            fidl::encoding::DynamicFlags::empty(),
6159            _decode,
6160        )
6161    }
6162}
6163
6164pub struct StorageIteratorEventStream {
6165    event_receiver: fidl::client::EventReceiver<fdomain_client::fidl::FDomainResourceDialect>,
6166}
6167
6168impl std::marker::Unpin for StorageIteratorEventStream {}
6169
6170impl futures::stream::FusedStream for StorageIteratorEventStream {
6171    fn is_terminated(&self) -> bool {
6172        self.event_receiver.is_terminated()
6173    }
6174}
6175
6176impl futures::Stream for StorageIteratorEventStream {
6177    type Item = Result<StorageIteratorEvent, fidl::Error>;
6178
6179    fn poll_next(
6180        mut self: std::pin::Pin<&mut Self>,
6181        cx: &mut std::task::Context<'_>,
6182    ) -> std::task::Poll<Option<Self::Item>> {
6183        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6184            &mut self.event_receiver,
6185            cx
6186        )?) {
6187            Some(buf) => std::task::Poll::Ready(Some(StorageIteratorEvent::decode(buf))),
6188            None => std::task::Poll::Ready(None),
6189        }
6190    }
6191}
6192
6193#[derive(Debug)]
6194pub enum StorageIteratorEvent {}
6195
6196impl StorageIteratorEvent {
6197    /// Decodes a message buffer as a [`StorageIteratorEvent`].
6198    fn decode(
6199        mut buf: <fdomain_client::fidl::FDomainResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6200    ) -> Result<StorageIteratorEvent, fidl::Error> {
6201        let (bytes, _handles) = buf.split_mut();
6202        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6203        debug_assert_eq!(tx_header.tx_id, 0);
6204        match tx_header.ordinal {
6205            _ => Err(fidl::Error::UnknownOrdinal {
6206                ordinal: tx_header.ordinal,
6207                protocol_name:
6208                    <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6209            }),
6210        }
6211    }
6212}
6213
6214/// A Stream of incoming requests for fuchsia.component/StorageIterator.
6215pub struct StorageIteratorRequestStream {
6216    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6217    is_terminated: bool,
6218}
6219
6220impl std::marker::Unpin for StorageIteratorRequestStream {}
6221
6222impl futures::stream::FusedStream for StorageIteratorRequestStream {
6223    fn is_terminated(&self) -> bool {
6224        self.is_terminated
6225    }
6226}
6227
6228impl fdomain_client::fidl::RequestStream for StorageIteratorRequestStream {
6229    type Protocol = StorageIteratorMarker;
6230    type ControlHandle = StorageIteratorControlHandle;
6231
6232    fn from_channel(channel: fdomain_client::Channel) -> Self {
6233        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6234    }
6235
6236    fn control_handle(&self) -> Self::ControlHandle {
6237        StorageIteratorControlHandle { inner: self.inner.clone() }
6238    }
6239
6240    fn into_inner(
6241        self,
6242    ) -> (::std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>, bool)
6243    {
6244        (self.inner, self.is_terminated)
6245    }
6246
6247    fn from_inner(
6248        inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6249        is_terminated: bool,
6250    ) -> Self {
6251        Self { inner, is_terminated }
6252    }
6253}
6254
6255impl futures::Stream for StorageIteratorRequestStream {
6256    type Item = Result<StorageIteratorRequest, fidl::Error>;
6257
6258    fn poll_next(
6259        mut self: std::pin::Pin<&mut Self>,
6260        cx: &mut std::task::Context<'_>,
6261    ) -> std::task::Poll<Option<Self::Item>> {
6262        let this = &mut *self;
6263        if this.inner.check_shutdown(cx) {
6264            this.is_terminated = true;
6265            return std::task::Poll::Ready(None);
6266        }
6267        if this.is_terminated {
6268            panic!("polled StorageIteratorRequestStream after completion");
6269        }
6270        fidl::encoding::with_tls_decode_buf::<_, fdomain_client::fidl::FDomainResourceDialect>(
6271            |bytes, handles| {
6272                match this.inner.channel().read_etc(cx, bytes, handles) {
6273                    std::task::Poll::Ready(Ok(())) => {}
6274                    std::task::Poll::Pending => return std::task::Poll::Pending,
6275                    std::task::Poll::Ready(Err(None)) => {
6276                        this.is_terminated = true;
6277                        return std::task::Poll::Ready(None);
6278                    }
6279                    std::task::Poll::Ready(Err(Some(e))) => {
6280                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6281                            e.into(),
6282                        ))));
6283                    }
6284                }
6285
6286                // A message has been received from the channel
6287                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6288
6289                std::task::Poll::Ready(Some(match header.ordinal {
6290                0x7a6b21f15fd01b72 => {
6291                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6292                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fdomain_client::fidl::FDomainResourceDialect);
6293                    fidl::encoding::Decoder::<fdomain_client::fidl::FDomainResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6294                    let control_handle = StorageIteratorControlHandle {
6295                        inner: this.inner.clone(),
6296                    };
6297                    Ok(StorageIteratorRequest::Next {
6298                        responder: StorageIteratorNextResponder {
6299                            control_handle: std::mem::ManuallyDrop::new(control_handle),
6300                            tx_id: header.tx_id,
6301                        },
6302                    })
6303                }
6304                _ => Err(fidl::Error::UnknownOrdinal {
6305                    ordinal: header.ordinal,
6306                    protocol_name: <StorageIteratorMarker as fdomain_client::fidl::ProtocolMarker>::DEBUG_NAME,
6307                }),
6308            }))
6309            },
6310        )
6311    }
6312}
6313
6314/// An iterator protocol for returning a set of components using a storage
6315/// capability. See |StorageAdmin.ListStorageInRealm| for more information.
6316#[derive(Debug)]
6317pub enum StorageIteratorRequest {
6318    /// Retrieve the next set of components using the storage capability. The
6319    /// returned monikers are relative to the component that declares the
6320    /// storage capability. Returns an empty vector after all components have
6321    /// been returned.
6322    Next { responder: StorageIteratorNextResponder },
6323}
6324
6325impl StorageIteratorRequest {
6326    #[allow(irrefutable_let_patterns)]
6327    pub fn into_next(self) -> Option<(StorageIteratorNextResponder)> {
6328        if let StorageIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
6329    }
6330
6331    /// Name of the method defined in FIDL
6332    pub fn method_name(&self) -> &'static str {
6333        match *self {
6334            StorageIteratorRequest::Next { .. } => "next",
6335        }
6336    }
6337}
6338
6339#[derive(Debug, Clone)]
6340pub struct StorageIteratorControlHandle {
6341    inner: std::sync::Arc<fidl::ServeInner<fdomain_client::fidl::FDomainResourceDialect>>,
6342}
6343
6344impl fdomain_client::fidl::ControlHandle for StorageIteratorControlHandle {
6345    fn shutdown(&self) {
6346        self.inner.shutdown()
6347    }
6348
6349    fn is_closed(&self) -> bool {
6350        self.inner.channel().is_closed()
6351    }
6352    fn on_closed(&self) -> fdomain_client::OnFDomainSignals {
6353        self.inner.channel().on_closed()
6354    }
6355}
6356
6357impl StorageIteratorControlHandle {}
6358
6359#[must_use = "FIDL methods require a response to be sent"]
6360#[derive(Debug)]
6361pub struct StorageIteratorNextResponder {
6362    control_handle: std::mem::ManuallyDrop<StorageIteratorControlHandle>,
6363    tx_id: u32,
6364}
6365
6366/// Set the the channel to be shutdown (see [`StorageIteratorControlHandle::shutdown`])
6367/// if the responder is dropped without sending a response, so that the client
6368/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6369impl std::ops::Drop for StorageIteratorNextResponder {
6370    fn drop(&mut self) {
6371        self.control_handle.shutdown();
6372        // Safety: drops once, never accessed again
6373        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6374    }
6375}
6376
6377impl fdomain_client::fidl::Responder for StorageIteratorNextResponder {
6378    type ControlHandle = StorageIteratorControlHandle;
6379
6380    fn control_handle(&self) -> &StorageIteratorControlHandle {
6381        &self.control_handle
6382    }
6383
6384    fn drop_without_shutdown(mut self) {
6385        // Safety: drops once, never accessed again due to mem::forget
6386        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6387        // Prevent Drop from running (which would shut down the channel)
6388        std::mem::forget(self);
6389    }
6390}
6391
6392impl StorageIteratorNextResponder {
6393    /// Sends a response to the FIDL transaction.
6394    ///
6395    /// Sets the channel to shutdown if an error occurs.
6396    pub fn send(self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
6397        let _result = self.send_raw(relative_monikers);
6398        if _result.is_err() {
6399            self.control_handle.shutdown();
6400        }
6401        self.drop_without_shutdown();
6402        _result
6403    }
6404
6405    /// Similar to "send" but does not shutdown the channel if an error occurs.
6406    pub fn send_no_shutdown_on_err(
6407        self,
6408        mut relative_monikers: &[String],
6409    ) -> Result<(), fidl::Error> {
6410        let _result = self.send_raw(relative_monikers);
6411        self.drop_without_shutdown();
6412        _result
6413    }
6414
6415    fn send_raw(&self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
6416        self.control_handle.inner.send::<StorageIteratorNextResponse>(
6417            (relative_monikers,),
6418            self.tx_id,
6419            0x7a6b21f15fd01b72,
6420            fidl::encoding::DynamicFlags::empty(),
6421        )
6422    }
6423}
6424
6425mod internal {
6426    use super::*;
6427
6428    impl fidl::encoding::ResourceTypeMarker for ControllerStartRequest {
6429        type Borrowed<'a> = &'a mut Self;
6430        fn take_or_borrow<'a>(
6431            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6432        ) -> Self::Borrowed<'a> {
6433            value
6434        }
6435    }
6436
6437    unsafe impl fidl::encoding::TypeMarker for ControllerStartRequest {
6438        type Owned = Self;
6439
6440        #[inline(always)]
6441        fn inline_align(_context: fidl::encoding::Context) -> usize {
6442            8
6443        }
6444
6445        #[inline(always)]
6446        fn inline_size(_context: fidl::encoding::Context) -> usize {
6447            24
6448        }
6449    }
6450
6451    unsafe impl
6452        fidl::encoding::Encode<ControllerStartRequest, fdomain_client::fidl::FDomainResourceDialect>
6453        for &mut ControllerStartRequest
6454    {
6455        #[inline]
6456        unsafe fn encode(
6457            self,
6458            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6459            offset: usize,
6460            _depth: fidl::encoding::Depth,
6461        ) -> fidl::Result<()> {
6462            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
6463            // Delegate to tuple encoding.
6464            fidl::encoding::Encode::<
6465                ControllerStartRequest,
6466                fdomain_client::fidl::FDomainResourceDialect,
6467            >::encode(
6468                (
6469                    <StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6470                        &mut self.args,
6471                    ),
6472                    <fidl::encoding::Endpoint<
6473                        fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
6474                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6475                        &mut self.execution_controller,
6476                    ),
6477                ),
6478                encoder,
6479                offset,
6480                _depth,
6481            )
6482        }
6483    }
6484    unsafe impl<
6485        T0: fidl::encoding::Encode<StartChildArgs, fdomain_client::fidl::FDomainResourceDialect>,
6486        T1: fidl::encoding::Encode<
6487                fidl::encoding::Endpoint<
6488                    fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
6489                >,
6490                fdomain_client::fidl::FDomainResourceDialect,
6491            >,
6492    >
6493        fidl::encoding::Encode<ControllerStartRequest, fdomain_client::fidl::FDomainResourceDialect>
6494        for (T0, T1)
6495    {
6496        #[inline]
6497        unsafe fn encode(
6498            self,
6499            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6500            offset: usize,
6501            depth: fidl::encoding::Depth,
6502        ) -> fidl::Result<()> {
6503            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
6504            // Zero out padding regions. There's no need to apply masks
6505            // because the unmasked parts will be overwritten by fields.
6506            unsafe {
6507                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
6508                (ptr as *mut u64).write_unaligned(0);
6509            }
6510            // Write the fields.
6511            self.0.encode(encoder, offset + 0, depth)?;
6512            self.1.encode(encoder, offset + 16, depth)?;
6513            Ok(())
6514        }
6515    }
6516
6517    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6518        for ControllerStartRequest
6519    {
6520        #[inline(always)]
6521        fn new_empty() -> Self {
6522            Self {
6523                args: fidl::new_empty!(
6524                    StartChildArgs,
6525                    fdomain_client::fidl::FDomainResourceDialect
6526                ),
6527                execution_controller: fidl::new_empty!(
6528                    fidl::encoding::Endpoint<
6529                        fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
6530                    >,
6531                    fdomain_client::fidl::FDomainResourceDialect
6532                ),
6533            }
6534        }
6535
6536        #[inline]
6537        unsafe fn decode(
6538            &mut self,
6539            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6540            offset: usize,
6541            _depth: fidl::encoding::Depth,
6542        ) -> fidl::Result<()> {
6543            decoder.debug_check_bounds::<Self>(offset);
6544            // Verify that padding bytes are zero.
6545            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
6546            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6547            let mask = 0xffffffff00000000u64;
6548            let maskedval = padval & mask;
6549            if maskedval != 0 {
6550                return Err(fidl::Error::NonZeroPadding {
6551                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
6552                });
6553            }
6554            fidl::decode!(
6555                StartChildArgs,
6556                fdomain_client::fidl::FDomainResourceDialect,
6557                &mut self.args,
6558                decoder,
6559                offset + 0,
6560                _depth
6561            )?;
6562            fidl::decode!(
6563                fidl::encoding::Endpoint<
6564                    fdomain_client::fidl::ServerEnd<ExecutionControllerMarker>,
6565                >,
6566                fdomain_client::fidl::FDomainResourceDialect,
6567                &mut self.execution_controller,
6568                decoder,
6569                offset + 16,
6570                _depth
6571            )?;
6572            Ok(())
6573        }
6574    }
6575
6576    impl fidl::encoding::ResourceTypeMarker for ControllerGetExposedDictionaryResponse {
6577        type Borrowed<'a> = &'a mut Self;
6578        fn take_or_borrow<'a>(
6579            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6580        ) -> Self::Borrowed<'a> {
6581            value
6582        }
6583    }
6584
6585    unsafe impl fidl::encoding::TypeMarker for ControllerGetExposedDictionaryResponse {
6586        type Owned = Self;
6587
6588        #[inline(always)]
6589        fn inline_align(_context: fidl::encoding::Context) -> usize {
6590            4
6591        }
6592
6593        #[inline(always)]
6594        fn inline_size(_context: fidl::encoding::Context) -> usize {
6595            4
6596        }
6597    }
6598
6599    unsafe impl
6600        fidl::encoding::Encode<
6601            ControllerGetExposedDictionaryResponse,
6602            fdomain_client::fidl::FDomainResourceDialect,
6603        > for &mut ControllerGetExposedDictionaryResponse
6604    {
6605        #[inline]
6606        unsafe fn encode(
6607            self,
6608            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6609            offset: usize,
6610            _depth: fidl::encoding::Depth,
6611        ) -> fidl::Result<()> {
6612            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
6613            // Delegate to tuple encoding.
6614            fidl::encoding::Encode::<ControllerGetExposedDictionaryResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
6615                (
6616                    <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
6617                ),
6618                encoder, offset, _depth
6619            )
6620        }
6621    }
6622    unsafe impl<
6623        T0: fidl::encoding::Encode<
6624                fdomain_fuchsia_component_sandbox::DictionaryRef,
6625                fdomain_client::fidl::FDomainResourceDialect,
6626            >,
6627    >
6628        fidl::encoding::Encode<
6629            ControllerGetExposedDictionaryResponse,
6630            fdomain_client::fidl::FDomainResourceDialect,
6631        > for (T0,)
6632    {
6633        #[inline]
6634        unsafe fn encode(
6635            self,
6636            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6637            offset: usize,
6638            depth: fidl::encoding::Depth,
6639        ) -> fidl::Result<()> {
6640            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
6641            // Zero out padding regions. There's no need to apply masks
6642            // because the unmasked parts will be overwritten by fields.
6643            // Write the fields.
6644            self.0.encode(encoder, offset + 0, depth)?;
6645            Ok(())
6646        }
6647    }
6648
6649    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6650        for ControllerGetExposedDictionaryResponse
6651    {
6652        #[inline(always)]
6653        fn new_empty() -> Self {
6654            Self {
6655                dictionary: fidl::new_empty!(
6656                    fdomain_fuchsia_component_sandbox::DictionaryRef,
6657                    fdomain_client::fidl::FDomainResourceDialect
6658                ),
6659            }
6660        }
6661
6662        #[inline]
6663        unsafe fn decode(
6664            &mut self,
6665            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6666            offset: usize,
6667            _depth: fidl::encoding::Depth,
6668        ) -> fidl::Result<()> {
6669            decoder.debug_check_bounds::<Self>(offset);
6670            // Verify that padding bytes are zero.
6671            fidl::decode!(
6672                fdomain_fuchsia_component_sandbox::DictionaryRef,
6673                fdomain_client::fidl::FDomainResourceDialect,
6674                &mut self.dictionary,
6675                decoder,
6676                offset + 0,
6677                _depth
6678            )?;
6679            Ok(())
6680        }
6681    }
6682
6683    impl fidl::encoding::ResourceTypeMarker for ControllerIsStartedResponse {
6684        type Borrowed<'a> = &'a mut Self;
6685        fn take_or_borrow<'a>(
6686            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6687        ) -> Self::Borrowed<'a> {
6688            value
6689        }
6690    }
6691
6692    unsafe impl fidl::encoding::TypeMarker for ControllerIsStartedResponse {
6693        type Owned = Self;
6694
6695        #[inline(always)]
6696        fn inline_align(_context: fidl::encoding::Context) -> usize {
6697            1
6698        }
6699
6700        #[inline(always)]
6701        fn inline_size(_context: fidl::encoding::Context) -> usize {
6702            1
6703        }
6704    }
6705
6706    unsafe impl
6707        fidl::encoding::Encode<
6708            ControllerIsStartedResponse,
6709            fdomain_client::fidl::FDomainResourceDialect,
6710        > for &mut ControllerIsStartedResponse
6711    {
6712        #[inline]
6713        unsafe fn encode(
6714            self,
6715            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6716            offset: usize,
6717            _depth: fidl::encoding::Depth,
6718        ) -> fidl::Result<()> {
6719            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
6720            // Delegate to tuple encoding.
6721            fidl::encoding::Encode::<
6722                ControllerIsStartedResponse,
6723                fdomain_client::fidl::FDomainResourceDialect,
6724            >::encode(
6725                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_started),),
6726                encoder,
6727                offset,
6728                _depth,
6729            )
6730        }
6731    }
6732    unsafe impl<T0: fidl::encoding::Encode<bool, fdomain_client::fidl::FDomainResourceDialect>>
6733        fidl::encoding::Encode<
6734            ControllerIsStartedResponse,
6735            fdomain_client::fidl::FDomainResourceDialect,
6736        > for (T0,)
6737    {
6738        #[inline]
6739        unsafe fn encode(
6740            self,
6741            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6742            offset: usize,
6743            depth: fidl::encoding::Depth,
6744        ) -> fidl::Result<()> {
6745            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
6746            // Zero out padding regions. There's no need to apply masks
6747            // because the unmasked parts will be overwritten by fields.
6748            // Write the fields.
6749            self.0.encode(encoder, offset + 0, depth)?;
6750            Ok(())
6751        }
6752    }
6753
6754    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6755        for ControllerIsStartedResponse
6756    {
6757        #[inline(always)]
6758        fn new_empty() -> Self {
6759            Self {
6760                is_started: fidl::new_empty!(bool, fdomain_client::fidl::FDomainResourceDialect),
6761            }
6762        }
6763
6764        #[inline]
6765        unsafe fn decode(
6766            &mut self,
6767            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6768            offset: usize,
6769            _depth: fidl::encoding::Depth,
6770        ) -> fidl::Result<()> {
6771            decoder.debug_check_bounds::<Self>(offset);
6772            // Verify that padding bytes are zero.
6773            fidl::decode!(
6774                bool,
6775                fdomain_client::fidl::FDomainResourceDialect,
6776                &mut self.is_started,
6777                decoder,
6778                offset + 0,
6779                _depth
6780            )?;
6781            Ok(())
6782        }
6783    }
6784
6785    impl fidl::encoding::ResourceTypeMarker for EventStreamGetNextResponse {
6786        type Borrowed<'a> = &'a mut Self;
6787        fn take_or_borrow<'a>(
6788            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6789        ) -> Self::Borrowed<'a> {
6790            value
6791        }
6792    }
6793
6794    unsafe impl fidl::encoding::TypeMarker for EventStreamGetNextResponse {
6795        type Owned = Self;
6796
6797        #[inline(always)]
6798        fn inline_align(_context: fidl::encoding::Context) -> usize {
6799            8
6800        }
6801
6802        #[inline(always)]
6803        fn inline_size(_context: fidl::encoding::Context) -> usize {
6804            16
6805        }
6806    }
6807
6808    unsafe impl
6809        fidl::encoding::Encode<
6810            EventStreamGetNextResponse,
6811            fdomain_client::fidl::FDomainResourceDialect,
6812        > for &mut EventStreamGetNextResponse
6813    {
6814        #[inline]
6815        unsafe fn encode(
6816            self,
6817            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6818            offset: usize,
6819            _depth: fidl::encoding::Depth,
6820        ) -> fidl::Result<()> {
6821            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
6822            // Delegate to tuple encoding.
6823            fidl::encoding::Encode::<EventStreamGetNextResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
6824                (
6825                    <fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
6826                ),
6827                encoder, offset, _depth
6828            )
6829        }
6830    }
6831    unsafe impl<
6832        T0: fidl::encoding::Encode<
6833                fidl::encoding::UnboundedVector<Event>,
6834                fdomain_client::fidl::FDomainResourceDialect,
6835            >,
6836    >
6837        fidl::encoding::Encode<
6838            EventStreamGetNextResponse,
6839            fdomain_client::fidl::FDomainResourceDialect,
6840        > for (T0,)
6841    {
6842        #[inline]
6843        unsafe fn encode(
6844            self,
6845            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6846            offset: usize,
6847            depth: fidl::encoding::Depth,
6848        ) -> fidl::Result<()> {
6849            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
6850            // Zero out padding regions. There's no need to apply masks
6851            // because the unmasked parts will be overwritten by fields.
6852            // Write the fields.
6853            self.0.encode(encoder, offset + 0, depth)?;
6854            Ok(())
6855        }
6856    }
6857
6858    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6859        for EventStreamGetNextResponse
6860    {
6861        #[inline(always)]
6862        fn new_empty() -> Self {
6863            Self {
6864                events: fidl::new_empty!(
6865                    fidl::encoding::UnboundedVector<Event>,
6866                    fdomain_client::fidl::FDomainResourceDialect
6867                ),
6868            }
6869        }
6870
6871        #[inline]
6872        unsafe fn decode(
6873            &mut self,
6874            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6875            offset: usize,
6876            _depth: fidl::encoding::Depth,
6877        ) -> fidl::Result<()> {
6878            decoder.debug_check_bounds::<Self>(offset);
6879            // Verify that padding bytes are zero.
6880            fidl::decode!(
6881                fidl::encoding::UnboundedVector<Event>,
6882                fdomain_client::fidl::FDomainResourceDialect,
6883                &mut self.events,
6884                decoder,
6885                offset + 0,
6886                _depth
6887            )?;
6888            Ok(())
6889        }
6890    }
6891
6892    impl fidl::encoding::ResourceTypeMarker for IntrospectorGetMonikerRequest {
6893        type Borrowed<'a> = &'a mut Self;
6894        fn take_or_borrow<'a>(
6895            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
6896        ) -> Self::Borrowed<'a> {
6897            value
6898        }
6899    }
6900
6901    unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerRequest {
6902        type Owned = Self;
6903
6904        #[inline(always)]
6905        fn inline_align(_context: fidl::encoding::Context) -> usize {
6906            4
6907        }
6908
6909        #[inline(always)]
6910        fn inline_size(_context: fidl::encoding::Context) -> usize {
6911            4
6912        }
6913    }
6914
6915    unsafe impl
6916        fidl::encoding::Encode<
6917            IntrospectorGetMonikerRequest,
6918            fdomain_client::fidl::FDomainResourceDialect,
6919        > for &mut IntrospectorGetMonikerRequest
6920    {
6921        #[inline]
6922        unsafe fn encode(
6923            self,
6924            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6925            offset: usize,
6926            _depth: fidl::encoding::Depth,
6927        ) -> fidl::Result<()> {
6928            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
6929            // Delegate to tuple encoding.
6930            fidl::encoding::Encode::<
6931                IntrospectorGetMonikerRequest,
6932                fdomain_client::fidl::FDomainResourceDialect,
6933            >::encode(
6934                (<fidl::encoding::HandleType<
6935                    fdomain_client::Event,
6936                    { fidl::ObjectType::EVENT.into_raw() },
6937                    2147483648,
6938                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
6939                    &mut self.component_instance,
6940                ),),
6941                encoder,
6942                offset,
6943                _depth,
6944            )
6945        }
6946    }
6947    unsafe impl<
6948        T0: fidl::encoding::Encode<
6949                fidl::encoding::HandleType<
6950                    fdomain_client::Event,
6951                    { fidl::ObjectType::EVENT.into_raw() },
6952                    2147483648,
6953                >,
6954                fdomain_client::fidl::FDomainResourceDialect,
6955            >,
6956    >
6957        fidl::encoding::Encode<
6958            IntrospectorGetMonikerRequest,
6959            fdomain_client::fidl::FDomainResourceDialect,
6960        > for (T0,)
6961    {
6962        #[inline]
6963        unsafe fn encode(
6964            self,
6965            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6966            offset: usize,
6967            depth: fidl::encoding::Depth,
6968        ) -> fidl::Result<()> {
6969            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
6970            // Zero out padding regions. There's no need to apply masks
6971            // because the unmasked parts will be overwritten by fields.
6972            // Write the fields.
6973            self.0.encode(encoder, offset + 0, depth)?;
6974            Ok(())
6975        }
6976    }
6977
6978    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
6979        for IntrospectorGetMonikerRequest
6980    {
6981        #[inline(always)]
6982        fn new_empty() -> Self {
6983            Self {
6984                component_instance: fidl::new_empty!(fidl::encoding::HandleType<fdomain_client::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fdomain_client::fidl::FDomainResourceDialect),
6985            }
6986        }
6987
6988        #[inline]
6989        unsafe fn decode(
6990            &mut self,
6991            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
6992            offset: usize,
6993            _depth: fidl::encoding::Depth,
6994        ) -> fidl::Result<()> {
6995            decoder.debug_check_bounds::<Self>(offset);
6996            // Verify that padding bytes are zero.
6997            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)?;
6998            Ok(())
6999        }
7000    }
7001
7002    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateRequest {
7003        type Borrowed<'a> = &'a mut Self;
7004        fn take_or_borrow<'a>(
7005            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7006        ) -> Self::Borrowed<'a> {
7007            value
7008        }
7009    }
7010
7011    unsafe impl fidl::encoding::TypeMarker for NamespaceCreateRequest {
7012        type Owned = Self;
7013
7014        #[inline(always)]
7015        fn inline_align(_context: fidl::encoding::Context) -> usize {
7016            8
7017        }
7018
7019        #[inline(always)]
7020        fn inline_size(_context: fidl::encoding::Context) -> usize {
7021            16
7022        }
7023    }
7024
7025    unsafe impl
7026        fidl::encoding::Encode<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>
7027        for &mut NamespaceCreateRequest
7028    {
7029        #[inline]
7030        unsafe fn encode(
7031            self,
7032            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7033            offset: usize,
7034            _depth: fidl::encoding::Depth,
7035        ) -> fidl::Result<()> {
7036            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
7037            // Delegate to tuple encoding.
7038            fidl::encoding::Encode::<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7039                (
7040                    <fidl::encoding::UnboundedVector<NamespaceInputEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
7041                ),
7042                encoder, offset, _depth
7043            )
7044        }
7045    }
7046    unsafe impl<
7047        T0: fidl::encoding::Encode<
7048                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
7049                fdomain_client::fidl::FDomainResourceDialect,
7050            >,
7051    >
7052        fidl::encoding::Encode<NamespaceCreateRequest, fdomain_client::fidl::FDomainResourceDialect>
7053        for (T0,)
7054    {
7055        #[inline]
7056        unsafe fn encode(
7057            self,
7058            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7059            offset: usize,
7060            depth: fidl::encoding::Depth,
7061        ) -> fidl::Result<()> {
7062            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
7063            // Zero out padding regions. There's no need to apply masks
7064            // because the unmasked parts will be overwritten by fields.
7065            // Write the fields.
7066            self.0.encode(encoder, offset + 0, depth)?;
7067            Ok(())
7068        }
7069    }
7070
7071    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7072        for NamespaceCreateRequest
7073    {
7074        #[inline(always)]
7075        fn new_empty() -> Self {
7076            Self {
7077                entries: fidl::new_empty!(
7078                    fidl::encoding::UnboundedVector<NamespaceInputEntry>,
7079                    fdomain_client::fidl::FDomainResourceDialect
7080                ),
7081            }
7082        }
7083
7084        #[inline]
7085        unsafe fn decode(
7086            &mut self,
7087            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7088            offset: usize,
7089            _depth: fidl::encoding::Depth,
7090        ) -> fidl::Result<()> {
7091            decoder.debug_check_bounds::<Self>(offset);
7092            // Verify that padding bytes are zero.
7093            fidl::decode!(
7094                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
7095                fdomain_client::fidl::FDomainResourceDialect,
7096                &mut self.entries,
7097                decoder,
7098                offset + 0,
7099                _depth
7100            )?;
7101            Ok(())
7102        }
7103    }
7104
7105    impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry {
7106        type Borrowed<'a> = &'a mut Self;
7107        fn take_or_borrow<'a>(
7108            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7109        ) -> Self::Borrowed<'a> {
7110            value
7111        }
7112    }
7113
7114    unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry {
7115        type Owned = Self;
7116
7117        #[inline(always)]
7118        fn inline_align(_context: fidl::encoding::Context) -> usize {
7119            8
7120        }
7121
7122        #[inline(always)]
7123        fn inline_size(_context: fidl::encoding::Context) -> usize {
7124            24
7125        }
7126    }
7127
7128    unsafe impl
7129        fidl::encoding::Encode<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>
7130        for &mut NamespaceInputEntry
7131    {
7132        #[inline]
7133        unsafe fn encode(
7134            self,
7135            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7136            offset: usize,
7137            _depth: fidl::encoding::Depth,
7138        ) -> fidl::Result<()> {
7139            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
7140            // Delegate to tuple encoding.
7141            fidl::encoding::Encode::<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>::encode(
7142                (
7143                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
7144                    <fidl::encoding::Endpoint<fdomain_client::fidl::ClientEnd<fdomain_fuchsia_component_sandbox::DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
7145                ),
7146                encoder, offset, _depth
7147            )
7148        }
7149    }
7150    unsafe impl<
7151        T0: fidl::encoding::Encode<
7152                fidl::encoding::BoundedString<4095>,
7153                fdomain_client::fidl::FDomainResourceDialect,
7154            >,
7155        T1: fidl::encoding::Encode<
7156                fidl::encoding::Endpoint<
7157                    fdomain_client::fidl::ClientEnd<
7158                        fdomain_fuchsia_component_sandbox::DictionaryMarker,
7159                    >,
7160                >,
7161                fdomain_client::fidl::FDomainResourceDialect,
7162            >,
7163    > fidl::encoding::Encode<NamespaceInputEntry, fdomain_client::fidl::FDomainResourceDialect>
7164        for (T0, T1)
7165    {
7166        #[inline]
7167        unsafe fn encode(
7168            self,
7169            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7170            offset: usize,
7171            depth: fidl::encoding::Depth,
7172        ) -> fidl::Result<()> {
7173            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
7174            // Zero out padding regions. There's no need to apply masks
7175            // because the unmasked parts will be overwritten by fields.
7176            unsafe {
7177                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7178                (ptr as *mut u64).write_unaligned(0);
7179            }
7180            // Write the fields.
7181            self.0.encode(encoder, offset + 0, depth)?;
7182            self.1.encode(encoder, offset + 16, depth)?;
7183            Ok(())
7184        }
7185    }
7186
7187    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7188        for NamespaceInputEntry
7189    {
7190        #[inline(always)]
7191        fn new_empty() -> Self {
7192            Self {
7193                path: fidl::new_empty!(
7194                    fidl::encoding::BoundedString<4095>,
7195                    fdomain_client::fidl::FDomainResourceDialect
7196                ),
7197                dictionary: fidl::new_empty!(
7198                    fidl::encoding::Endpoint<
7199                        fdomain_client::fidl::ClientEnd<
7200                            fdomain_fuchsia_component_sandbox::DictionaryMarker,
7201                        >,
7202                    >,
7203                    fdomain_client::fidl::FDomainResourceDialect
7204                ),
7205            }
7206        }
7207
7208        #[inline]
7209        unsafe fn decode(
7210            &mut self,
7211            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7212            offset: usize,
7213            _depth: fidl::encoding::Depth,
7214        ) -> fidl::Result<()> {
7215            decoder.debug_check_bounds::<Self>(offset);
7216            // Verify that padding bytes are zero.
7217            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7218            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7219            let mask = 0xffffffff00000000u64;
7220            let maskedval = padval & mask;
7221            if maskedval != 0 {
7222                return Err(fidl::Error::NonZeroPadding {
7223                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7224                });
7225            }
7226            fidl::decode!(
7227                fidl::encoding::BoundedString<4095>,
7228                fdomain_client::fidl::FDomainResourceDialect,
7229                &mut self.path,
7230                decoder,
7231                offset + 0,
7232                _depth
7233            )?;
7234            fidl::decode!(
7235                fidl::encoding::Endpoint<
7236                    fdomain_client::fidl::ClientEnd<
7237                        fdomain_fuchsia_component_sandbox::DictionaryMarker,
7238                    >,
7239                >,
7240                fdomain_client::fidl::FDomainResourceDialect,
7241                &mut self.dictionary,
7242                decoder,
7243                offset + 16,
7244                _depth
7245            )?;
7246            Ok(())
7247        }
7248    }
7249
7250    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateResponse {
7251        type Borrowed<'a> = &'a mut Self;
7252        fn take_or_borrow<'a>(
7253            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7254        ) -> Self::Borrowed<'a> {
7255            value
7256        }
7257    }
7258
7259    unsafe impl fidl::encoding::TypeMarker for NamespaceCreateResponse {
7260        type Owned = Self;
7261
7262        #[inline(always)]
7263        fn inline_align(_context: fidl::encoding::Context) -> usize {
7264            8
7265        }
7266
7267        #[inline(always)]
7268        fn inline_size(_context: fidl::encoding::Context) -> usize {
7269            16
7270        }
7271    }
7272
7273    unsafe impl
7274        fidl::encoding::Encode<
7275            NamespaceCreateResponse,
7276            fdomain_client::fidl::FDomainResourceDialect,
7277        > for &mut NamespaceCreateResponse
7278    {
7279        #[inline]
7280        unsafe fn encode(
7281            self,
7282            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7283            offset: usize,
7284            _depth: fidl::encoding::Depth,
7285        ) -> fidl::Result<()> {
7286            encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
7287            // Delegate to tuple encoding.
7288            fidl::encoding::Encode::<NamespaceCreateResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
7289                (
7290                    <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
7291                ),
7292                encoder, offset, _depth
7293            )
7294        }
7295    }
7296    unsafe impl<
7297        T0: fidl::encoding::Encode<
7298                fidl::encoding::UnboundedVector<NamespaceEntry>,
7299                fdomain_client::fidl::FDomainResourceDialect,
7300            >,
7301    >
7302        fidl::encoding::Encode<
7303            NamespaceCreateResponse,
7304            fdomain_client::fidl::FDomainResourceDialect,
7305        > for (T0,)
7306    {
7307        #[inline]
7308        unsafe fn encode(
7309            self,
7310            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7311            offset: usize,
7312            depth: fidl::encoding::Depth,
7313        ) -> fidl::Result<()> {
7314            encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
7315            // Zero out padding regions. There's no need to apply masks
7316            // because the unmasked parts will be overwritten by fields.
7317            // Write the fields.
7318            self.0.encode(encoder, offset + 0, depth)?;
7319            Ok(())
7320        }
7321    }
7322
7323    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7324        for NamespaceCreateResponse
7325    {
7326        #[inline(always)]
7327        fn new_empty() -> Self {
7328            Self {
7329                entries: fidl::new_empty!(
7330                    fidl::encoding::UnboundedVector<NamespaceEntry>,
7331                    fdomain_client::fidl::FDomainResourceDialect
7332                ),
7333            }
7334        }
7335
7336        #[inline]
7337        unsafe fn decode(
7338            &mut self,
7339            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7340            offset: usize,
7341            _depth: fidl::encoding::Depth,
7342        ) -> fidl::Result<()> {
7343            decoder.debug_check_bounds::<Self>(offset);
7344            // Verify that padding bytes are zero.
7345            fidl::decode!(
7346                fidl::encoding::UnboundedVector<NamespaceEntry>,
7347                fdomain_client::fidl::FDomainResourceDialect,
7348                &mut self.entries,
7349                decoder,
7350                offset + 0,
7351                _depth
7352            )?;
7353            Ok(())
7354        }
7355    }
7356
7357    impl fidl::encoding::ResourceTypeMarker for RealmCreateChildRequest {
7358        type Borrowed<'a> = &'a mut Self;
7359        fn take_or_borrow<'a>(
7360            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7361        ) -> Self::Borrowed<'a> {
7362            value
7363        }
7364    }
7365
7366    unsafe impl fidl::encoding::TypeMarker for RealmCreateChildRequest {
7367        type Owned = Self;
7368
7369        #[inline(always)]
7370        fn inline_align(_context: fidl::encoding::Context) -> usize {
7371            8
7372        }
7373
7374        #[inline(always)]
7375        fn inline_size(_context: fidl::encoding::Context) -> usize {
7376            48
7377        }
7378    }
7379
7380    unsafe impl
7381        fidl::encoding::Encode<
7382            RealmCreateChildRequest,
7383            fdomain_client::fidl::FDomainResourceDialect,
7384        > for &mut RealmCreateChildRequest
7385    {
7386        #[inline]
7387        unsafe fn encode(
7388            self,
7389            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7390            offset: usize,
7391            _depth: fidl::encoding::Depth,
7392        ) -> fidl::Result<()> {
7393            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
7394            // Delegate to tuple encoding.
7395            fidl::encoding::Encode::<RealmCreateChildRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7396                (
7397                    <fdomain_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
7398                    <fdomain_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
7399                    <CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
7400                ),
7401                encoder, offset, _depth
7402            )
7403        }
7404    }
7405    unsafe impl<
7406        T0: fidl::encoding::Encode<
7407                fdomain_fuchsia_component_decl::CollectionRef,
7408                fdomain_client::fidl::FDomainResourceDialect,
7409            >,
7410        T1: fidl::encoding::Encode<
7411                fdomain_fuchsia_component_decl::Child,
7412                fdomain_client::fidl::FDomainResourceDialect,
7413            >,
7414        T2: fidl::encoding::Encode<CreateChildArgs, fdomain_client::fidl::FDomainResourceDialect>,
7415    >
7416        fidl::encoding::Encode<
7417            RealmCreateChildRequest,
7418            fdomain_client::fidl::FDomainResourceDialect,
7419        > for (T0, T1, T2)
7420    {
7421        #[inline]
7422        unsafe fn encode(
7423            self,
7424            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7425            offset: usize,
7426            depth: fidl::encoding::Depth,
7427        ) -> fidl::Result<()> {
7428            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
7429            // Zero out padding regions. There's no need to apply masks
7430            // because the unmasked parts will be overwritten by fields.
7431            // Write the fields.
7432            self.0.encode(encoder, offset + 0, depth)?;
7433            self.1.encode(encoder, offset + 16, depth)?;
7434            self.2.encode(encoder, offset + 32, depth)?;
7435            Ok(())
7436        }
7437    }
7438
7439    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7440        for RealmCreateChildRequest
7441    {
7442        #[inline(always)]
7443        fn new_empty() -> Self {
7444            Self {
7445                collection: fidl::new_empty!(
7446                    fdomain_fuchsia_component_decl::CollectionRef,
7447                    fdomain_client::fidl::FDomainResourceDialect
7448                ),
7449                decl: fidl::new_empty!(
7450                    fdomain_fuchsia_component_decl::Child,
7451                    fdomain_client::fidl::FDomainResourceDialect
7452                ),
7453                args: fidl::new_empty!(
7454                    CreateChildArgs,
7455                    fdomain_client::fidl::FDomainResourceDialect
7456                ),
7457            }
7458        }
7459
7460        #[inline]
7461        unsafe fn decode(
7462            &mut self,
7463            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7464            offset: usize,
7465            _depth: fidl::encoding::Depth,
7466        ) -> fidl::Result<()> {
7467            decoder.debug_check_bounds::<Self>(offset);
7468            // Verify that padding bytes are zero.
7469            fidl::decode!(
7470                fdomain_fuchsia_component_decl::CollectionRef,
7471                fdomain_client::fidl::FDomainResourceDialect,
7472                &mut self.collection,
7473                decoder,
7474                offset + 0,
7475                _depth
7476            )?;
7477            fidl::decode!(
7478                fdomain_fuchsia_component_decl::Child,
7479                fdomain_client::fidl::FDomainResourceDialect,
7480                &mut self.decl,
7481                decoder,
7482                offset + 16,
7483                _depth
7484            )?;
7485            fidl::decode!(
7486                CreateChildArgs,
7487                fdomain_client::fidl::FDomainResourceDialect,
7488                &mut self.args,
7489                decoder,
7490                offset + 32,
7491                _depth
7492            )?;
7493            Ok(())
7494        }
7495    }
7496
7497    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryRequest {
7498        type Borrowed<'a> = &'a mut Self;
7499        fn take_or_borrow<'a>(
7500            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7501        ) -> Self::Borrowed<'a> {
7502            value
7503        }
7504    }
7505
7506    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryRequest {
7507        type Owned = Self;
7508
7509        #[inline(always)]
7510        fn inline_align(_context: fidl::encoding::Context) -> usize {
7511            8
7512        }
7513
7514        #[inline(always)]
7515        fn inline_size(_context: fidl::encoding::Context) -> usize {
7516            32
7517        }
7518    }
7519
7520    unsafe impl
7521        fidl::encoding::Encode<
7522            RealmGetChildOutputDictionaryRequest,
7523            fdomain_client::fidl::FDomainResourceDialect,
7524        > for &mut RealmGetChildOutputDictionaryRequest
7525    {
7526        #[inline]
7527        unsafe fn encode(
7528            self,
7529            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7530            offset: usize,
7531            _depth: fidl::encoding::Depth,
7532        ) -> fidl::Result<()> {
7533            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
7534            // Delegate to tuple encoding.
7535            fidl::encoding::Encode::<RealmGetChildOutputDictionaryRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7536                (
7537                    <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
7538                ),
7539                encoder, offset, _depth
7540            )
7541        }
7542    }
7543    unsafe impl<
7544        T0: fidl::encoding::Encode<
7545                fdomain_fuchsia_component_decl::ChildRef,
7546                fdomain_client::fidl::FDomainResourceDialect,
7547            >,
7548    >
7549        fidl::encoding::Encode<
7550            RealmGetChildOutputDictionaryRequest,
7551            fdomain_client::fidl::FDomainResourceDialect,
7552        > for (T0,)
7553    {
7554        #[inline]
7555        unsafe fn encode(
7556            self,
7557            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7558            offset: usize,
7559            depth: fidl::encoding::Depth,
7560        ) -> fidl::Result<()> {
7561            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
7562            // Zero out padding regions. There's no need to apply masks
7563            // because the unmasked parts will be overwritten by fields.
7564            // Write the fields.
7565            self.0.encode(encoder, offset + 0, depth)?;
7566            Ok(())
7567        }
7568    }
7569
7570    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7571        for RealmGetChildOutputDictionaryRequest
7572    {
7573        #[inline(always)]
7574        fn new_empty() -> Self {
7575            Self {
7576                child: fidl::new_empty!(
7577                    fdomain_fuchsia_component_decl::ChildRef,
7578                    fdomain_client::fidl::FDomainResourceDialect
7579                ),
7580            }
7581        }
7582
7583        #[inline]
7584        unsafe fn decode(
7585            &mut self,
7586            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7587            offset: usize,
7588            _depth: fidl::encoding::Depth,
7589        ) -> fidl::Result<()> {
7590            decoder.debug_check_bounds::<Self>(offset);
7591            // Verify that padding bytes are zero.
7592            fidl::decode!(
7593                fdomain_fuchsia_component_decl::ChildRef,
7594                fdomain_client::fidl::FDomainResourceDialect,
7595                &mut self.child,
7596                decoder,
7597                offset + 0,
7598                _depth
7599            )?;
7600            Ok(())
7601        }
7602    }
7603
7604    impl fidl::encoding::ResourceTypeMarker for RealmListChildrenRequest {
7605        type Borrowed<'a> = &'a mut Self;
7606        fn take_or_borrow<'a>(
7607            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7608        ) -> Self::Borrowed<'a> {
7609            value
7610        }
7611    }
7612
7613    unsafe impl fidl::encoding::TypeMarker for RealmListChildrenRequest {
7614        type Owned = Self;
7615
7616        #[inline(always)]
7617        fn inline_align(_context: fidl::encoding::Context) -> usize {
7618            8
7619        }
7620
7621        #[inline(always)]
7622        fn inline_size(_context: fidl::encoding::Context) -> usize {
7623            24
7624        }
7625    }
7626
7627    unsafe impl
7628        fidl::encoding::Encode<
7629            RealmListChildrenRequest,
7630            fdomain_client::fidl::FDomainResourceDialect,
7631        > for &mut RealmListChildrenRequest
7632    {
7633        #[inline]
7634        unsafe fn encode(
7635            self,
7636            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7637            offset: usize,
7638            _depth: fidl::encoding::Depth,
7639        ) -> fidl::Result<()> {
7640            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
7641            // Delegate to tuple encoding.
7642            fidl::encoding::Encode::<RealmListChildrenRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7643                (
7644                    <fdomain_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
7645                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iter),
7646                ),
7647                encoder, offset, _depth
7648            )
7649        }
7650    }
7651    unsafe impl<
7652        T0: fidl::encoding::Encode<
7653                fdomain_fuchsia_component_decl::CollectionRef,
7654                fdomain_client::fidl::FDomainResourceDialect,
7655            >,
7656        T1: fidl::encoding::Encode<
7657                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
7658                fdomain_client::fidl::FDomainResourceDialect,
7659            >,
7660    >
7661        fidl::encoding::Encode<
7662            RealmListChildrenRequest,
7663            fdomain_client::fidl::FDomainResourceDialect,
7664        > for (T0, T1)
7665    {
7666        #[inline]
7667        unsafe fn encode(
7668            self,
7669            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7670            offset: usize,
7671            depth: fidl::encoding::Depth,
7672        ) -> fidl::Result<()> {
7673            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
7674            // Zero out padding regions. There's no need to apply masks
7675            // because the unmasked parts will be overwritten by fields.
7676            unsafe {
7677                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7678                (ptr as *mut u64).write_unaligned(0);
7679            }
7680            // Write the fields.
7681            self.0.encode(encoder, offset + 0, depth)?;
7682            self.1.encode(encoder, offset + 16, depth)?;
7683            Ok(())
7684        }
7685    }
7686
7687    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7688        for RealmListChildrenRequest
7689    {
7690        #[inline(always)]
7691        fn new_empty() -> Self {
7692            Self {
7693                collection: fidl::new_empty!(
7694                    fdomain_fuchsia_component_decl::CollectionRef,
7695                    fdomain_client::fidl::FDomainResourceDialect
7696                ),
7697                iter: fidl::new_empty!(
7698                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
7699                    fdomain_client::fidl::FDomainResourceDialect
7700                ),
7701            }
7702        }
7703
7704        #[inline]
7705        unsafe fn decode(
7706            &mut self,
7707            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7708            offset: usize,
7709            _depth: fidl::encoding::Depth,
7710        ) -> fidl::Result<()> {
7711            decoder.debug_check_bounds::<Self>(offset);
7712            // Verify that padding bytes are zero.
7713            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7714            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7715            let mask = 0xffffffff00000000u64;
7716            let maskedval = padval & mask;
7717            if maskedval != 0 {
7718                return Err(fidl::Error::NonZeroPadding {
7719                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7720                });
7721            }
7722            fidl::decode!(
7723                fdomain_fuchsia_component_decl::CollectionRef,
7724                fdomain_client::fidl::FDomainResourceDialect,
7725                &mut self.collection,
7726                decoder,
7727                offset + 0,
7728                _depth
7729            )?;
7730            fidl::decode!(
7731                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ChildIteratorMarker>>,
7732                fdomain_client::fidl::FDomainResourceDialect,
7733                &mut self.iter,
7734                decoder,
7735                offset + 16,
7736                _depth
7737            )?;
7738            Ok(())
7739        }
7740    }
7741
7742    impl fidl::encoding::ResourceTypeMarker for RealmOpenControllerRequest {
7743        type Borrowed<'a> = &'a mut Self;
7744        fn take_or_borrow<'a>(
7745            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7746        ) -> Self::Borrowed<'a> {
7747            value
7748        }
7749    }
7750
7751    unsafe impl fidl::encoding::TypeMarker for RealmOpenControllerRequest {
7752        type Owned = Self;
7753
7754        #[inline(always)]
7755        fn inline_align(_context: fidl::encoding::Context) -> usize {
7756            8
7757        }
7758
7759        #[inline(always)]
7760        fn inline_size(_context: fidl::encoding::Context) -> usize {
7761            40
7762        }
7763    }
7764
7765    unsafe impl
7766        fidl::encoding::Encode<
7767            RealmOpenControllerRequest,
7768            fdomain_client::fidl::FDomainResourceDialect,
7769        > for &mut RealmOpenControllerRequest
7770    {
7771        #[inline]
7772        unsafe fn encode(
7773            self,
7774            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7775            offset: usize,
7776            _depth: fidl::encoding::Depth,
7777        ) -> fidl::Result<()> {
7778            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
7779            // Delegate to tuple encoding.
7780            fidl::encoding::Encode::<RealmOpenControllerRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7781                (
7782                    <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
7783                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
7784                ),
7785                encoder, offset, _depth
7786            )
7787        }
7788    }
7789    unsafe impl<
7790        T0: fidl::encoding::Encode<
7791                fdomain_fuchsia_component_decl::ChildRef,
7792                fdomain_client::fidl::FDomainResourceDialect,
7793            >,
7794        T1: fidl::encoding::Encode<
7795                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7796                fdomain_client::fidl::FDomainResourceDialect,
7797            >,
7798    >
7799        fidl::encoding::Encode<
7800            RealmOpenControllerRequest,
7801            fdomain_client::fidl::FDomainResourceDialect,
7802        > for (T0, T1)
7803    {
7804        #[inline]
7805        unsafe fn encode(
7806            self,
7807            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7808            offset: usize,
7809            depth: fidl::encoding::Depth,
7810        ) -> fidl::Result<()> {
7811            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
7812            // Zero out padding regions. There's no need to apply masks
7813            // because the unmasked parts will be overwritten by fields.
7814            unsafe {
7815                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7816                (ptr as *mut u64).write_unaligned(0);
7817            }
7818            // Write the fields.
7819            self.0.encode(encoder, offset + 0, depth)?;
7820            self.1.encode(encoder, offset + 32, depth)?;
7821            Ok(())
7822        }
7823    }
7824
7825    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7826        for RealmOpenControllerRequest
7827    {
7828        #[inline(always)]
7829        fn new_empty() -> Self {
7830            Self {
7831                child: fidl::new_empty!(
7832                    fdomain_fuchsia_component_decl::ChildRef,
7833                    fdomain_client::fidl::FDomainResourceDialect
7834                ),
7835                controller: fidl::new_empty!(
7836                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7837                    fdomain_client::fidl::FDomainResourceDialect
7838                ),
7839            }
7840        }
7841
7842        #[inline]
7843        unsafe fn decode(
7844            &mut self,
7845            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7846            offset: usize,
7847            _depth: fidl::encoding::Depth,
7848        ) -> fidl::Result<()> {
7849            decoder.debug_check_bounds::<Self>(offset);
7850            // Verify that padding bytes are zero.
7851            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7852            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7853            let mask = 0xffffffff00000000u64;
7854            let maskedval = padval & mask;
7855            if maskedval != 0 {
7856                return Err(fidl::Error::NonZeroPadding {
7857                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
7858                });
7859            }
7860            fidl::decode!(
7861                fdomain_fuchsia_component_decl::ChildRef,
7862                fdomain_client::fidl::FDomainResourceDialect,
7863                &mut self.child,
7864                decoder,
7865                offset + 0,
7866                _depth
7867            )?;
7868            fidl::decode!(
7869                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
7870                fdomain_client::fidl::FDomainResourceDialect,
7871                &mut self.controller,
7872                decoder,
7873                offset + 32,
7874                _depth
7875            )?;
7876            Ok(())
7877        }
7878    }
7879
7880    impl fidl::encoding::ResourceTypeMarker for RealmOpenExposedDirRequest {
7881        type Borrowed<'a> = &'a mut Self;
7882        fn take_or_borrow<'a>(
7883            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
7884        ) -> Self::Borrowed<'a> {
7885            value
7886        }
7887    }
7888
7889    unsafe impl fidl::encoding::TypeMarker for RealmOpenExposedDirRequest {
7890        type Owned = Self;
7891
7892        #[inline(always)]
7893        fn inline_align(_context: fidl::encoding::Context) -> usize {
7894            8
7895        }
7896
7897        #[inline(always)]
7898        fn inline_size(_context: fidl::encoding::Context) -> usize {
7899            40
7900        }
7901    }
7902
7903    unsafe impl
7904        fidl::encoding::Encode<
7905            RealmOpenExposedDirRequest,
7906            fdomain_client::fidl::FDomainResourceDialect,
7907        > for &mut RealmOpenExposedDirRequest
7908    {
7909        #[inline]
7910        unsafe fn encode(
7911            self,
7912            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7913            offset: usize,
7914            _depth: fidl::encoding::Depth,
7915        ) -> fidl::Result<()> {
7916            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
7917            // Delegate to tuple encoding.
7918            fidl::encoding::Encode::<RealmOpenExposedDirRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
7919                (
7920                    <fdomain_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
7921                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.exposed_dir),
7922                ),
7923                encoder, offset, _depth
7924            )
7925        }
7926    }
7927    unsafe impl<
7928        T0: fidl::encoding::Encode<
7929                fdomain_fuchsia_component_decl::ChildRef,
7930                fdomain_client::fidl::FDomainResourceDialect,
7931            >,
7932        T1: fidl::encoding::Encode<
7933                fidl::encoding::Endpoint<
7934                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7935                >,
7936                fdomain_client::fidl::FDomainResourceDialect,
7937            >,
7938    >
7939        fidl::encoding::Encode<
7940            RealmOpenExposedDirRequest,
7941            fdomain_client::fidl::FDomainResourceDialect,
7942        > for (T0, T1)
7943    {
7944        #[inline]
7945        unsafe fn encode(
7946            self,
7947            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7948            offset: usize,
7949            depth: fidl::encoding::Depth,
7950        ) -> fidl::Result<()> {
7951            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
7952            // Zero out padding regions. There's no need to apply masks
7953            // because the unmasked parts will be overwritten by fields.
7954            unsafe {
7955                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7956                (ptr as *mut u64).write_unaligned(0);
7957            }
7958            // Write the fields.
7959            self.0.encode(encoder, offset + 0, depth)?;
7960            self.1.encode(encoder, offset + 32, depth)?;
7961            Ok(())
7962        }
7963    }
7964
7965    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
7966        for RealmOpenExposedDirRequest
7967    {
7968        #[inline(always)]
7969        fn new_empty() -> Self {
7970            Self {
7971                child: fidl::new_empty!(
7972                    fdomain_fuchsia_component_decl::ChildRef,
7973                    fdomain_client::fidl::FDomainResourceDialect
7974                ),
7975                exposed_dir: fidl::new_empty!(
7976                    fidl::encoding::Endpoint<
7977                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
7978                    >,
7979                    fdomain_client::fidl::FDomainResourceDialect
7980                ),
7981            }
7982        }
7983
7984        #[inline]
7985        unsafe fn decode(
7986            &mut self,
7987            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
7988            offset: usize,
7989            _depth: fidl::encoding::Depth,
7990        ) -> fidl::Result<()> {
7991            decoder.debug_check_bounds::<Self>(offset);
7992            // Verify that padding bytes are zero.
7993            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
7994            let padval = unsafe { (ptr as *const u64).read_unaligned() };
7995            let mask = 0xffffffff00000000u64;
7996            let maskedval = padval & mask;
7997            if maskedval != 0 {
7998                return Err(fidl::Error::NonZeroPadding {
7999                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8000                });
8001            }
8002            fidl::decode!(
8003                fdomain_fuchsia_component_decl::ChildRef,
8004                fdomain_client::fidl::FDomainResourceDialect,
8005                &mut self.child,
8006                decoder,
8007                offset + 0,
8008                _depth
8009            )?;
8010            fidl::decode!(
8011                fidl::encoding::Endpoint<
8012                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::DirectoryMarker>,
8013                >,
8014                fdomain_client::fidl::FDomainResourceDialect,
8015                &mut self.exposed_dir,
8016                decoder,
8017                offset + 32,
8018                _depth
8019            )?;
8020            Ok(())
8021        }
8022    }
8023
8024    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryResponse {
8025        type Borrowed<'a> = &'a mut Self;
8026        fn take_or_borrow<'a>(
8027            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8028        ) -> Self::Borrowed<'a> {
8029            value
8030        }
8031    }
8032
8033    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryResponse {
8034        type Owned = Self;
8035
8036        #[inline(always)]
8037        fn inline_align(_context: fidl::encoding::Context) -> usize {
8038            4
8039        }
8040
8041        #[inline(always)]
8042        fn inline_size(_context: fidl::encoding::Context) -> usize {
8043            4
8044        }
8045    }
8046
8047    unsafe impl
8048        fidl::encoding::Encode<
8049            RealmGetChildOutputDictionaryResponse,
8050            fdomain_client::fidl::FDomainResourceDialect,
8051        > for &mut RealmGetChildOutputDictionaryResponse
8052    {
8053        #[inline]
8054        unsafe fn encode(
8055            self,
8056            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8057            offset: usize,
8058            _depth: fidl::encoding::Depth,
8059        ) -> fidl::Result<()> {
8060            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
8061            // Delegate to tuple encoding.
8062            fidl::encoding::Encode::<RealmGetChildOutputDictionaryResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
8063                (
8064                    <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
8065                ),
8066                encoder, offset, _depth
8067            )
8068        }
8069    }
8070    unsafe impl<
8071        T0: fidl::encoding::Encode<
8072                fdomain_fuchsia_component_sandbox::DictionaryRef,
8073                fdomain_client::fidl::FDomainResourceDialect,
8074            >,
8075    >
8076        fidl::encoding::Encode<
8077            RealmGetChildOutputDictionaryResponse,
8078            fdomain_client::fidl::FDomainResourceDialect,
8079        > for (T0,)
8080    {
8081        #[inline]
8082        unsafe fn encode(
8083            self,
8084            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8085            offset: usize,
8086            depth: fidl::encoding::Depth,
8087        ) -> fidl::Result<()> {
8088            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
8089            // Zero out padding regions. There's no need to apply masks
8090            // because the unmasked parts will be overwritten by fields.
8091            // Write the fields.
8092            self.0.encode(encoder, offset + 0, depth)?;
8093            Ok(())
8094        }
8095    }
8096
8097    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8098        for RealmGetChildOutputDictionaryResponse
8099    {
8100        #[inline(always)]
8101        fn new_empty() -> Self {
8102            Self {
8103                dictionary: fidl::new_empty!(
8104                    fdomain_fuchsia_component_sandbox::DictionaryRef,
8105                    fdomain_client::fidl::FDomainResourceDialect
8106                ),
8107            }
8108        }
8109
8110        #[inline]
8111        unsafe fn decode(
8112            &mut self,
8113            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8114            offset: usize,
8115            _depth: fidl::encoding::Depth,
8116        ) -> fidl::Result<()> {
8117            decoder.debug_check_bounds::<Self>(offset);
8118            // Verify that padding bytes are zero.
8119            fidl::decode!(
8120                fdomain_fuchsia_component_sandbox::DictionaryRef,
8121                fdomain_client::fidl::FDomainResourceDialect,
8122                &mut self.dictionary,
8123                decoder,
8124                offset + 0,
8125                _depth
8126            )?;
8127            Ok(())
8128        }
8129    }
8130
8131    impl fidl::encoding::ResourceTypeMarker for RealmGetResolvedInfoResponse {
8132        type Borrowed<'a> = &'a mut Self;
8133        fn take_or_borrow<'a>(
8134            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8135        ) -> Self::Borrowed<'a> {
8136            value
8137        }
8138    }
8139
8140    unsafe impl fidl::encoding::TypeMarker for RealmGetResolvedInfoResponse {
8141        type Owned = Self;
8142
8143        #[inline(always)]
8144        fn inline_align(_context: fidl::encoding::Context) -> usize {
8145            8
8146        }
8147
8148        #[inline(always)]
8149        fn inline_size(_context: fidl::encoding::Context) -> usize {
8150            16
8151        }
8152    }
8153
8154    unsafe impl
8155        fidl::encoding::Encode<
8156            RealmGetResolvedInfoResponse,
8157            fdomain_client::fidl::FDomainResourceDialect,
8158        > for &mut RealmGetResolvedInfoResponse
8159    {
8160        #[inline]
8161        unsafe fn encode(
8162            self,
8163            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8164            offset: usize,
8165            _depth: fidl::encoding::Depth,
8166        ) -> fidl::Result<()> {
8167            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
8168            // Delegate to tuple encoding.
8169            fidl::encoding::Encode::<RealmGetResolvedInfoResponse, fdomain_client::fidl::FDomainResourceDialect>::encode(
8170                (
8171                    <fdomain_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resolved_info),
8172                ),
8173                encoder, offset, _depth
8174            )
8175        }
8176    }
8177    unsafe impl<
8178        T0: fidl::encoding::Encode<
8179                fdomain_fuchsia_component_resolution::Component,
8180                fdomain_client::fidl::FDomainResourceDialect,
8181            >,
8182    >
8183        fidl::encoding::Encode<
8184            RealmGetResolvedInfoResponse,
8185            fdomain_client::fidl::FDomainResourceDialect,
8186        > for (T0,)
8187    {
8188        #[inline]
8189        unsafe fn encode(
8190            self,
8191            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8192            offset: usize,
8193            depth: fidl::encoding::Depth,
8194        ) -> fidl::Result<()> {
8195            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
8196            // Zero out padding regions. There's no need to apply masks
8197            // because the unmasked parts will be overwritten by fields.
8198            // Write the fields.
8199            self.0.encode(encoder, offset + 0, depth)?;
8200            Ok(())
8201        }
8202    }
8203
8204    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8205        for RealmGetResolvedInfoResponse
8206    {
8207        #[inline(always)]
8208        fn new_empty() -> Self {
8209            Self {
8210                resolved_info: fidl::new_empty!(
8211                    fdomain_fuchsia_component_resolution::Component,
8212                    fdomain_client::fidl::FDomainResourceDialect
8213                ),
8214            }
8215        }
8216
8217        #[inline]
8218        unsafe fn decode(
8219            &mut self,
8220            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8221            offset: usize,
8222            _depth: fidl::encoding::Depth,
8223        ) -> fidl::Result<()> {
8224            decoder.debug_check_bounds::<Self>(offset);
8225            // Verify that padding bytes are zero.
8226            fidl::decode!(
8227                fdomain_fuchsia_component_resolution::Component,
8228                fdomain_client::fidl::FDomainResourceDialect,
8229                &mut self.resolved_info,
8230                decoder,
8231                offset + 0,
8232                _depth
8233            )?;
8234            Ok(())
8235        }
8236    }
8237
8238    impl fidl::encoding::ResourceTypeMarker for StorageAdminListStorageInRealmRequest {
8239        type Borrowed<'a> = &'a mut Self;
8240        fn take_or_borrow<'a>(
8241            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8242        ) -> Self::Borrowed<'a> {
8243            value
8244        }
8245    }
8246
8247    unsafe impl fidl::encoding::TypeMarker for StorageAdminListStorageInRealmRequest {
8248        type Owned = Self;
8249
8250        #[inline(always)]
8251        fn inline_align(_context: fidl::encoding::Context) -> usize {
8252            8
8253        }
8254
8255        #[inline(always)]
8256        fn inline_size(_context: fidl::encoding::Context) -> usize {
8257            24
8258        }
8259    }
8260
8261    unsafe impl
8262        fidl::encoding::Encode<
8263            StorageAdminListStorageInRealmRequest,
8264            fdomain_client::fidl::FDomainResourceDialect,
8265        > for &mut StorageAdminListStorageInRealmRequest
8266    {
8267        #[inline]
8268        unsafe fn encode(
8269            self,
8270            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8271            offset: usize,
8272            _depth: fidl::encoding::Depth,
8273        ) -> fidl::Result<()> {
8274            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
8275            // Delegate to tuple encoding.
8276            fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8277                (
8278                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
8279                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
8280                ),
8281                encoder, offset, _depth
8282            )
8283        }
8284    }
8285    unsafe impl<
8286        T0: fidl::encoding::Encode<
8287                fidl::encoding::BoundedString<4096>,
8288                fdomain_client::fidl::FDomainResourceDialect,
8289            >,
8290        T1: fidl::encoding::Encode<
8291                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>>,
8292                fdomain_client::fidl::FDomainResourceDialect,
8293            >,
8294    >
8295        fidl::encoding::Encode<
8296            StorageAdminListStorageInRealmRequest,
8297            fdomain_client::fidl::FDomainResourceDialect,
8298        > for (T0, T1)
8299    {
8300        #[inline]
8301        unsafe fn encode(
8302            self,
8303            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8304            offset: usize,
8305            depth: fidl::encoding::Depth,
8306        ) -> fidl::Result<()> {
8307            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
8308            // Zero out padding regions. There's no need to apply masks
8309            // because the unmasked parts will be overwritten by fields.
8310            unsafe {
8311                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8312                (ptr as *mut u64).write_unaligned(0);
8313            }
8314            // Write the fields.
8315            self.0.encode(encoder, offset + 0, depth)?;
8316            self.1.encode(encoder, offset + 16, depth)?;
8317            Ok(())
8318        }
8319    }
8320
8321    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8322        for StorageAdminListStorageInRealmRequest
8323    {
8324        #[inline(always)]
8325        fn new_empty() -> Self {
8326            Self {
8327                relative_moniker: fidl::new_empty!(
8328                    fidl::encoding::BoundedString<4096>,
8329                    fdomain_client::fidl::FDomainResourceDialect
8330                ),
8331                iterator: fidl::new_empty!(
8332                    fidl::encoding::Endpoint<
8333                        fdomain_client::fidl::ServerEnd<StorageIteratorMarker>,
8334                    >,
8335                    fdomain_client::fidl::FDomainResourceDialect
8336                ),
8337            }
8338        }
8339
8340        #[inline]
8341        unsafe fn decode(
8342            &mut self,
8343            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8344            offset: usize,
8345            _depth: fidl::encoding::Depth,
8346        ) -> fidl::Result<()> {
8347            decoder.debug_check_bounds::<Self>(offset);
8348            // Verify that padding bytes are zero.
8349            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8350            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8351            let mask = 0xffffffff00000000u64;
8352            let maskedval = padval & mask;
8353            if maskedval != 0 {
8354                return Err(fidl::Error::NonZeroPadding {
8355                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8356                });
8357            }
8358            fidl::decode!(
8359                fidl::encoding::BoundedString<4096>,
8360                fdomain_client::fidl::FDomainResourceDialect,
8361                &mut self.relative_moniker,
8362                decoder,
8363                offset + 0,
8364                _depth
8365            )?;
8366            fidl::decode!(
8367                fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<StorageIteratorMarker>>,
8368                fdomain_client::fidl::FDomainResourceDialect,
8369                &mut self.iterator,
8370                decoder,
8371                offset + 16,
8372                _depth
8373            )?;
8374            Ok(())
8375        }
8376    }
8377
8378    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageByIdRequest {
8379        type Borrowed<'a> = &'a mut Self;
8380        fn take_or_borrow<'a>(
8381            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8382        ) -> Self::Borrowed<'a> {
8383            value
8384        }
8385    }
8386
8387    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageByIdRequest {
8388        type Owned = Self;
8389
8390        #[inline(always)]
8391        fn inline_align(_context: fidl::encoding::Context) -> usize {
8392            8
8393        }
8394
8395        #[inline(always)]
8396        fn inline_size(_context: fidl::encoding::Context) -> usize {
8397            24
8398        }
8399    }
8400
8401    unsafe impl
8402        fidl::encoding::Encode<
8403            StorageAdminOpenComponentStorageByIdRequest,
8404            fdomain_client::fidl::FDomainResourceDialect,
8405        > for &mut StorageAdminOpenComponentStorageByIdRequest
8406    {
8407        #[inline]
8408        unsafe fn encode(
8409            self,
8410            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8411            offset: usize,
8412            _depth: fidl::encoding::Depth,
8413        ) -> fidl::Result<()> {
8414            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
8415            // Delegate to tuple encoding.
8416            fidl::encoding::Encode::<
8417                StorageAdminOpenComponentStorageByIdRequest,
8418                fdomain_client::fidl::FDomainResourceDialect,
8419            >::encode(
8420                (
8421                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
8422                        &self.id,
8423                    ),
8424                    <fidl::encoding::Endpoint<
8425                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
8426                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8427                        &mut self.object
8428                    ),
8429                ),
8430                encoder,
8431                offset,
8432                _depth,
8433            )
8434        }
8435    }
8436    unsafe impl<
8437        T0: fidl::encoding::Encode<
8438                fidl::encoding::BoundedString<64>,
8439                fdomain_client::fidl::FDomainResourceDialect,
8440            >,
8441        T1: fidl::encoding::Encode<
8442                fidl::encoding::Endpoint<
8443                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
8444                >,
8445                fdomain_client::fidl::FDomainResourceDialect,
8446            >,
8447    >
8448        fidl::encoding::Encode<
8449            StorageAdminOpenComponentStorageByIdRequest,
8450            fdomain_client::fidl::FDomainResourceDialect,
8451        > for (T0, T1)
8452    {
8453        #[inline]
8454        unsafe fn encode(
8455            self,
8456            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8457            offset: usize,
8458            depth: fidl::encoding::Depth,
8459        ) -> fidl::Result<()> {
8460            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
8461            // Zero out padding regions. There's no need to apply masks
8462            // because the unmasked parts will be overwritten by fields.
8463            unsafe {
8464                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8465                (ptr as *mut u64).write_unaligned(0);
8466            }
8467            // Write the fields.
8468            self.0.encode(encoder, offset + 0, depth)?;
8469            self.1.encode(encoder, offset + 16, depth)?;
8470            Ok(())
8471        }
8472    }
8473
8474    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8475        for StorageAdminOpenComponentStorageByIdRequest
8476    {
8477        #[inline(always)]
8478        fn new_empty() -> Self {
8479            Self {
8480                id: fidl::new_empty!(
8481                    fidl::encoding::BoundedString<64>,
8482                    fdomain_client::fidl::FDomainResourceDialect
8483                ),
8484                object: fidl::new_empty!(
8485                    fidl::encoding::Endpoint<
8486                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
8487                    >,
8488                    fdomain_client::fidl::FDomainResourceDialect
8489                ),
8490            }
8491        }
8492
8493        #[inline]
8494        unsafe fn decode(
8495            &mut self,
8496            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8497            offset: usize,
8498            _depth: fidl::encoding::Depth,
8499        ) -> fidl::Result<()> {
8500            decoder.debug_check_bounds::<Self>(offset);
8501            // Verify that padding bytes are zero.
8502            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8503            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8504            let mask = 0xffffffff00000000u64;
8505            let maskedval = padval & mask;
8506            if maskedval != 0 {
8507                return Err(fidl::Error::NonZeroPadding {
8508                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8509                });
8510            }
8511            fidl::decode!(
8512                fidl::encoding::BoundedString<64>,
8513                fdomain_client::fidl::FDomainResourceDialect,
8514                &mut self.id,
8515                decoder,
8516                offset + 0,
8517                _depth
8518            )?;
8519            fidl::decode!(
8520                fidl::encoding::Endpoint<
8521                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
8522                >,
8523                fdomain_client::fidl::FDomainResourceDialect,
8524                &mut self.object,
8525                decoder,
8526                offset + 16,
8527                _depth
8528            )?;
8529            Ok(())
8530        }
8531    }
8532
8533    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenStorageRequest {
8534        type Borrowed<'a> = &'a mut Self;
8535        fn take_or_borrow<'a>(
8536            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8537        ) -> Self::Borrowed<'a> {
8538            value
8539        }
8540    }
8541
8542    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenStorageRequest {
8543        type Owned = Self;
8544
8545        #[inline(always)]
8546        fn inline_align(_context: fidl::encoding::Context) -> usize {
8547            8
8548        }
8549
8550        #[inline(always)]
8551        fn inline_size(_context: fidl::encoding::Context) -> usize {
8552            24
8553        }
8554    }
8555
8556    unsafe impl
8557        fidl::encoding::Encode<
8558            StorageAdminOpenStorageRequest,
8559            fdomain_client::fidl::FDomainResourceDialect,
8560        > for &mut StorageAdminOpenStorageRequest
8561    {
8562        #[inline]
8563        unsafe fn encode(
8564            self,
8565            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8566            offset: usize,
8567            _depth: fidl::encoding::Depth,
8568        ) -> fidl::Result<()> {
8569            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
8570            // Delegate to tuple encoding.
8571            fidl::encoding::Encode::<StorageAdminOpenStorageRequest, fdomain_client::fidl::FDomainResourceDialect>::encode(
8572                (
8573                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
8574                    <fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
8575                ),
8576                encoder, offset, _depth
8577            )
8578        }
8579    }
8580    unsafe impl<
8581        T0: fidl::encoding::Encode<
8582                fidl::encoding::BoundedString<4096>,
8583                fdomain_client::fidl::FDomainResourceDialect,
8584            >,
8585        T1: fidl::encoding::Encode<
8586                fidl::encoding::Endpoint<
8587                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
8588                >,
8589                fdomain_client::fidl::FDomainResourceDialect,
8590            >,
8591    >
8592        fidl::encoding::Encode<
8593            StorageAdminOpenStorageRequest,
8594            fdomain_client::fidl::FDomainResourceDialect,
8595        > for (T0, T1)
8596    {
8597        #[inline]
8598        unsafe fn encode(
8599            self,
8600            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8601            offset: usize,
8602            depth: fidl::encoding::Depth,
8603        ) -> fidl::Result<()> {
8604            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
8605            // Zero out padding regions. There's no need to apply masks
8606            // because the unmasked parts will be overwritten by fields.
8607            unsafe {
8608                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8609                (ptr as *mut u64).write_unaligned(0);
8610            }
8611            // Write the fields.
8612            self.0.encode(encoder, offset + 0, depth)?;
8613            self.1.encode(encoder, offset + 16, depth)?;
8614            Ok(())
8615        }
8616    }
8617
8618    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8619        for StorageAdminOpenStorageRequest
8620    {
8621        #[inline(always)]
8622        fn new_empty() -> Self {
8623            Self {
8624                relative_moniker: fidl::new_empty!(
8625                    fidl::encoding::BoundedString<4096>,
8626                    fdomain_client::fidl::FDomainResourceDialect
8627                ),
8628                object: fidl::new_empty!(
8629                    fidl::encoding::Endpoint<
8630                        fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
8631                    >,
8632                    fdomain_client::fidl::FDomainResourceDialect
8633                ),
8634            }
8635        }
8636
8637        #[inline]
8638        unsafe fn decode(
8639            &mut self,
8640            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8641            offset: usize,
8642            _depth: fidl::encoding::Depth,
8643        ) -> fidl::Result<()> {
8644            decoder.debug_check_bounds::<Self>(offset);
8645            // Verify that padding bytes are zero.
8646            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8647            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8648            let mask = 0xffffffff00000000u64;
8649            let maskedval = padval & mask;
8650            if maskedval != 0 {
8651                return Err(fidl::Error::NonZeroPadding {
8652                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8653                });
8654            }
8655            fidl::decode!(
8656                fidl::encoding::BoundedString<4096>,
8657                fdomain_client::fidl::FDomainResourceDialect,
8658                &mut self.relative_moniker,
8659                decoder,
8660                offset + 0,
8661                _depth
8662            )?;
8663            fidl::decode!(
8664                fidl::encoding::Endpoint<
8665                    fdomain_client::fidl::ServerEnd<fdomain_fuchsia_io::NodeMarker>,
8666                >,
8667                fdomain_client::fidl::FDomainResourceDialect,
8668                &mut self.object,
8669                decoder,
8670                offset + 16,
8671                _depth
8672            )?;
8673            Ok(())
8674        }
8675    }
8676
8677    impl CapabilityRequestedPayload {
8678        #[inline(always)]
8679        fn max_ordinal_present(&self) -> u64 {
8680            if let Some(_) = self.capability {
8681                return 2;
8682            }
8683            if let Some(_) = self.name {
8684                return 1;
8685            }
8686            0
8687        }
8688    }
8689
8690    impl fidl::encoding::ResourceTypeMarker for CapabilityRequestedPayload {
8691        type Borrowed<'a> = &'a mut Self;
8692        fn take_or_borrow<'a>(
8693            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8694        ) -> Self::Borrowed<'a> {
8695            value
8696        }
8697    }
8698
8699    unsafe impl fidl::encoding::TypeMarker for CapabilityRequestedPayload {
8700        type Owned = Self;
8701
8702        #[inline(always)]
8703        fn inline_align(_context: fidl::encoding::Context) -> usize {
8704            8
8705        }
8706
8707        #[inline(always)]
8708        fn inline_size(_context: fidl::encoding::Context) -> usize {
8709            16
8710        }
8711    }
8712
8713    unsafe impl
8714        fidl::encoding::Encode<
8715            CapabilityRequestedPayload,
8716            fdomain_client::fidl::FDomainResourceDialect,
8717        > for &mut CapabilityRequestedPayload
8718    {
8719        unsafe fn encode(
8720            self,
8721            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8722            offset: usize,
8723            mut depth: fidl::encoding::Depth,
8724        ) -> fidl::Result<()> {
8725            encoder.debug_check_bounds::<CapabilityRequestedPayload>(offset);
8726            // Vector header
8727            let max_ordinal: u64 = self.max_ordinal_present();
8728            encoder.write_num(max_ordinal, offset);
8729            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8730            // Calling encoder.out_of_line_offset(0) is not allowed.
8731            if max_ordinal == 0 {
8732                return Ok(());
8733            }
8734            depth.increment()?;
8735            let envelope_size = 8;
8736            let bytes_len = max_ordinal as usize * envelope_size;
8737            #[allow(unused_variables)]
8738            let offset = encoder.out_of_line_offset(bytes_len);
8739            let mut _prev_end_offset: usize = 0;
8740            if 1 > max_ordinal {
8741                return Ok(());
8742            }
8743
8744            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8745            // are envelope_size bytes.
8746            let cur_offset: usize = (1 - 1) * envelope_size;
8747
8748            // Zero reserved fields.
8749            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8750
8751            // Safety:
8752            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8753            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8754            //   envelope_size bytes, there is always sufficient room.
8755            fidl::encoding::encode_in_envelope_optional::<
8756                fidl::encoding::BoundedString<255>,
8757                fdomain_client::fidl::FDomainResourceDialect,
8758            >(
8759                self.name.as_ref().map(
8760                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
8761                ),
8762                encoder,
8763                offset + cur_offset,
8764                depth,
8765            )?;
8766
8767            _prev_end_offset = cur_offset + envelope_size;
8768            if 2 > max_ordinal {
8769                return Ok(());
8770            }
8771
8772            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8773            // are envelope_size bytes.
8774            let cur_offset: usize = (2 - 1) * envelope_size;
8775
8776            // Zero reserved fields.
8777            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8778
8779            // Safety:
8780            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8781            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8782            //   envelope_size bytes, there is always sufficient room.
8783            fidl::encoding::encode_in_envelope_optional::<
8784                fidl::encoding::HandleType<
8785                    fdomain_client::Channel,
8786                    { fidl::ObjectType::CHANNEL.into_raw() },
8787                    2147483648,
8788                >,
8789                fdomain_client::fidl::FDomainResourceDialect,
8790            >(
8791                self.capability.as_mut().map(
8792                    <fidl::encoding::HandleType<
8793                        fdomain_client::Channel,
8794                        { fidl::ObjectType::CHANNEL.into_raw() },
8795                        2147483648,
8796                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
8797                ),
8798                encoder,
8799                offset + cur_offset,
8800                depth,
8801            )?;
8802
8803            _prev_end_offset = cur_offset + envelope_size;
8804
8805            Ok(())
8806        }
8807    }
8808
8809    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
8810        for CapabilityRequestedPayload
8811    {
8812        #[inline(always)]
8813        fn new_empty() -> Self {
8814            Self::default()
8815        }
8816
8817        unsafe fn decode(
8818            &mut self,
8819            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
8820            offset: usize,
8821            mut depth: fidl::encoding::Depth,
8822        ) -> fidl::Result<()> {
8823            decoder.debug_check_bounds::<Self>(offset);
8824            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8825                None => return Err(fidl::Error::NotNullable),
8826                Some(len) => len,
8827            };
8828            // Calling decoder.out_of_line_offset(0) is not allowed.
8829            if len == 0 {
8830                return Ok(());
8831            };
8832            depth.increment()?;
8833            let envelope_size = 8;
8834            let bytes_len = len * envelope_size;
8835            let offset = decoder.out_of_line_offset(bytes_len)?;
8836            // Decode the envelope for each type.
8837            let mut _next_ordinal_to_read = 0;
8838            let mut next_offset = offset;
8839            let end_offset = offset + bytes_len;
8840            _next_ordinal_to_read += 1;
8841            if next_offset >= end_offset {
8842                return Ok(());
8843            }
8844
8845            // Decode unknown envelopes for gaps in ordinals.
8846            while _next_ordinal_to_read < 1 {
8847                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8848                _next_ordinal_to_read += 1;
8849                next_offset += envelope_size;
8850            }
8851
8852            let next_out_of_line = decoder.next_out_of_line();
8853            let handles_before = decoder.remaining_handles();
8854            if let Some((inlined, num_bytes, num_handles)) =
8855                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8856            {
8857                let member_inline_size =
8858                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
8859                        decoder.context,
8860                    );
8861                if inlined != (member_inline_size <= 4) {
8862                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8863                }
8864                let inner_offset;
8865                let mut inner_depth = depth.clone();
8866                if inlined {
8867                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8868                    inner_offset = next_offset;
8869                } else {
8870                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8871                    inner_depth.increment()?;
8872                }
8873                let val_ref = self.name.get_or_insert_with(|| {
8874                    fidl::new_empty!(
8875                        fidl::encoding::BoundedString<255>,
8876                        fdomain_client::fidl::FDomainResourceDialect
8877                    )
8878                });
8879                fidl::decode!(
8880                    fidl::encoding::BoundedString<255>,
8881                    fdomain_client::fidl::FDomainResourceDialect,
8882                    val_ref,
8883                    decoder,
8884                    inner_offset,
8885                    inner_depth
8886                )?;
8887                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8888                {
8889                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8890                }
8891                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8892                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8893                }
8894            }
8895
8896            next_offset += envelope_size;
8897            _next_ordinal_to_read += 1;
8898            if next_offset >= end_offset {
8899                return Ok(());
8900            }
8901
8902            // Decode unknown envelopes for gaps in ordinals.
8903            while _next_ordinal_to_read < 2 {
8904                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8905                _next_ordinal_to_read += 1;
8906                next_offset += envelope_size;
8907            }
8908
8909            let next_out_of_line = decoder.next_out_of_line();
8910            let handles_before = decoder.remaining_handles();
8911            if let Some((inlined, num_bytes, num_handles)) =
8912                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8913            {
8914                let member_inline_size = <fidl::encoding::HandleType<
8915                    fdomain_client::Channel,
8916                    { fidl::ObjectType::CHANNEL.into_raw() },
8917                    2147483648,
8918                > as fidl::encoding::TypeMarker>::inline_size(
8919                    decoder.context
8920                );
8921                if inlined != (member_inline_size <= 4) {
8922                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8923                }
8924                let inner_offset;
8925                let mut inner_depth = depth.clone();
8926                if inlined {
8927                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8928                    inner_offset = next_offset;
8929                } else {
8930                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8931                    inner_depth.increment()?;
8932                }
8933                let val_ref =
8934                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));
8935                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)?;
8936                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8937                {
8938                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8939                }
8940                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8941                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8942                }
8943            }
8944
8945            next_offset += envelope_size;
8946
8947            // Decode the remaining unknown envelopes.
8948            while next_offset < end_offset {
8949                _next_ordinal_to_read += 1;
8950                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8951                next_offset += envelope_size;
8952            }
8953
8954            Ok(())
8955        }
8956    }
8957
8958    impl CreateChildArgs {
8959        #[inline(always)]
8960        fn max_ordinal_present(&self) -> u64 {
8961            if let Some(_) = self.dictionary {
8962                return 4;
8963            }
8964            if let Some(_) = self.controller {
8965                return 3;
8966            }
8967            if let Some(_) = self.dynamic_offers {
8968                return 2;
8969            }
8970            if let Some(_) = self.numbered_handles {
8971                return 1;
8972            }
8973            0
8974        }
8975    }
8976
8977    impl fidl::encoding::ResourceTypeMarker for CreateChildArgs {
8978        type Borrowed<'a> = &'a mut Self;
8979        fn take_or_borrow<'a>(
8980            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8981        ) -> Self::Borrowed<'a> {
8982            value
8983        }
8984    }
8985
8986    unsafe impl fidl::encoding::TypeMarker for CreateChildArgs {
8987        type Owned = Self;
8988
8989        #[inline(always)]
8990        fn inline_align(_context: fidl::encoding::Context) -> usize {
8991            8
8992        }
8993
8994        #[inline(always)]
8995        fn inline_size(_context: fidl::encoding::Context) -> usize {
8996            16
8997        }
8998    }
8999
9000    unsafe impl
9001        fidl::encoding::Encode<CreateChildArgs, fdomain_client::fidl::FDomainResourceDialect>
9002        for &mut CreateChildArgs
9003    {
9004        unsafe fn encode(
9005            self,
9006            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9007            offset: usize,
9008            mut depth: fidl::encoding::Depth,
9009        ) -> fidl::Result<()> {
9010            encoder.debug_check_bounds::<CreateChildArgs>(offset);
9011            // Vector header
9012            let max_ordinal: u64 = self.max_ordinal_present();
9013            encoder.write_num(max_ordinal, offset);
9014            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9015            // Calling encoder.out_of_line_offset(0) is not allowed.
9016            if max_ordinal == 0 {
9017                return Ok(());
9018            }
9019            depth.increment()?;
9020            let envelope_size = 8;
9021            let bytes_len = max_ordinal as usize * envelope_size;
9022            #[allow(unused_variables)]
9023            let offset = encoder.out_of_line_offset(bytes_len);
9024            let mut _prev_end_offset: usize = 0;
9025            if 1 > max_ordinal {
9026                return Ok(());
9027            }
9028
9029            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9030            // are envelope_size bytes.
9031            let cur_offset: usize = (1 - 1) * envelope_size;
9032
9033            // Zero reserved fields.
9034            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9035
9036            // Safety:
9037            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9038            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9039            //   envelope_size bytes, there is always sufficient room.
9040            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect>(
9041            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9042            encoder, offset + cur_offset, depth
9043        )?;
9044
9045            _prev_end_offset = cur_offset + envelope_size;
9046            if 2 > max_ordinal {
9047                return Ok(());
9048            }
9049
9050            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9051            // are envelope_size bytes.
9052            let cur_offset: usize = (2 - 1) * envelope_size;
9053
9054            // Zero reserved fields.
9055            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9056
9057            // Safety:
9058            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9059            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9060            //   envelope_size bytes, there is always sufficient room.
9061            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect>(
9062            self.dynamic_offers.as_ref().map(<fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow),
9063            encoder, offset + cur_offset, depth
9064        )?;
9065
9066            _prev_end_offset = cur_offset + envelope_size;
9067            if 3 > max_ordinal {
9068                return Ok(());
9069            }
9070
9071            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9072            // are envelope_size bytes.
9073            let cur_offset: usize = (3 - 1) * envelope_size;
9074
9075            // Zero reserved fields.
9076            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9077
9078            // Safety:
9079            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9080            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9081            //   envelope_size bytes, there is always sufficient room.
9082            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>, fdomain_client::fidl::FDomainResourceDialect>(
9083            self.controller.as_mut().map(<fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9084            encoder, offset + cur_offset, depth
9085        )?;
9086
9087            _prev_end_offset = cur_offset + envelope_size;
9088            if 4 > max_ordinal {
9089                return Ok(());
9090            }
9091
9092            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9093            // are envelope_size bytes.
9094            let cur_offset: usize = (4 - 1) * envelope_size;
9095
9096            // Zero reserved fields.
9097            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9098
9099            // Safety:
9100            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9101            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9102            //   envelope_size bytes, there is always sufficient room.
9103            fidl::encoding::encode_in_envelope_optional::<fdomain_fuchsia_component_sandbox::DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
9104            self.dictionary.as_mut().map(<fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9105            encoder, offset + cur_offset, depth
9106        )?;
9107
9108            _prev_end_offset = cur_offset + envelope_size;
9109
9110            Ok(())
9111        }
9112    }
9113
9114    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9115        for CreateChildArgs
9116    {
9117        #[inline(always)]
9118        fn new_empty() -> Self {
9119            Self::default()
9120        }
9121
9122        unsafe fn decode(
9123            &mut self,
9124            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9125            offset: usize,
9126            mut depth: fidl::encoding::Depth,
9127        ) -> fidl::Result<()> {
9128            decoder.debug_check_bounds::<Self>(offset);
9129            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9130                None => return Err(fidl::Error::NotNullable),
9131                Some(len) => len,
9132            };
9133            // Calling decoder.out_of_line_offset(0) is not allowed.
9134            if len == 0 {
9135                return Ok(());
9136            };
9137            depth.increment()?;
9138            let envelope_size = 8;
9139            let bytes_len = len * envelope_size;
9140            let offset = decoder.out_of_line_offset(bytes_len)?;
9141            // Decode the envelope for each type.
9142            let mut _next_ordinal_to_read = 0;
9143            let mut next_offset = offset;
9144            let end_offset = offset + bytes_len;
9145            _next_ordinal_to_read += 1;
9146            if next_offset >= end_offset {
9147                return Ok(());
9148            }
9149
9150            // Decode unknown envelopes for gaps in ordinals.
9151            while _next_ordinal_to_read < 1 {
9152                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9153                _next_ordinal_to_read += 1;
9154                next_offset += envelope_size;
9155            }
9156
9157            let next_out_of_line = decoder.next_out_of_line();
9158            let handles_before = decoder.remaining_handles();
9159            if let Some((inlined, num_bytes, num_handles)) =
9160                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9161            {
9162                let member_inline_size = <fidl::encoding::Vector<
9163                    fdomain_fuchsia_process::HandleInfo,
9164                    128,
9165                > as fidl::encoding::TypeMarker>::inline_size(
9166                    decoder.context
9167                );
9168                if inlined != (member_inline_size <= 4) {
9169                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9170                }
9171                let inner_offset;
9172                let mut inner_depth = depth.clone();
9173                if inlined {
9174                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9175                    inner_offset = next_offset;
9176                } else {
9177                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9178                    inner_depth.increment()?;
9179                }
9180                let val_ref =
9181                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect));
9182                fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9183                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9184                {
9185                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9186                }
9187                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9188                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9189                }
9190            }
9191
9192            next_offset += envelope_size;
9193            _next_ordinal_to_read += 1;
9194            if next_offset >= end_offset {
9195                return Ok(());
9196            }
9197
9198            // Decode unknown envelopes for gaps in ordinals.
9199            while _next_ordinal_to_read < 2 {
9200                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9201                _next_ordinal_to_read += 1;
9202                next_offset += envelope_size;
9203            }
9204
9205            let next_out_of_line = decoder.next_out_of_line();
9206            let handles_before = decoder.remaining_handles();
9207            if let Some((inlined, num_bytes, num_handles)) =
9208                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9209            {
9210                let member_inline_size = <fidl::encoding::Vector<
9211                    fdomain_fuchsia_component_decl::Offer,
9212                    128,
9213                > as fidl::encoding::TypeMarker>::inline_size(
9214                    decoder.context
9215                );
9216                if inlined != (member_inline_size <= 4) {
9217                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9218                }
9219                let inner_offset;
9220                let mut inner_depth = depth.clone();
9221                if inlined {
9222                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9223                    inner_offset = next_offset;
9224                } else {
9225                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9226                    inner_depth.increment()?;
9227                }
9228                let val_ref =
9229                self.dynamic_offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect));
9230                fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_component_decl::Offer, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
9231                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9232                {
9233                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9234                }
9235                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9236                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9237                }
9238            }
9239
9240            next_offset += envelope_size;
9241            _next_ordinal_to_read += 1;
9242            if next_offset >= end_offset {
9243                return Ok(());
9244            }
9245
9246            // Decode unknown envelopes for gaps in ordinals.
9247            while _next_ordinal_to_read < 3 {
9248                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9249                _next_ordinal_to_read += 1;
9250                next_offset += envelope_size;
9251            }
9252
9253            let next_out_of_line = decoder.next_out_of_line();
9254            let handles_before = decoder.remaining_handles();
9255            if let Some((inlined, num_bytes, num_handles)) =
9256                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9257            {
9258                let member_inline_size = <fidl::encoding::Endpoint<
9259                    fdomain_client::fidl::ServerEnd<ControllerMarker>,
9260                > as fidl::encoding::TypeMarker>::inline_size(
9261                    decoder.context
9262                );
9263                if inlined != (member_inline_size <= 4) {
9264                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9265                }
9266                let inner_offset;
9267                let mut inner_depth = depth.clone();
9268                if inlined {
9269                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9270                    inner_offset = next_offset;
9271                } else {
9272                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9273                    inner_depth.increment()?;
9274                }
9275                let val_ref = self.controller.get_or_insert_with(|| {
9276                    fidl::new_empty!(
9277                        fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9278                        fdomain_client::fidl::FDomainResourceDialect
9279                    )
9280                });
9281                fidl::decode!(
9282                    fidl::encoding::Endpoint<fdomain_client::fidl::ServerEnd<ControllerMarker>>,
9283                    fdomain_client::fidl::FDomainResourceDialect,
9284                    val_ref,
9285                    decoder,
9286                    inner_offset,
9287                    inner_depth
9288                )?;
9289                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9290                {
9291                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9292                }
9293                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9294                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9295                }
9296            }
9297
9298            next_offset += envelope_size;
9299            _next_ordinal_to_read += 1;
9300            if next_offset >= end_offset {
9301                return Ok(());
9302            }
9303
9304            // Decode unknown envelopes for gaps in ordinals.
9305            while _next_ordinal_to_read < 4 {
9306                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9307                _next_ordinal_to_read += 1;
9308                next_offset += envelope_size;
9309            }
9310
9311            let next_out_of_line = decoder.next_out_of_line();
9312            let handles_before = decoder.remaining_handles();
9313            if let Some((inlined, num_bytes, num_handles)) =
9314                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9315            {
9316                let member_inline_size = <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9317                if inlined != (member_inline_size <= 4) {
9318                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9319                }
9320                let inner_offset;
9321                let mut inner_depth = depth.clone();
9322                if inlined {
9323                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9324                    inner_offset = next_offset;
9325                } else {
9326                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9327                    inner_depth.increment()?;
9328                }
9329                let val_ref = self.dictionary.get_or_insert_with(|| {
9330                    fidl::new_empty!(
9331                        fdomain_fuchsia_component_sandbox::DictionaryRef,
9332                        fdomain_client::fidl::FDomainResourceDialect
9333                    )
9334                });
9335                fidl::decode!(
9336                    fdomain_fuchsia_component_sandbox::DictionaryRef,
9337                    fdomain_client::fidl::FDomainResourceDialect,
9338                    val_ref,
9339                    decoder,
9340                    inner_offset,
9341                    inner_depth
9342                )?;
9343                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9344                {
9345                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9346                }
9347                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9348                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9349                }
9350            }
9351
9352            next_offset += envelope_size;
9353
9354            // Decode the remaining unknown envelopes.
9355            while next_offset < end_offset {
9356                _next_ordinal_to_read += 1;
9357                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9358                next_offset += envelope_size;
9359            }
9360
9361            Ok(())
9362        }
9363    }
9364
9365    impl DebugStartedPayload {
9366        #[inline(always)]
9367        fn max_ordinal_present(&self) -> u64 {
9368            if let Some(_) = self.break_on_start {
9369                return 2;
9370            }
9371            if let Some(_) = self.runtime_dir {
9372                return 1;
9373            }
9374            0
9375        }
9376    }
9377
9378    impl fidl::encoding::ResourceTypeMarker for DebugStartedPayload {
9379        type Borrowed<'a> = &'a mut Self;
9380        fn take_or_borrow<'a>(
9381            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9382        ) -> Self::Borrowed<'a> {
9383            value
9384        }
9385    }
9386
9387    unsafe impl fidl::encoding::TypeMarker for DebugStartedPayload {
9388        type Owned = Self;
9389
9390        #[inline(always)]
9391        fn inline_align(_context: fidl::encoding::Context) -> usize {
9392            8
9393        }
9394
9395        #[inline(always)]
9396        fn inline_size(_context: fidl::encoding::Context) -> usize {
9397            16
9398        }
9399    }
9400
9401    unsafe impl
9402        fidl::encoding::Encode<DebugStartedPayload, fdomain_client::fidl::FDomainResourceDialect>
9403        for &mut DebugStartedPayload
9404    {
9405        unsafe fn encode(
9406            self,
9407            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9408            offset: usize,
9409            mut depth: fidl::encoding::Depth,
9410        ) -> fidl::Result<()> {
9411            encoder.debug_check_bounds::<DebugStartedPayload>(offset);
9412            // Vector header
9413            let max_ordinal: u64 = self.max_ordinal_present();
9414            encoder.write_num(max_ordinal, offset);
9415            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9416            // Calling encoder.out_of_line_offset(0) is not allowed.
9417            if max_ordinal == 0 {
9418                return Ok(());
9419            }
9420            depth.increment()?;
9421            let envelope_size = 8;
9422            let bytes_len = max_ordinal as usize * envelope_size;
9423            #[allow(unused_variables)]
9424            let offset = encoder.out_of_line_offset(bytes_len);
9425            let mut _prev_end_offset: usize = 0;
9426            if 1 > max_ordinal {
9427                return Ok(());
9428            }
9429
9430            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9431            // are envelope_size bytes.
9432            let cur_offset: usize = (1 - 1) * envelope_size;
9433
9434            // Zero reserved fields.
9435            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9436
9437            // Safety:
9438            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9439            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9440            //   envelope_size bytes, there is always sufficient room.
9441            fidl::encoding::encode_in_envelope_optional::<
9442                fidl::encoding::Endpoint<
9443                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
9444                >,
9445                fdomain_client::fidl::FDomainResourceDialect,
9446            >(
9447                self.runtime_dir.as_mut().map(
9448                    <fidl::encoding::Endpoint<
9449                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
9450                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9451                ),
9452                encoder,
9453                offset + cur_offset,
9454                depth,
9455            )?;
9456
9457            _prev_end_offset = cur_offset + envelope_size;
9458            if 2 > max_ordinal {
9459                return Ok(());
9460            }
9461
9462            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9463            // are envelope_size bytes.
9464            let cur_offset: usize = (2 - 1) * envelope_size;
9465
9466            // Zero reserved fields.
9467            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9468
9469            // Safety:
9470            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9471            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9472            //   envelope_size bytes, there is always sufficient room.
9473            fidl::encoding::encode_in_envelope_optional::<
9474                fidl::encoding::HandleType<
9475                    fdomain_client::EventPair,
9476                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9477                    2147483648,
9478                >,
9479                fdomain_client::fidl::FDomainResourceDialect,
9480            >(
9481                self.break_on_start.as_mut().map(
9482                    <fidl::encoding::HandleType<
9483                        fdomain_client::EventPair,
9484                        { fidl::ObjectType::EVENTPAIR.into_raw() },
9485                        2147483648,
9486                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
9487                ),
9488                encoder,
9489                offset + cur_offset,
9490                depth,
9491            )?;
9492
9493            _prev_end_offset = cur_offset + envelope_size;
9494
9495            Ok(())
9496        }
9497    }
9498
9499    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect>
9500        for DebugStartedPayload
9501    {
9502        #[inline(always)]
9503        fn new_empty() -> Self {
9504            Self::default()
9505        }
9506
9507        unsafe fn decode(
9508            &mut self,
9509            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9510            offset: usize,
9511            mut depth: fidl::encoding::Depth,
9512        ) -> fidl::Result<()> {
9513            decoder.debug_check_bounds::<Self>(offset);
9514            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9515                None => return Err(fidl::Error::NotNullable),
9516                Some(len) => len,
9517            };
9518            // Calling decoder.out_of_line_offset(0) is not allowed.
9519            if len == 0 {
9520                return Ok(());
9521            };
9522            depth.increment()?;
9523            let envelope_size = 8;
9524            let bytes_len = len * envelope_size;
9525            let offset = decoder.out_of_line_offset(bytes_len)?;
9526            // Decode the envelope for each type.
9527            let mut _next_ordinal_to_read = 0;
9528            let mut next_offset = offset;
9529            let end_offset = offset + bytes_len;
9530            _next_ordinal_to_read += 1;
9531            if next_offset >= end_offset {
9532                return Ok(());
9533            }
9534
9535            // Decode unknown envelopes for gaps in ordinals.
9536            while _next_ordinal_to_read < 1 {
9537                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9538                _next_ordinal_to_read += 1;
9539                next_offset += envelope_size;
9540            }
9541
9542            let next_out_of_line = decoder.next_out_of_line();
9543            let handles_before = decoder.remaining_handles();
9544            if let Some((inlined, num_bytes, num_handles)) =
9545                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9546            {
9547                let member_inline_size = <fidl::encoding::Endpoint<
9548                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
9549                > as fidl::encoding::TypeMarker>::inline_size(
9550                    decoder.context
9551                );
9552                if inlined != (member_inline_size <= 4) {
9553                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9554                }
9555                let inner_offset;
9556                let mut inner_depth = depth.clone();
9557                if inlined {
9558                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9559                    inner_offset = next_offset;
9560                } else {
9561                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9562                    inner_depth.increment()?;
9563                }
9564                let val_ref = self.runtime_dir.get_or_insert_with(|| {
9565                    fidl::new_empty!(
9566                        fidl::encoding::Endpoint<
9567                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
9568                        >,
9569                        fdomain_client::fidl::FDomainResourceDialect
9570                    )
9571                });
9572                fidl::decode!(
9573                    fidl::encoding::Endpoint<
9574                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
9575                    >,
9576                    fdomain_client::fidl::FDomainResourceDialect,
9577                    val_ref,
9578                    decoder,
9579                    inner_offset,
9580                    inner_depth
9581                )?;
9582                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9583                {
9584                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9585                }
9586                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9587                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9588                }
9589            }
9590
9591            next_offset += envelope_size;
9592            _next_ordinal_to_read += 1;
9593            if next_offset >= end_offset {
9594                return Ok(());
9595            }
9596
9597            // Decode unknown envelopes for gaps in ordinals.
9598            while _next_ordinal_to_read < 2 {
9599                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9600                _next_ordinal_to_read += 1;
9601                next_offset += envelope_size;
9602            }
9603
9604            let next_out_of_line = decoder.next_out_of_line();
9605            let handles_before = decoder.remaining_handles();
9606            if let Some((inlined, num_bytes, num_handles)) =
9607                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9608            {
9609                let member_inline_size = <fidl::encoding::HandleType<
9610                    fdomain_client::EventPair,
9611                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9612                    2147483648,
9613                > as fidl::encoding::TypeMarker>::inline_size(
9614                    decoder.context
9615                );
9616                if inlined != (member_inline_size <= 4) {
9617                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9618                }
9619                let inner_offset;
9620                let mut inner_depth = depth.clone();
9621                if inlined {
9622                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9623                    inner_offset = next_offset;
9624                } else {
9625                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9626                    inner_depth.increment()?;
9627                }
9628                let val_ref =
9629                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));
9630                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)?;
9631                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9632                {
9633                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9634                }
9635                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9636                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9637                }
9638            }
9639
9640            next_offset += envelope_size;
9641
9642            // Decode the remaining unknown envelopes.
9643            while next_offset < end_offset {
9644                _next_ordinal_to_read += 1;
9645                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9646                next_offset += envelope_size;
9647            }
9648
9649            Ok(())
9650        }
9651    }
9652
9653    impl Event {
9654        #[inline(always)]
9655        fn max_ordinal_present(&self) -> u64 {
9656            if let Some(_) = self.payload {
9657                return 2;
9658            }
9659            if let Some(_) = self.header {
9660                return 1;
9661            }
9662            0
9663        }
9664    }
9665
9666    impl fidl::encoding::ResourceTypeMarker for Event {
9667        type Borrowed<'a> = &'a mut Self;
9668        fn take_or_borrow<'a>(
9669            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9670        ) -> Self::Borrowed<'a> {
9671            value
9672        }
9673    }
9674
9675    unsafe impl fidl::encoding::TypeMarker for Event {
9676        type Owned = Self;
9677
9678        #[inline(always)]
9679        fn inline_align(_context: fidl::encoding::Context) -> usize {
9680            8
9681        }
9682
9683        #[inline(always)]
9684        fn inline_size(_context: fidl::encoding::Context) -> usize {
9685            16
9686        }
9687    }
9688
9689    unsafe impl fidl::encoding::Encode<Event, fdomain_client::fidl::FDomainResourceDialect>
9690        for &mut Event
9691    {
9692        unsafe fn encode(
9693            self,
9694            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9695            offset: usize,
9696            mut depth: fidl::encoding::Depth,
9697        ) -> fidl::Result<()> {
9698            encoder.debug_check_bounds::<Event>(offset);
9699            // Vector header
9700            let max_ordinal: u64 = self.max_ordinal_present();
9701            encoder.write_num(max_ordinal, offset);
9702            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9703            // Calling encoder.out_of_line_offset(0) is not allowed.
9704            if max_ordinal == 0 {
9705                return Ok(());
9706            }
9707            depth.increment()?;
9708            let envelope_size = 8;
9709            let bytes_len = max_ordinal as usize * envelope_size;
9710            #[allow(unused_variables)]
9711            let offset = encoder.out_of_line_offset(bytes_len);
9712            let mut _prev_end_offset: usize = 0;
9713            if 1 > max_ordinal {
9714                return Ok(());
9715            }
9716
9717            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9718            // are envelope_size bytes.
9719            let cur_offset: usize = (1 - 1) * envelope_size;
9720
9721            // Zero reserved fields.
9722            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9723
9724            // Safety:
9725            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9726            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9727            //   envelope_size bytes, there is always sufficient room.
9728            fidl::encoding::encode_in_envelope_optional::<
9729                EventHeader,
9730                fdomain_client::fidl::FDomainResourceDialect,
9731            >(
9732                self.header.as_ref().map(<EventHeader as fidl::encoding::ValueTypeMarker>::borrow),
9733                encoder,
9734                offset + cur_offset,
9735                depth,
9736            )?;
9737
9738            _prev_end_offset = cur_offset + envelope_size;
9739            if 2 > max_ordinal {
9740                return Ok(());
9741            }
9742
9743            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9744            // are envelope_size bytes.
9745            let cur_offset: usize = (2 - 1) * envelope_size;
9746
9747            // Zero reserved fields.
9748            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9749
9750            // Safety:
9751            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9752            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9753            //   envelope_size bytes, there is always sufficient room.
9754            fidl::encoding::encode_in_envelope_optional::<
9755                EventPayload,
9756                fdomain_client::fidl::FDomainResourceDialect,
9757            >(
9758                self.payload
9759                    .as_mut()
9760                    .map(<EventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
9761                encoder,
9762                offset + cur_offset,
9763                depth,
9764            )?;
9765
9766            _prev_end_offset = cur_offset + envelope_size;
9767
9768            Ok(())
9769        }
9770    }
9771
9772    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for Event {
9773        #[inline(always)]
9774        fn new_empty() -> Self {
9775            Self::default()
9776        }
9777
9778        unsafe fn decode(
9779            &mut self,
9780            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9781            offset: usize,
9782            mut depth: fidl::encoding::Depth,
9783        ) -> fidl::Result<()> {
9784            decoder.debug_check_bounds::<Self>(offset);
9785            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9786                None => return Err(fidl::Error::NotNullable),
9787                Some(len) => len,
9788            };
9789            // Calling decoder.out_of_line_offset(0) is not allowed.
9790            if len == 0 {
9791                return Ok(());
9792            };
9793            depth.increment()?;
9794            let envelope_size = 8;
9795            let bytes_len = len * envelope_size;
9796            let offset = decoder.out_of_line_offset(bytes_len)?;
9797            // Decode the envelope for each type.
9798            let mut _next_ordinal_to_read = 0;
9799            let mut next_offset = offset;
9800            let end_offset = offset + bytes_len;
9801            _next_ordinal_to_read += 1;
9802            if next_offset >= end_offset {
9803                return Ok(());
9804            }
9805
9806            // Decode unknown envelopes for gaps in ordinals.
9807            while _next_ordinal_to_read < 1 {
9808                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9809                _next_ordinal_to_read += 1;
9810                next_offset += envelope_size;
9811            }
9812
9813            let next_out_of_line = decoder.next_out_of_line();
9814            let handles_before = decoder.remaining_handles();
9815            if let Some((inlined, num_bytes, num_handles)) =
9816                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9817            {
9818                let member_inline_size =
9819                    <EventHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9820                if inlined != (member_inline_size <= 4) {
9821                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9822                }
9823                let inner_offset;
9824                let mut inner_depth = depth.clone();
9825                if inlined {
9826                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9827                    inner_offset = next_offset;
9828                } else {
9829                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9830                    inner_depth.increment()?;
9831                }
9832                let val_ref = self.header.get_or_insert_with(|| {
9833                    fidl::new_empty!(EventHeader, fdomain_client::fidl::FDomainResourceDialect)
9834                });
9835                fidl::decode!(
9836                    EventHeader,
9837                    fdomain_client::fidl::FDomainResourceDialect,
9838                    val_ref,
9839                    decoder,
9840                    inner_offset,
9841                    inner_depth
9842                )?;
9843                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9844                {
9845                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9846                }
9847                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9848                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9849                }
9850            }
9851
9852            next_offset += envelope_size;
9853            _next_ordinal_to_read += 1;
9854            if next_offset >= end_offset {
9855                return Ok(());
9856            }
9857
9858            // Decode unknown envelopes for gaps in ordinals.
9859            while _next_ordinal_to_read < 2 {
9860                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9861                _next_ordinal_to_read += 1;
9862                next_offset += envelope_size;
9863            }
9864
9865            let next_out_of_line = decoder.next_out_of_line();
9866            let handles_before = decoder.remaining_handles();
9867            if let Some((inlined, num_bytes, num_handles)) =
9868                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9869            {
9870                let member_inline_size =
9871                    <EventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9872                if inlined != (member_inline_size <= 4) {
9873                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9874                }
9875                let inner_offset;
9876                let mut inner_depth = depth.clone();
9877                if inlined {
9878                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9879                    inner_offset = next_offset;
9880                } else {
9881                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9882                    inner_depth.increment()?;
9883                }
9884                let val_ref = self.payload.get_or_insert_with(|| {
9885                    fidl::new_empty!(EventPayload, fdomain_client::fidl::FDomainResourceDialect)
9886                });
9887                fidl::decode!(
9888                    EventPayload,
9889                    fdomain_client::fidl::FDomainResourceDialect,
9890                    val_ref,
9891                    decoder,
9892                    inner_offset,
9893                    inner_depth
9894                )?;
9895                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9896                {
9897                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9898                }
9899                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9900                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9901                }
9902            }
9903
9904            next_offset += envelope_size;
9905
9906            // Decode the remaining unknown envelopes.
9907            while next_offset < end_offset {
9908                _next_ordinal_to_read += 1;
9909                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9910                next_offset += envelope_size;
9911            }
9912
9913            Ok(())
9914        }
9915    }
9916
9917    impl NamespaceEntry {
9918        #[inline(always)]
9919        fn max_ordinal_present(&self) -> u64 {
9920            if let Some(_) = self.directory {
9921                return 2;
9922            }
9923            if let Some(_) = self.path {
9924                return 1;
9925            }
9926            0
9927        }
9928    }
9929
9930    impl fidl::encoding::ResourceTypeMarker for NamespaceEntry {
9931        type Borrowed<'a> = &'a mut Self;
9932        fn take_or_borrow<'a>(
9933            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9934        ) -> Self::Borrowed<'a> {
9935            value
9936        }
9937    }
9938
9939    unsafe impl fidl::encoding::TypeMarker for NamespaceEntry {
9940        type Owned = Self;
9941
9942        #[inline(always)]
9943        fn inline_align(_context: fidl::encoding::Context) -> usize {
9944            8
9945        }
9946
9947        #[inline(always)]
9948        fn inline_size(_context: fidl::encoding::Context) -> usize {
9949            16
9950        }
9951    }
9952
9953    unsafe impl fidl::encoding::Encode<NamespaceEntry, fdomain_client::fidl::FDomainResourceDialect>
9954        for &mut NamespaceEntry
9955    {
9956        unsafe fn encode(
9957            self,
9958            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
9959            offset: usize,
9960            mut depth: fidl::encoding::Depth,
9961        ) -> fidl::Result<()> {
9962            encoder.debug_check_bounds::<NamespaceEntry>(offset);
9963            // Vector header
9964            let max_ordinal: u64 = self.max_ordinal_present();
9965            encoder.write_num(max_ordinal, offset);
9966            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9967            // Calling encoder.out_of_line_offset(0) is not allowed.
9968            if max_ordinal == 0 {
9969                return Ok(());
9970            }
9971            depth.increment()?;
9972            let envelope_size = 8;
9973            let bytes_len = max_ordinal as usize * envelope_size;
9974            #[allow(unused_variables)]
9975            let offset = encoder.out_of_line_offset(bytes_len);
9976            let mut _prev_end_offset: usize = 0;
9977            if 1 > max_ordinal {
9978                return Ok(());
9979            }
9980
9981            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9982            // are envelope_size bytes.
9983            let cur_offset: usize = (1 - 1) * envelope_size;
9984
9985            // Zero reserved fields.
9986            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9987
9988            // Safety:
9989            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9990            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9991            //   envelope_size bytes, there is always sufficient room.
9992            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fdomain_client::fidl::FDomainResourceDialect>(
9993            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
9994            encoder, offset + cur_offset, depth
9995        )?;
9996
9997            _prev_end_offset = cur_offset + envelope_size;
9998            if 2 > max_ordinal {
9999                return Ok(());
10000            }
10001
10002            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10003            // are envelope_size bytes.
10004            let cur_offset: usize = (2 - 1) * envelope_size;
10005
10006            // Zero reserved fields.
10007            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10008
10009            // Safety:
10010            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10011            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10012            //   envelope_size bytes, there is always sufficient room.
10013            fidl::encoding::encode_in_envelope_optional::<
10014                fidl::encoding::Endpoint<
10015                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
10016                >,
10017                fdomain_client::fidl::FDomainResourceDialect,
10018            >(
10019                self.directory.as_mut().map(
10020                    <fidl::encoding::Endpoint<
10021                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
10022                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
10023                ),
10024                encoder,
10025                offset + cur_offset,
10026                depth,
10027            )?;
10028
10029            _prev_end_offset = cur_offset + envelope_size;
10030
10031            Ok(())
10032        }
10033    }
10034
10035    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for NamespaceEntry {
10036        #[inline(always)]
10037        fn new_empty() -> Self {
10038            Self::default()
10039        }
10040
10041        unsafe fn decode(
10042            &mut self,
10043            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10044            offset: usize,
10045            mut depth: fidl::encoding::Depth,
10046        ) -> fidl::Result<()> {
10047            decoder.debug_check_bounds::<Self>(offset);
10048            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10049                None => return Err(fidl::Error::NotNullable),
10050                Some(len) => len,
10051            };
10052            // Calling decoder.out_of_line_offset(0) is not allowed.
10053            if len == 0 {
10054                return Ok(());
10055            };
10056            depth.increment()?;
10057            let envelope_size = 8;
10058            let bytes_len = len * envelope_size;
10059            let offset = decoder.out_of_line_offset(bytes_len)?;
10060            // Decode the envelope for each type.
10061            let mut _next_ordinal_to_read = 0;
10062            let mut next_offset = offset;
10063            let end_offset = offset + bytes_len;
10064            _next_ordinal_to_read += 1;
10065            if next_offset >= end_offset {
10066                return Ok(());
10067            }
10068
10069            // Decode unknown envelopes for gaps in ordinals.
10070            while _next_ordinal_to_read < 1 {
10071                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10072                _next_ordinal_to_read += 1;
10073                next_offset += envelope_size;
10074            }
10075
10076            let next_out_of_line = decoder.next_out_of_line();
10077            let handles_before = decoder.remaining_handles();
10078            if let Some((inlined, num_bytes, num_handles)) =
10079                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10080            {
10081                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10082                if inlined != (member_inline_size <= 4) {
10083                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10084                }
10085                let inner_offset;
10086                let mut inner_depth = depth.clone();
10087                if inlined {
10088                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10089                    inner_offset = next_offset;
10090                } else {
10091                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10092                    inner_depth.increment()?;
10093                }
10094                let val_ref = self.path.get_or_insert_with(|| {
10095                    fidl::new_empty!(
10096                        fidl::encoding::BoundedString<4095>,
10097                        fdomain_client::fidl::FDomainResourceDialect
10098                    )
10099                });
10100                fidl::decode!(
10101                    fidl::encoding::BoundedString<4095>,
10102                    fdomain_client::fidl::FDomainResourceDialect,
10103                    val_ref,
10104                    decoder,
10105                    inner_offset,
10106                    inner_depth
10107                )?;
10108                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10109                {
10110                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10111                }
10112                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10113                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10114                }
10115            }
10116
10117            next_offset += envelope_size;
10118            _next_ordinal_to_read += 1;
10119            if next_offset >= end_offset {
10120                return Ok(());
10121            }
10122
10123            // Decode unknown envelopes for gaps in ordinals.
10124            while _next_ordinal_to_read < 2 {
10125                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10126                _next_ordinal_to_read += 1;
10127                next_offset += envelope_size;
10128            }
10129
10130            let next_out_of_line = decoder.next_out_of_line();
10131            let handles_before = decoder.remaining_handles();
10132            if let Some((inlined, num_bytes, num_handles)) =
10133                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10134            {
10135                let member_inline_size = <fidl::encoding::Endpoint<
10136                    fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
10137                > as fidl::encoding::TypeMarker>::inline_size(
10138                    decoder.context
10139                );
10140                if inlined != (member_inline_size <= 4) {
10141                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10142                }
10143                let inner_offset;
10144                let mut inner_depth = depth.clone();
10145                if inlined {
10146                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10147                    inner_offset = next_offset;
10148                } else {
10149                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10150                    inner_depth.increment()?;
10151                }
10152                let val_ref = self.directory.get_or_insert_with(|| {
10153                    fidl::new_empty!(
10154                        fidl::encoding::Endpoint<
10155                            fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
10156                        >,
10157                        fdomain_client::fidl::FDomainResourceDialect
10158                    )
10159                });
10160                fidl::decode!(
10161                    fidl::encoding::Endpoint<
10162                        fdomain_client::fidl::ClientEnd<fdomain_fuchsia_io::DirectoryMarker>,
10163                    >,
10164                    fdomain_client::fidl::FDomainResourceDialect,
10165                    val_ref,
10166                    decoder,
10167                    inner_offset,
10168                    inner_depth
10169                )?;
10170                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10171                {
10172                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10173                }
10174                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10175                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10176                }
10177            }
10178
10179            next_offset += envelope_size;
10180
10181            // Decode the remaining unknown envelopes.
10182            while next_offset < end_offset {
10183                _next_ordinal_to_read += 1;
10184                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10185                next_offset += envelope_size;
10186            }
10187
10188            Ok(())
10189        }
10190    }
10191
10192    impl StartChildArgs {
10193        #[inline(always)]
10194        fn max_ordinal_present(&self) -> u64 {
10195            if let Some(_) = self.dictionary {
10196                return 3;
10197            }
10198            if let Some(_) = self.namespace_entries {
10199                return 2;
10200            }
10201            if let Some(_) = self.numbered_handles {
10202                return 1;
10203            }
10204            0
10205        }
10206    }
10207
10208    impl fidl::encoding::ResourceTypeMarker for StartChildArgs {
10209        type Borrowed<'a> = &'a mut Self;
10210        fn take_or_borrow<'a>(
10211            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10212        ) -> Self::Borrowed<'a> {
10213            value
10214        }
10215    }
10216
10217    unsafe impl fidl::encoding::TypeMarker for StartChildArgs {
10218        type Owned = Self;
10219
10220        #[inline(always)]
10221        fn inline_align(_context: fidl::encoding::Context) -> usize {
10222            8
10223        }
10224
10225        #[inline(always)]
10226        fn inline_size(_context: fidl::encoding::Context) -> usize {
10227            16
10228        }
10229    }
10230
10231    unsafe impl fidl::encoding::Encode<StartChildArgs, fdomain_client::fidl::FDomainResourceDialect>
10232        for &mut StartChildArgs
10233    {
10234        unsafe fn encode(
10235            self,
10236            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10237            offset: usize,
10238            mut depth: fidl::encoding::Depth,
10239        ) -> fidl::Result<()> {
10240            encoder.debug_check_bounds::<StartChildArgs>(offset);
10241            // Vector header
10242            let max_ordinal: u64 = self.max_ordinal_present();
10243            encoder.write_num(max_ordinal, offset);
10244            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10245            // Calling encoder.out_of_line_offset(0) is not allowed.
10246            if max_ordinal == 0 {
10247                return Ok(());
10248            }
10249            depth.increment()?;
10250            let envelope_size = 8;
10251            let bytes_len = max_ordinal as usize * envelope_size;
10252            #[allow(unused_variables)]
10253            let offset = encoder.out_of_line_offset(bytes_len);
10254            let mut _prev_end_offset: usize = 0;
10255            if 1 > max_ordinal {
10256                return Ok(());
10257            }
10258
10259            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10260            // are envelope_size bytes.
10261            let cur_offset: usize = (1 - 1) * envelope_size;
10262
10263            // Zero reserved fields.
10264            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10265
10266            // Safety:
10267            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10268            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10269            //   envelope_size bytes, there is always sufficient room.
10270            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect>(
10271            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10272            encoder, offset + cur_offset, depth
10273        )?;
10274
10275            _prev_end_offset = cur_offset + envelope_size;
10276            if 2 > max_ordinal {
10277                return Ok(());
10278            }
10279
10280            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10281            // are envelope_size bytes.
10282            let cur_offset: usize = (2 - 1) * envelope_size;
10283
10284            // Zero reserved fields.
10285            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10286
10287            // Safety:
10288            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10289            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10290            //   envelope_size bytes, there is always sufficient room.
10291            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect>(
10292            self.namespace_entries.as_mut().map(<fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10293            encoder, offset + cur_offset, depth
10294        )?;
10295
10296            _prev_end_offset = cur_offset + envelope_size;
10297            if 3 > max_ordinal {
10298                return Ok(());
10299            }
10300
10301            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10302            // are envelope_size bytes.
10303            let cur_offset: usize = (3 - 1) * envelope_size;
10304
10305            // Zero reserved fields.
10306            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10307
10308            // Safety:
10309            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10310            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10311            //   envelope_size bytes, there is always sufficient room.
10312            fidl::encoding::encode_in_envelope_optional::<fdomain_fuchsia_component_sandbox::DictionaryRef, fdomain_client::fidl::FDomainResourceDialect>(
10313            self.dictionary.as_mut().map(<fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
10314            encoder, offset + cur_offset, depth
10315        )?;
10316
10317            _prev_end_offset = cur_offset + envelope_size;
10318
10319            Ok(())
10320        }
10321    }
10322
10323    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for StartChildArgs {
10324        #[inline(always)]
10325        fn new_empty() -> Self {
10326            Self::default()
10327        }
10328
10329        unsafe fn decode(
10330            &mut self,
10331            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10332            offset: usize,
10333            mut depth: fidl::encoding::Depth,
10334        ) -> fidl::Result<()> {
10335            decoder.debug_check_bounds::<Self>(offset);
10336            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10337                None => return Err(fidl::Error::NotNullable),
10338                Some(len) => len,
10339            };
10340            // Calling decoder.out_of_line_offset(0) is not allowed.
10341            if len == 0 {
10342                return Ok(());
10343            };
10344            depth.increment()?;
10345            let envelope_size = 8;
10346            let bytes_len = len * envelope_size;
10347            let offset = decoder.out_of_line_offset(bytes_len)?;
10348            // Decode the envelope for each type.
10349            let mut _next_ordinal_to_read = 0;
10350            let mut next_offset = offset;
10351            let end_offset = offset + bytes_len;
10352            _next_ordinal_to_read += 1;
10353            if next_offset >= end_offset {
10354                return Ok(());
10355            }
10356
10357            // Decode unknown envelopes for gaps in ordinals.
10358            while _next_ordinal_to_read < 1 {
10359                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10360                _next_ordinal_to_read += 1;
10361                next_offset += envelope_size;
10362            }
10363
10364            let next_out_of_line = decoder.next_out_of_line();
10365            let handles_before = decoder.remaining_handles();
10366            if let Some((inlined, num_bytes, num_handles)) =
10367                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10368            {
10369                let member_inline_size = <fidl::encoding::Vector<
10370                    fdomain_fuchsia_process::HandleInfo,
10371                    128,
10372                > as fidl::encoding::TypeMarker>::inline_size(
10373                    decoder.context
10374                );
10375                if inlined != (member_inline_size <= 4) {
10376                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10377                }
10378                let inner_offset;
10379                let mut inner_depth = depth.clone();
10380                if inlined {
10381                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10382                    inner_offset = next_offset;
10383                } else {
10384                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10385                    inner_depth.increment()?;
10386                }
10387                let val_ref =
10388                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect));
10389                fidl::decode!(fidl::encoding::Vector<fdomain_fuchsia_process::HandleInfo, 128>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10390                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10391                {
10392                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10393                }
10394                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10395                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10396                }
10397            }
10398
10399            next_offset += envelope_size;
10400            _next_ordinal_to_read += 1;
10401            if next_offset >= end_offset {
10402                return Ok(());
10403            }
10404
10405            // Decode unknown envelopes for gaps in ordinals.
10406            while _next_ordinal_to_read < 2 {
10407                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10408                _next_ordinal_to_read += 1;
10409                next_offset += envelope_size;
10410            }
10411
10412            let next_out_of_line = decoder.next_out_of_line();
10413            let handles_before = decoder.remaining_handles();
10414            if let Some((inlined, num_bytes, num_handles)) =
10415                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10416            {
10417                let member_inline_size = <fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10418                if inlined != (member_inline_size <= 4) {
10419                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10420                }
10421                let inner_offset;
10422                let mut inner_depth = depth.clone();
10423                if inlined {
10424                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10425                    inner_offset = next_offset;
10426                } else {
10427                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10428                    inner_depth.increment()?;
10429                }
10430                let val_ref =
10431                self.namespace_entries.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect));
10432                fidl::decode!(fidl::encoding::Vector<NamespaceEntry, 32>, fdomain_client::fidl::FDomainResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
10433                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10434                {
10435                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10436                }
10437                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10438                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10439                }
10440            }
10441
10442            next_offset += envelope_size;
10443            _next_ordinal_to_read += 1;
10444            if next_offset >= end_offset {
10445                return Ok(());
10446            }
10447
10448            // Decode unknown envelopes for gaps in ordinals.
10449            while _next_ordinal_to_read < 3 {
10450                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10451                _next_ordinal_to_read += 1;
10452                next_offset += envelope_size;
10453            }
10454
10455            let next_out_of_line = decoder.next_out_of_line();
10456            let handles_before = decoder.remaining_handles();
10457            if let Some((inlined, num_bytes, num_handles)) =
10458                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10459            {
10460                let member_inline_size = <fdomain_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10461                if inlined != (member_inline_size <= 4) {
10462                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10463                }
10464                let inner_offset;
10465                let mut inner_depth = depth.clone();
10466                if inlined {
10467                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10468                    inner_offset = next_offset;
10469                } else {
10470                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10471                    inner_depth.increment()?;
10472                }
10473                let val_ref = self.dictionary.get_or_insert_with(|| {
10474                    fidl::new_empty!(
10475                        fdomain_fuchsia_component_sandbox::DictionaryRef,
10476                        fdomain_client::fidl::FDomainResourceDialect
10477                    )
10478                });
10479                fidl::decode!(
10480                    fdomain_fuchsia_component_sandbox::DictionaryRef,
10481                    fdomain_client::fidl::FDomainResourceDialect,
10482                    val_ref,
10483                    decoder,
10484                    inner_offset,
10485                    inner_depth
10486                )?;
10487                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10488                {
10489                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10490                }
10491                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10492                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10493                }
10494            }
10495
10496            next_offset += envelope_size;
10497
10498            // Decode the remaining unknown envelopes.
10499            while next_offset < end_offset {
10500                _next_ordinal_to_read += 1;
10501                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10502                next_offset += envelope_size;
10503            }
10504
10505            Ok(())
10506        }
10507    }
10508
10509    impl fidl::encoding::ResourceTypeMarker for EventPayload {
10510        type Borrowed<'a> = &'a mut Self;
10511        fn take_or_borrow<'a>(
10512            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10513        ) -> Self::Borrowed<'a> {
10514            value
10515        }
10516    }
10517
10518    unsafe impl fidl::encoding::TypeMarker for EventPayload {
10519        type Owned = Self;
10520
10521        #[inline(always)]
10522        fn inline_align(_context: fidl::encoding::Context) -> usize {
10523            8
10524        }
10525
10526        #[inline(always)]
10527        fn inline_size(_context: fidl::encoding::Context) -> usize {
10528            16
10529        }
10530    }
10531
10532    unsafe impl fidl::encoding::Encode<EventPayload, fdomain_client::fidl::FDomainResourceDialect>
10533        for &mut EventPayload
10534    {
10535        #[inline]
10536        unsafe fn encode(
10537            self,
10538            encoder: &mut fidl::encoding::Encoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10539            offset: usize,
10540            _depth: fidl::encoding::Depth,
10541        ) -> fidl::Result<()> {
10542            encoder.debug_check_bounds::<EventPayload>(offset);
10543            encoder.write_num::<u64>(self.ordinal(), offset);
10544            match self {
10545            EventPayload::CapabilityRequested(ref mut val) => {
10546                fidl::encoding::encode_in_envelope::<CapabilityRequestedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10547                    <CapabilityRequestedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
10548                    encoder, offset + 8, _depth
10549                )
10550            }
10551            EventPayload::Purged(ref val) => {
10552                fidl::encoding::encode_in_envelope::<PurgedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10553                    <PurgedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
10554                    encoder, offset + 8, _depth
10555                )
10556            }
10557            EventPayload::Discovered(ref val) => {
10558                fidl::encoding::encode_in_envelope::<DiscoveredPayload, fdomain_client::fidl::FDomainResourceDialect>(
10559                    <DiscoveredPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
10560                    encoder, offset + 8, _depth
10561                )
10562            }
10563            EventPayload::Destroyed(ref val) => {
10564                fidl::encoding::encode_in_envelope::<DestroyedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10565                    <DestroyedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
10566                    encoder, offset + 8, _depth
10567                )
10568            }
10569            EventPayload::Resolved(ref val) => {
10570                fidl::encoding::encode_in_envelope::<ResolvedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10571                    <ResolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
10572                    encoder, offset + 8, _depth
10573                )
10574            }
10575            EventPayload::Started(ref val) => {
10576                fidl::encoding::encode_in_envelope::<StartedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10577                    <StartedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
10578                    encoder, offset + 8, _depth
10579                )
10580            }
10581            EventPayload::Stopped(ref val) => {
10582                fidl::encoding::encode_in_envelope::<StoppedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10583                    <StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
10584                    encoder, offset + 8, _depth
10585                )
10586            }
10587            EventPayload::DebugStarted(ref mut val) => {
10588                fidl::encoding::encode_in_envelope::<DebugStartedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10589                    <DebugStartedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
10590                    encoder, offset + 8, _depth
10591                )
10592            }
10593            EventPayload::Unresolved(ref val) => {
10594                fidl::encoding::encode_in_envelope::<UnresolvedPayload, fdomain_client::fidl::FDomainResourceDialect>(
10595                    <UnresolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
10596                    encoder, offset + 8, _depth
10597                )
10598            }
10599            EventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
10600        }
10601        }
10602    }
10603
10604    impl fidl::encoding::Decode<Self, fdomain_client::fidl::FDomainResourceDialect> for EventPayload {
10605        #[inline(always)]
10606        fn new_empty() -> Self {
10607            Self::__SourceBreaking { unknown_ordinal: 0 }
10608        }
10609
10610        #[inline]
10611        unsafe fn decode(
10612            &mut self,
10613            decoder: &mut fidl::encoding::Decoder<'_, fdomain_client::fidl::FDomainResourceDialect>,
10614            offset: usize,
10615            mut depth: fidl::encoding::Depth,
10616        ) -> fidl::Result<()> {
10617            decoder.debug_check_bounds::<Self>(offset);
10618            #[allow(unused_variables)]
10619            let next_out_of_line = decoder.next_out_of_line();
10620            let handles_before = decoder.remaining_handles();
10621            let (ordinal, inlined, num_bytes, num_handles) =
10622                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
10623
10624            let member_inline_size = match ordinal {
10625                1 => <CapabilityRequestedPayload as fidl::encoding::TypeMarker>::inline_size(
10626                    decoder.context,
10627                ),
10628                2 => <PurgedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10629                4 => {
10630                    <DiscoveredPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
10631                }
10632                5 => <DestroyedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10633                6 => <ResolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10634                7 => <StartedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10635                8 => <StoppedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
10636                9 => <DebugStartedPayload as fidl::encoding::TypeMarker>::inline_size(
10637                    decoder.context,
10638                ),
10639                10 => {
10640                    <UnresolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
10641                }
10642                0 => return Err(fidl::Error::UnknownUnionTag),
10643                _ => num_bytes as usize,
10644            };
10645
10646            if inlined != (member_inline_size <= 4) {
10647                return Err(fidl::Error::InvalidInlineBitInEnvelope);
10648            }
10649            let _inner_offset;
10650            if inlined {
10651                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
10652                _inner_offset = offset + 8;
10653            } else {
10654                depth.increment()?;
10655                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10656            }
10657            match ordinal {
10658                1 => {
10659                    #[allow(irrefutable_let_patterns)]
10660                    if let EventPayload::CapabilityRequested(_) = self {
10661                        // Do nothing, read the value into the object
10662                    } else {
10663                        // Initialize `self` to the right variant
10664                        *self = EventPayload::CapabilityRequested(fidl::new_empty!(
10665                            CapabilityRequestedPayload,
10666                            fdomain_client::fidl::FDomainResourceDialect
10667                        ));
10668                    }
10669                    #[allow(irrefutable_let_patterns)]
10670                    if let EventPayload::CapabilityRequested(ref mut val) = self {
10671                        fidl::decode!(
10672                            CapabilityRequestedPayload,
10673                            fdomain_client::fidl::FDomainResourceDialect,
10674                            val,
10675                            decoder,
10676                            _inner_offset,
10677                            depth
10678                        )?;
10679                    } else {
10680                        unreachable!()
10681                    }
10682                }
10683                2 => {
10684                    #[allow(irrefutable_let_patterns)]
10685                    if let EventPayload::Purged(_) = self {
10686                        // Do nothing, read the value into the object
10687                    } else {
10688                        // Initialize `self` to the right variant
10689                        *self = EventPayload::Purged(fidl::new_empty!(
10690                            PurgedPayload,
10691                            fdomain_client::fidl::FDomainResourceDialect
10692                        ));
10693                    }
10694                    #[allow(irrefutable_let_patterns)]
10695                    if let EventPayload::Purged(ref mut val) = self {
10696                        fidl::decode!(
10697                            PurgedPayload,
10698                            fdomain_client::fidl::FDomainResourceDialect,
10699                            val,
10700                            decoder,
10701                            _inner_offset,
10702                            depth
10703                        )?;
10704                    } else {
10705                        unreachable!()
10706                    }
10707                }
10708                4 => {
10709                    #[allow(irrefutable_let_patterns)]
10710                    if let EventPayload::Discovered(_) = self {
10711                        // Do nothing, read the value into the object
10712                    } else {
10713                        // Initialize `self` to the right variant
10714                        *self = EventPayload::Discovered(fidl::new_empty!(
10715                            DiscoveredPayload,
10716                            fdomain_client::fidl::FDomainResourceDialect
10717                        ));
10718                    }
10719                    #[allow(irrefutable_let_patterns)]
10720                    if let EventPayload::Discovered(ref mut val) = self {
10721                        fidl::decode!(
10722                            DiscoveredPayload,
10723                            fdomain_client::fidl::FDomainResourceDialect,
10724                            val,
10725                            decoder,
10726                            _inner_offset,
10727                            depth
10728                        )?;
10729                    } else {
10730                        unreachable!()
10731                    }
10732                }
10733                5 => {
10734                    #[allow(irrefutable_let_patterns)]
10735                    if let EventPayload::Destroyed(_) = self {
10736                        // Do nothing, read the value into the object
10737                    } else {
10738                        // Initialize `self` to the right variant
10739                        *self = EventPayload::Destroyed(fidl::new_empty!(
10740                            DestroyedPayload,
10741                            fdomain_client::fidl::FDomainResourceDialect
10742                        ));
10743                    }
10744                    #[allow(irrefutable_let_patterns)]
10745                    if let EventPayload::Destroyed(ref mut val) = self {
10746                        fidl::decode!(
10747                            DestroyedPayload,
10748                            fdomain_client::fidl::FDomainResourceDialect,
10749                            val,
10750                            decoder,
10751                            _inner_offset,
10752                            depth
10753                        )?;
10754                    } else {
10755                        unreachable!()
10756                    }
10757                }
10758                6 => {
10759                    #[allow(irrefutable_let_patterns)]
10760                    if let EventPayload::Resolved(_) = self {
10761                        // Do nothing, read the value into the object
10762                    } else {
10763                        // Initialize `self` to the right variant
10764                        *self = EventPayload::Resolved(fidl::new_empty!(
10765                            ResolvedPayload,
10766                            fdomain_client::fidl::FDomainResourceDialect
10767                        ));
10768                    }
10769                    #[allow(irrefutable_let_patterns)]
10770                    if let EventPayload::Resolved(ref mut val) = self {
10771                        fidl::decode!(
10772                            ResolvedPayload,
10773                            fdomain_client::fidl::FDomainResourceDialect,
10774                            val,
10775                            decoder,
10776                            _inner_offset,
10777                            depth
10778                        )?;
10779                    } else {
10780                        unreachable!()
10781                    }
10782                }
10783                7 => {
10784                    #[allow(irrefutable_let_patterns)]
10785                    if let EventPayload::Started(_) = self {
10786                        // Do nothing, read the value into the object
10787                    } else {
10788                        // Initialize `self` to the right variant
10789                        *self = EventPayload::Started(fidl::new_empty!(
10790                            StartedPayload,
10791                            fdomain_client::fidl::FDomainResourceDialect
10792                        ));
10793                    }
10794                    #[allow(irrefutable_let_patterns)]
10795                    if let EventPayload::Started(ref mut val) = self {
10796                        fidl::decode!(
10797                            StartedPayload,
10798                            fdomain_client::fidl::FDomainResourceDialect,
10799                            val,
10800                            decoder,
10801                            _inner_offset,
10802                            depth
10803                        )?;
10804                    } else {
10805                        unreachable!()
10806                    }
10807                }
10808                8 => {
10809                    #[allow(irrefutable_let_patterns)]
10810                    if let EventPayload::Stopped(_) = self {
10811                        // Do nothing, read the value into the object
10812                    } else {
10813                        // Initialize `self` to the right variant
10814                        *self = EventPayload::Stopped(fidl::new_empty!(
10815                            StoppedPayload,
10816                            fdomain_client::fidl::FDomainResourceDialect
10817                        ));
10818                    }
10819                    #[allow(irrefutable_let_patterns)]
10820                    if let EventPayload::Stopped(ref mut val) = self {
10821                        fidl::decode!(
10822                            StoppedPayload,
10823                            fdomain_client::fidl::FDomainResourceDialect,
10824                            val,
10825                            decoder,
10826                            _inner_offset,
10827                            depth
10828                        )?;
10829                    } else {
10830                        unreachable!()
10831                    }
10832                }
10833                9 => {
10834                    #[allow(irrefutable_let_patterns)]
10835                    if let EventPayload::DebugStarted(_) = self {
10836                        // Do nothing, read the value into the object
10837                    } else {
10838                        // Initialize `self` to the right variant
10839                        *self = EventPayload::DebugStarted(fidl::new_empty!(
10840                            DebugStartedPayload,
10841                            fdomain_client::fidl::FDomainResourceDialect
10842                        ));
10843                    }
10844                    #[allow(irrefutable_let_patterns)]
10845                    if let EventPayload::DebugStarted(ref mut val) = self {
10846                        fidl::decode!(
10847                            DebugStartedPayload,
10848                            fdomain_client::fidl::FDomainResourceDialect,
10849                            val,
10850                            decoder,
10851                            _inner_offset,
10852                            depth
10853                        )?;
10854                    } else {
10855                        unreachable!()
10856                    }
10857                }
10858                10 => {
10859                    #[allow(irrefutable_let_patterns)]
10860                    if let EventPayload::Unresolved(_) = self {
10861                        // Do nothing, read the value into the object
10862                    } else {
10863                        // Initialize `self` to the right variant
10864                        *self = EventPayload::Unresolved(fidl::new_empty!(
10865                            UnresolvedPayload,
10866                            fdomain_client::fidl::FDomainResourceDialect
10867                        ));
10868                    }
10869                    #[allow(irrefutable_let_patterns)]
10870                    if let EventPayload::Unresolved(ref mut val) = self {
10871                        fidl::decode!(
10872                            UnresolvedPayload,
10873                            fdomain_client::fidl::FDomainResourceDialect,
10874                            val,
10875                            decoder,
10876                            _inner_offset,
10877                            depth
10878                        )?;
10879                    } else {
10880                        unreachable!()
10881                    }
10882                }
10883                #[allow(deprecated)]
10884                ordinal => {
10885                    for _ in 0..num_handles {
10886                        decoder.drop_next_handle()?;
10887                    }
10888                    *self = EventPayload::__SourceBreaking { unknown_ordinal: ordinal };
10889                }
10890            }
10891            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
10892                return Err(fidl::Error::InvalidNumBytesInEnvelope);
10893            }
10894            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10895                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10896            }
10897            Ok(())
10898        }
10899    }
10900}