fdomain_fuchsia_component/
fdomain_fuchsia_component.rs

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