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