fidl_fuchsia_component/
fidl_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 fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_component__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ControllerOpenExposedDirRequest {
16    pub exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20    for ControllerOpenExposedDirRequest
21{
22}
23
24#[derive(Debug, PartialEq)]
25pub struct ControllerStartRequest {
26    pub args: StartChildArgs,
27    pub execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ControllerStartRequest {}
31
32#[derive(Debug, PartialEq)]
33pub struct ControllerGetExposedDictionaryResponse {
34    pub dictionary: fidl_fuchsia_component_sandbox::DictionaryRef,
35}
36
37impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
38    for ControllerGetExposedDictionaryResponse
39{
40}
41
42#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
43pub struct ControllerGetOutputDictionaryResponse {
44    pub dictionary: fidl::EventPair,
45}
46
47impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
48    for ControllerGetOutputDictionaryResponse
49{
50}
51
52#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
53pub struct ControllerIsStartedResponse {
54    pub is_started: bool,
55}
56
57impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
58    for ControllerIsStartedResponse
59{
60}
61
62#[derive(Debug, PartialEq)]
63pub struct EventStreamGetNextResponse {
64    pub events: Vec<Event>,
65}
66
67impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
68    for EventStreamGetNextResponse
69{
70}
71
72#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
73pub struct IntrospectorGetMonikerRequest {
74    pub component_instance: fidl::Event,
75}
76
77impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
78    for IntrospectorGetMonikerRequest
79{
80}
81
82#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
83pub struct NamespaceCreateRequest {
84    pub entries: Vec<NamespaceInputEntry>,
85}
86
87impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreateRequest {}
88
89#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
90pub struct NamespaceInputEntry {
91    pub path: String,
92    pub dictionary: fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
93}
94
95impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceInputEntry {}
96
97#[derive(Debug, PartialEq)]
98pub struct NamespaceCreateResponse {
99    pub entries: Vec<NamespaceEntry>,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreateResponse {}
103
104#[derive(Debug, PartialEq)]
105pub struct RealmCreateChildRequest {
106    pub collection: fidl_fuchsia_component_decl::CollectionRef,
107    pub decl: fidl_fuchsia_component_decl::Child,
108    pub args: CreateChildArgs,
109}
110
111impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmCreateChildRequest {}
112
113#[derive(Debug, PartialEq)]
114pub struct RealmGetChildOutputDictionaryDeprecatedRequest {
115    pub child: fidl_fuchsia_component_decl::ChildRef,
116}
117
118impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
119    for RealmGetChildOutputDictionaryDeprecatedRequest
120{
121}
122
123#[derive(Debug, PartialEq)]
124pub struct RealmGetChildOutputDictionaryRequest {
125    pub child: fidl_fuchsia_component_decl::ChildRef,
126}
127
128impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
129    for RealmGetChildOutputDictionaryRequest
130{
131}
132
133#[derive(Debug, PartialEq)]
134pub struct RealmListChildrenRequest {
135    pub collection: fidl_fuchsia_component_decl::CollectionRef,
136    pub iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
137}
138
139impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmListChildrenRequest {}
140
141#[derive(Debug, PartialEq)]
142pub struct RealmOpenControllerRequest {
143    pub child: fidl_fuchsia_component_decl::ChildRef,
144    pub controller: fidl::endpoints::ServerEnd<ControllerMarker>,
145}
146
147impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
148    for RealmOpenControllerRequest
149{
150}
151
152#[derive(Debug, PartialEq)]
153pub struct RealmOpenExposedDirRequest {
154    pub child: fidl_fuchsia_component_decl::ChildRef,
155    pub exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
156}
157
158impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
159    for RealmOpenExposedDirRequest
160{
161}
162
163#[derive(Debug, PartialEq)]
164pub struct RealmGetChildOutputDictionaryDeprecatedResponse {
165    pub dictionary: fidl_fuchsia_component_sandbox::DictionaryRef,
166}
167
168impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
169    for RealmGetChildOutputDictionaryDeprecatedResponse
170{
171}
172
173#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
174pub struct RealmGetChildOutputDictionaryResponse {
175    pub dictionary: fidl::EventPair,
176}
177
178impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
179    for RealmGetChildOutputDictionaryResponse
180{
181}
182
183#[derive(Debug, PartialEq)]
184pub struct RealmGetResolvedInfoResponse {
185    pub resolved_info: fidl_fuchsia_component_resolution::Component,
186}
187
188impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
189    for RealmGetResolvedInfoResponse
190{
191}
192
193#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
194pub struct StorageAdminListStorageInRealmRequest {
195    pub relative_moniker: String,
196    pub iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
197}
198
199impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
200    for StorageAdminListStorageInRealmRequest
201{
202}
203
204#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
205pub struct StorageAdminOpenComponentStorageByIdRequest {
206    pub id: String,
207    pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
208}
209
210impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
211    for StorageAdminOpenComponentStorageByIdRequest
212{
213}
214
215#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
216pub struct StorageAdminOpenStorageRequest {
217    pub relative_moniker: String,
218    pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
219}
220
221impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
222    for StorageAdminOpenStorageRequest
223{
224}
225
226/// Payload for CapabilityRequested events
227#[derive(Debug, Default, PartialEq)]
228pub struct CapabilityRequestedPayload {
229    /// The name of the capability.
230    pub name: Option<String>,
231    /// A handle to the server end of the channel to host
232    /// capability.
233    pub capability: Option<fidl::Channel>,
234    #[doc(hidden)]
235    pub __source_breaking: fidl::marker::SourceBreaking,
236}
237
238impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
239    for CapabilityRequestedPayload
240{
241}
242
243#[derive(Debug, Default, PartialEq)]
244pub struct CreateChildArgs {
245    /// The numbered handles to pass to the component instance.
246    ///
247    /// If the runner for the component does not support the numbered handles it is
248    /// expected to close the handles.
249    pub numbered_handles: Option<Vec<fidl_fuchsia_process::HandleInfo>>,
250    /// Dynamic offers that will target the component instance.
251    ///
252    /// Including `OfferDecl`s in this vector will cause additional capabilities
253    /// to be offered to the newly created child, beyond the `OfferDecl`s in the
254    /// parent's `ComponentDecl` that target the collection.
255    ///
256    /// Any kind of offer (e.g., protocol, directory) can be used as a dynamic
257    /// offer. Any source that would be valid for a static offer is also valid
258    /// for a dynamic offer. Additionally, unlike static offers, dynamic offers
259    /// can use a "sibling" dynamic child component as a source by setting the
260    /// source to a `ChildRef` that sets the `collection` field.
261    ///
262    /// Dynamic offers always target the newly created child component. As a
263    /// result, `OfferDecl`s in `dynamic_offers` must not set the `target`
264    /// field, as its value is implied.
265    ///
266    /// If either the source (that is, the component named in the `source` field
267    /// of the `OfferDecl`) or the target of a dynamic offer is destroyed, the
268    /// offer itself is destroyed simultaneously.
269    ///
270    /// In order to set this field to a non-empty value, the collection in which
271    /// the child component is being created must specify
272    /// `ComponentDecl.allowed_offers = STATIC_AND_DYNAMIC`.
273    pub dynamic_offers: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
274    /// The controller for this component, which may be used to influence the
275    /// component's lifecycle.
276    pub controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
277    /// A dictionary that contains extra capabilities for the component instance.
278    /// This field should be considered deprecated in favor of
279    /// `additional_inputs`. If both are set, an `INVALID_ARGUMENTS` error will
280    /// be returned.
281    pub dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
282    /// A handle to a dictionary created using
283    /// fuchsia.component.runtime.Capabilities that contains additional
284    /// capabilities that should be added to the inputs of the created child.
285    pub additional_inputs: Option<fidl::EventPair>,
286    #[doc(hidden)]
287    pub __source_breaking: fidl::marker::SourceBreaking,
288}
289
290impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateChildArgs {}
291
292/// Payload for DebugStarted events.
293#[derive(Debug, Default, PartialEq)]
294pub struct DebugStartedPayload {
295    /// The directory served by the runner to present runtime and runner-specific information
296    /// about the component. The other side is sent to the runner in ComponentStartInfo.
297    /// For example, it can be queried to know whether the component is an ELF component and
298    /// supports the break_on_start protocol below.
299    pub runtime_dir: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
300    /// An eventpair that can be used by debuggers to defer the launch of the component,
301    /// e.g., ELF debuggers can setup the exception channel on the job while holding
302    /// the eventpair, then drop the eventpair to notify the runner that processes could
303    /// be created. The other side is sent to the runner in ComponentStartInfo.
304    pub break_on_start: Option<fidl::EventPair>,
305    #[doc(hidden)]
306    pub __source_breaking: fidl::marker::SourceBreaking,
307}
308
309impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugStartedPayload {}
310
311/// Contains all information about a single event
312#[derive(Debug, Default, PartialEq)]
313pub struct Event {
314    /// Information about the component for which this event was generated.
315    pub header: Option<EventHeader>,
316    /// Optional payload for some event types
317    pub payload: Option<EventPayload>,
318    #[doc(hidden)]
319    pub __source_breaking: fidl::marker::SourceBreaking,
320}
321
322impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Event {}
323
324/// A single component namespace entry, which describes a namespace mount point
325/// (`path`) and the directory backing it (`directory`). This type is usually
326/// composed inside a vector.  See `ComponentStartInfo.ns` for more details.
327#[derive(Debug, Default, PartialEq)]
328pub struct NamespaceEntry {
329    /// The mount point for the directory, including a
330    /// leading slash. For example: "/pkg", "/svc", or "/config/data".
331    pub path: Option<String>,
332    /// The directory mounted at the above `path`.
333    pub directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
334    #[doc(hidden)]
335    pub __source_breaking: fidl::marker::SourceBreaking,
336}
337
338impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceEntry {}
339
340#[derive(Debug, Default, PartialEq)]
341pub struct StartChildArgs {
342    /// The numbered handles to pass to the component instance.
343    ///
344    /// If the runner for the component does not support the numbered handles it
345    /// is expected to close the handles.
346    ///
347    /// If set, the values given here will override the handles given in
348    /// CreateChildArgs.
349    pub numbered_handles: Option<Vec<fidl_fuchsia_process::HandleInfo>>,
350    /// The namespace generated by component manager will be extended to include
351    /// any namespace entries listed here before being given to the component's
352    /// runner.
353    ///
354    /// If there are any conflicting entries, an error will occur when starting
355    /// the component.
356    pub namespace_entries: Option<Vec<NamespaceEntry>>,
357    /// A dictionary that contains extra capabilities for the component instance.
358    /// This field should be considered deprecated in favor of
359    /// `additional_inputs`. If both are set, an `INVALID_ARGUMENTS` error will
360    /// be returned.
361    pub dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
362    /// A handle to a dictionary created using
363    /// fuchsia.component.runtime.Capabilities that contains additional
364    /// capabilities that should be added to the inputs of the started program.
365    pub additional_inputs: Option<fidl::EventPair>,
366    #[doc(hidden)]
367    pub __source_breaking: fidl::marker::SourceBreaking,
368}
369
370impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StartChildArgs {}
371
372/// Encapsulates additional data/protocols for some event types.
373#[derive(Debug)]
374pub enum EventPayload {
375    /// Payload for CapabilityRequested events
376    CapabilityRequested(CapabilityRequestedPayload),
377    /// Payload for Purged events.
378    Purged(PurgedPayload),
379    /// Payload for Discovered events.
380    Discovered(DiscoveredPayload),
381    /// Payload for Destroyed events.
382    Destroyed(DestroyedPayload),
383    /// Payload for Resolved events
384    Resolved(ResolvedPayload),
385    /// Payload for Started events
386    Started(StartedPayload),
387    /// Payload for Stopped events
388    Stopped(StoppedPayload),
389    /// Payload for DebugStarted events
390    DebugStarted(DebugStartedPayload),
391    /// Payload for Unresolved events
392    Unresolved(UnresolvedPayload),
393    #[doc(hidden)]
394    __SourceBreaking { unknown_ordinal: u64 },
395}
396
397/// Pattern that matches an unknown `EventPayload` member.
398#[macro_export]
399macro_rules! EventPayloadUnknown {
400    () => {
401        _
402    };
403}
404
405// Custom PartialEq so that unknown variants are not equal to themselves.
406impl PartialEq for EventPayload {
407    fn eq(&self, other: &Self) -> bool {
408        match (self, other) {
409            (Self::CapabilityRequested(x), Self::CapabilityRequested(y)) => *x == *y,
410            (Self::Purged(x), Self::Purged(y)) => *x == *y,
411            (Self::Discovered(x), Self::Discovered(y)) => *x == *y,
412            (Self::Destroyed(x), Self::Destroyed(y)) => *x == *y,
413            (Self::Resolved(x), Self::Resolved(y)) => *x == *y,
414            (Self::Started(x), Self::Started(y)) => *x == *y,
415            (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
416            (Self::DebugStarted(x), Self::DebugStarted(y)) => *x == *y,
417            (Self::Unresolved(x), Self::Unresolved(y)) => *x == *y,
418            _ => false,
419        }
420    }
421}
422
423impl EventPayload {
424    #[inline]
425    pub fn ordinal(&self) -> u64 {
426        match *self {
427            Self::CapabilityRequested(_) => 1,
428            Self::Purged(_) => 2,
429            Self::Discovered(_) => 4,
430            Self::Destroyed(_) => 5,
431            Self::Resolved(_) => 6,
432            Self::Started(_) => 7,
433            Self::Stopped(_) => 8,
434            Self::DebugStarted(_) => 9,
435            Self::Unresolved(_) => 10,
436            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
437        }
438    }
439
440    #[inline]
441    pub fn unknown_variant_for_testing() -> Self {
442        Self::__SourceBreaking { unknown_ordinal: 0 }
443    }
444
445    #[inline]
446    pub fn is_unknown(&self) -> bool {
447        match self {
448            Self::__SourceBreaking { .. } => true,
449            _ => false,
450        }
451    }
452}
453
454impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EventPayload {}
455
456#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
457pub struct BinderMarker;
458
459impl fidl::endpoints::ProtocolMarker for BinderMarker {
460    type Proxy = BinderProxy;
461    type RequestStream = BinderRequestStream;
462    #[cfg(target_os = "fuchsia")]
463    type SynchronousProxy = BinderSynchronousProxy;
464
465    const DEBUG_NAME: &'static str = "fuchsia.component.Binder";
466}
467impl fidl::endpoints::DiscoverableProtocolMarker for BinderMarker {}
468
469pub trait BinderProxyInterface: Send + Sync {}
470#[derive(Debug)]
471#[cfg(target_os = "fuchsia")]
472pub struct BinderSynchronousProxy {
473    client: fidl::client::sync::Client,
474}
475
476#[cfg(target_os = "fuchsia")]
477impl fidl::endpoints::SynchronousProxy for BinderSynchronousProxy {
478    type Proxy = BinderProxy;
479    type Protocol = BinderMarker;
480
481    fn from_channel(inner: fidl::Channel) -> Self {
482        Self::new(inner)
483    }
484
485    fn into_channel(self) -> fidl::Channel {
486        self.client.into_channel()
487    }
488
489    fn as_channel(&self) -> &fidl::Channel {
490        self.client.as_channel()
491    }
492}
493
494#[cfg(target_os = "fuchsia")]
495impl BinderSynchronousProxy {
496    pub fn new(channel: fidl::Channel) -> Self {
497        let protocol_name = <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
498        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
499    }
500
501    pub fn into_channel(self) -> fidl::Channel {
502        self.client.into_channel()
503    }
504
505    /// Waits until an event arrives and returns it. It is safe for other
506    /// threads to make concurrent requests while waiting for an event.
507    pub fn wait_for_event(
508        &self,
509        deadline: zx::MonotonicInstant,
510    ) -> Result<BinderEvent, fidl::Error> {
511        BinderEvent::decode(self.client.wait_for_event(deadline)?)
512    }
513}
514
515#[cfg(target_os = "fuchsia")]
516impl From<BinderSynchronousProxy> for zx::NullableHandle {
517    fn from(value: BinderSynchronousProxy) -> Self {
518        value.into_channel().into()
519    }
520}
521
522#[cfg(target_os = "fuchsia")]
523impl From<fidl::Channel> for BinderSynchronousProxy {
524    fn from(value: fidl::Channel) -> Self {
525        Self::new(value)
526    }
527}
528
529#[cfg(target_os = "fuchsia")]
530impl fidl::endpoints::FromClient for BinderSynchronousProxy {
531    type Protocol = BinderMarker;
532
533    fn from_client(value: fidl::endpoints::ClientEnd<BinderMarker>) -> Self {
534        Self::new(value.into_channel())
535    }
536}
537
538#[derive(Debug, Clone)]
539pub struct BinderProxy {
540    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
541}
542
543impl fidl::endpoints::Proxy for BinderProxy {
544    type Protocol = BinderMarker;
545
546    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
547        Self::new(inner)
548    }
549
550    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
551        self.client.into_channel().map_err(|client| Self { client })
552    }
553
554    fn as_channel(&self) -> &::fidl::AsyncChannel {
555        self.client.as_channel()
556    }
557}
558
559impl BinderProxy {
560    /// Create a new Proxy for fuchsia.component/Binder.
561    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
562        let protocol_name = <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
563        Self { client: fidl::client::Client::new(channel, protocol_name) }
564    }
565
566    /// Get a Stream of events from the remote end of the protocol.
567    ///
568    /// # Panics
569    ///
570    /// Panics if the event stream was already taken.
571    pub fn take_event_stream(&self) -> BinderEventStream {
572        BinderEventStream { event_receiver: self.client.take_event_receiver() }
573    }
574}
575
576impl BinderProxyInterface for BinderProxy {}
577
578pub struct BinderEventStream {
579    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
580}
581
582impl std::marker::Unpin for BinderEventStream {}
583
584impl futures::stream::FusedStream for BinderEventStream {
585    fn is_terminated(&self) -> bool {
586        self.event_receiver.is_terminated()
587    }
588}
589
590impl futures::Stream for BinderEventStream {
591    type Item = Result<BinderEvent, fidl::Error>;
592
593    fn poll_next(
594        mut self: std::pin::Pin<&mut Self>,
595        cx: &mut std::task::Context<'_>,
596    ) -> std::task::Poll<Option<Self::Item>> {
597        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
598            &mut self.event_receiver,
599            cx
600        )?) {
601            Some(buf) => std::task::Poll::Ready(Some(BinderEvent::decode(buf))),
602            None => std::task::Poll::Ready(None),
603        }
604    }
605}
606
607#[derive(Debug)]
608pub enum BinderEvent {}
609
610impl BinderEvent {
611    /// Decodes a message buffer as a [`BinderEvent`].
612    fn decode(
613        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
614    ) -> Result<BinderEvent, fidl::Error> {
615        let (bytes, _handles) = buf.split_mut();
616        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
617        debug_assert_eq!(tx_header.tx_id, 0);
618        match tx_header.ordinal {
619            _ => Err(fidl::Error::UnknownOrdinal {
620                ordinal: tx_header.ordinal,
621                protocol_name: <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
622            }),
623        }
624    }
625}
626
627/// A Stream of incoming requests for fuchsia.component/Binder.
628pub struct BinderRequestStream {
629    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
630    is_terminated: bool,
631}
632
633impl std::marker::Unpin for BinderRequestStream {}
634
635impl futures::stream::FusedStream for BinderRequestStream {
636    fn is_terminated(&self) -> bool {
637        self.is_terminated
638    }
639}
640
641impl fidl::endpoints::RequestStream for BinderRequestStream {
642    type Protocol = BinderMarker;
643    type ControlHandle = BinderControlHandle;
644
645    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
646        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
647    }
648
649    fn control_handle(&self) -> Self::ControlHandle {
650        BinderControlHandle { inner: self.inner.clone() }
651    }
652
653    fn into_inner(
654        self,
655    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
656    {
657        (self.inner, self.is_terminated)
658    }
659
660    fn from_inner(
661        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
662        is_terminated: bool,
663    ) -> Self {
664        Self { inner, is_terminated }
665    }
666}
667
668impl futures::Stream for BinderRequestStream {
669    type Item = Result<BinderRequest, fidl::Error>;
670
671    fn poll_next(
672        mut self: std::pin::Pin<&mut Self>,
673        cx: &mut std::task::Context<'_>,
674    ) -> std::task::Poll<Option<Self::Item>> {
675        let this = &mut *self;
676        if this.inner.check_shutdown(cx) {
677            this.is_terminated = true;
678            return std::task::Poll::Ready(None);
679        }
680        if this.is_terminated {
681            panic!("polled BinderRequestStream after completion");
682        }
683        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
684            |bytes, handles| {
685                match this.inner.channel().read_etc(cx, bytes, handles) {
686                    std::task::Poll::Ready(Ok(())) => {}
687                    std::task::Poll::Pending => return std::task::Poll::Pending,
688                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
689                        this.is_terminated = true;
690                        return std::task::Poll::Ready(None);
691                    }
692                    std::task::Poll::Ready(Err(e)) => {
693                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
694                            e.into(),
695                        ))));
696                    }
697                }
698
699                // A message has been received from the channel
700                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
701
702                std::task::Poll::Ready(Some(match header.ordinal {
703                    _ => Err(fidl::Error::UnknownOrdinal {
704                        ordinal: header.ordinal,
705                        protocol_name:
706                            <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
707                    }),
708                }))
709            },
710        )
711    }
712}
713
714/// A framework-provided protocol that allows components that use it to bind to
715/// the component that exposes it. The act of connecting to this protocol will
716/// trigger the bind. Thus, this protocol contains no methods. For more details
717/// on binding, see
718/// https://fuchsia.dev/fuchsia-src/concepts/components/v2/lifecycle#binding.
719///
720/// When a component connects to protocol, the component exposing this capability
721/// will be started if it's not already running. Upon a failure to start, the
722/// component framework will close the server end of the channel with a
723/// zx.Status epitaph.
724#[derive(Debug)]
725pub enum BinderRequest {}
726
727impl BinderRequest {
728    /// Name of the method defined in FIDL
729    pub fn method_name(&self) -> &'static str {
730        match *self {}
731    }
732}
733
734#[derive(Debug, Clone)]
735pub struct BinderControlHandle {
736    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
737}
738
739impl fidl::endpoints::ControlHandle for BinderControlHandle {
740    fn shutdown(&self) {
741        self.inner.shutdown()
742    }
743
744    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
745        self.inner.shutdown_with_epitaph(status)
746    }
747
748    fn is_closed(&self) -> bool {
749        self.inner.channel().is_closed()
750    }
751    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
752        self.inner.channel().on_closed()
753    }
754
755    #[cfg(target_os = "fuchsia")]
756    fn signal_peer(
757        &self,
758        clear_mask: zx::Signals,
759        set_mask: zx::Signals,
760    ) -> Result<(), zx_status::Status> {
761        use fidl::Peered;
762        self.inner.channel().signal_peer(clear_mask, set_mask)
763    }
764}
765
766impl BinderControlHandle {}
767
768#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
769pub struct ChildIteratorMarker;
770
771impl fidl::endpoints::ProtocolMarker for ChildIteratorMarker {
772    type Proxy = ChildIteratorProxy;
773    type RequestStream = ChildIteratorRequestStream;
774    #[cfg(target_os = "fuchsia")]
775    type SynchronousProxy = ChildIteratorSynchronousProxy;
776
777    const DEBUG_NAME: &'static str = "(anonymous) ChildIterator";
778}
779
780pub trait ChildIteratorProxyInterface: Send + Sync {
781    type NextResponseFut: std::future::Future<
782            Output = Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error>,
783        > + Send;
784    fn r#next(&self) -> Self::NextResponseFut;
785}
786#[derive(Debug)]
787#[cfg(target_os = "fuchsia")]
788pub struct ChildIteratorSynchronousProxy {
789    client: fidl::client::sync::Client,
790}
791
792#[cfg(target_os = "fuchsia")]
793impl fidl::endpoints::SynchronousProxy for ChildIteratorSynchronousProxy {
794    type Proxy = ChildIteratorProxy;
795    type Protocol = ChildIteratorMarker;
796
797    fn from_channel(inner: fidl::Channel) -> Self {
798        Self::new(inner)
799    }
800
801    fn into_channel(self) -> fidl::Channel {
802        self.client.into_channel()
803    }
804
805    fn as_channel(&self) -> &fidl::Channel {
806        self.client.as_channel()
807    }
808}
809
810#[cfg(target_os = "fuchsia")]
811impl ChildIteratorSynchronousProxy {
812    pub fn new(channel: fidl::Channel) -> Self {
813        let protocol_name = <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
814        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
815    }
816
817    pub fn into_channel(self) -> fidl::Channel {
818        self.client.into_channel()
819    }
820
821    /// Waits until an event arrives and returns it. It is safe for other
822    /// threads to make concurrent requests while waiting for an event.
823    pub fn wait_for_event(
824        &self,
825        deadline: zx::MonotonicInstant,
826    ) -> Result<ChildIteratorEvent, fidl::Error> {
827        ChildIteratorEvent::decode(self.client.wait_for_event(deadline)?)
828    }
829
830    /// Advance the iterator and return the next batch of children.
831    ///
832    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
833    /// no more children.
834    pub fn r#next(
835        &self,
836        ___deadline: zx::MonotonicInstant,
837    ) -> Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error> {
838        let _response =
839            self.client.send_query::<fidl::encoding::EmptyPayload, ChildIteratorNextResponse>(
840                (),
841                0x40e4c3882b050d08,
842                fidl::encoding::DynamicFlags::empty(),
843                ___deadline,
844            )?;
845        Ok(_response.children)
846    }
847}
848
849#[cfg(target_os = "fuchsia")]
850impl From<ChildIteratorSynchronousProxy> for zx::NullableHandle {
851    fn from(value: ChildIteratorSynchronousProxy) -> Self {
852        value.into_channel().into()
853    }
854}
855
856#[cfg(target_os = "fuchsia")]
857impl From<fidl::Channel> for ChildIteratorSynchronousProxy {
858    fn from(value: fidl::Channel) -> Self {
859        Self::new(value)
860    }
861}
862
863#[cfg(target_os = "fuchsia")]
864impl fidl::endpoints::FromClient for ChildIteratorSynchronousProxy {
865    type Protocol = ChildIteratorMarker;
866
867    fn from_client(value: fidl::endpoints::ClientEnd<ChildIteratorMarker>) -> Self {
868        Self::new(value.into_channel())
869    }
870}
871
872#[derive(Debug, Clone)]
873pub struct ChildIteratorProxy {
874    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
875}
876
877impl fidl::endpoints::Proxy for ChildIteratorProxy {
878    type Protocol = ChildIteratorMarker;
879
880    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
881        Self::new(inner)
882    }
883
884    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
885        self.client.into_channel().map_err(|client| Self { client })
886    }
887
888    fn as_channel(&self) -> &::fidl::AsyncChannel {
889        self.client.as_channel()
890    }
891}
892
893impl ChildIteratorProxy {
894    /// Create a new Proxy for fuchsia.component/ChildIterator.
895    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
896        let protocol_name = <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
897        Self { client: fidl::client::Client::new(channel, protocol_name) }
898    }
899
900    /// Get a Stream of events from the remote end of the protocol.
901    ///
902    /// # Panics
903    ///
904    /// Panics if the event stream was already taken.
905    pub fn take_event_stream(&self) -> ChildIteratorEventStream {
906        ChildIteratorEventStream { event_receiver: self.client.take_event_receiver() }
907    }
908
909    /// Advance the iterator and return the next batch of children.
910    ///
911    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
912    /// no more children.
913    pub fn r#next(
914        &self,
915    ) -> fidl::client::QueryResponseFut<
916        Vec<fidl_fuchsia_component_decl::ChildRef>,
917        fidl::encoding::DefaultFuchsiaResourceDialect,
918    > {
919        ChildIteratorProxyInterface::r#next(self)
920    }
921}
922
923impl ChildIteratorProxyInterface for ChildIteratorProxy {
924    type NextResponseFut = fidl::client::QueryResponseFut<
925        Vec<fidl_fuchsia_component_decl::ChildRef>,
926        fidl::encoding::DefaultFuchsiaResourceDialect,
927    >;
928    fn r#next(&self) -> Self::NextResponseFut {
929        fn _decode(
930            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
931        ) -> Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error> {
932            let _response = fidl::client::decode_transaction_body::<
933                ChildIteratorNextResponse,
934                fidl::encoding::DefaultFuchsiaResourceDialect,
935                0x40e4c3882b050d08,
936            >(_buf?)?;
937            Ok(_response.children)
938        }
939        self.client.send_query_and_decode::<
940            fidl::encoding::EmptyPayload,
941            Vec<fidl_fuchsia_component_decl::ChildRef>,
942        >(
943            (),
944            0x40e4c3882b050d08,
945            fidl::encoding::DynamicFlags::empty(),
946            _decode,
947        )
948    }
949}
950
951pub struct ChildIteratorEventStream {
952    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
953}
954
955impl std::marker::Unpin for ChildIteratorEventStream {}
956
957impl futures::stream::FusedStream for ChildIteratorEventStream {
958    fn is_terminated(&self) -> bool {
959        self.event_receiver.is_terminated()
960    }
961}
962
963impl futures::Stream for ChildIteratorEventStream {
964    type Item = Result<ChildIteratorEvent, fidl::Error>;
965
966    fn poll_next(
967        mut self: std::pin::Pin<&mut Self>,
968        cx: &mut std::task::Context<'_>,
969    ) -> std::task::Poll<Option<Self::Item>> {
970        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
971            &mut self.event_receiver,
972            cx
973        )?) {
974            Some(buf) => std::task::Poll::Ready(Some(ChildIteratorEvent::decode(buf))),
975            None => std::task::Poll::Ready(None),
976        }
977    }
978}
979
980#[derive(Debug)]
981pub enum ChildIteratorEvent {}
982
983impl ChildIteratorEvent {
984    /// Decodes a message buffer as a [`ChildIteratorEvent`].
985    fn decode(
986        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
987    ) -> Result<ChildIteratorEvent, fidl::Error> {
988        let (bytes, _handles) = buf.split_mut();
989        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
990        debug_assert_eq!(tx_header.tx_id, 0);
991        match tx_header.ordinal {
992            _ => Err(fidl::Error::UnknownOrdinal {
993                ordinal: tx_header.ordinal,
994                protocol_name: <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
995            }),
996        }
997    }
998}
999
1000/// A Stream of incoming requests for fuchsia.component/ChildIterator.
1001pub struct ChildIteratorRequestStream {
1002    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1003    is_terminated: bool,
1004}
1005
1006impl std::marker::Unpin for ChildIteratorRequestStream {}
1007
1008impl futures::stream::FusedStream for ChildIteratorRequestStream {
1009    fn is_terminated(&self) -> bool {
1010        self.is_terminated
1011    }
1012}
1013
1014impl fidl::endpoints::RequestStream for ChildIteratorRequestStream {
1015    type Protocol = ChildIteratorMarker;
1016    type ControlHandle = ChildIteratorControlHandle;
1017
1018    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1019        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1020    }
1021
1022    fn control_handle(&self) -> Self::ControlHandle {
1023        ChildIteratorControlHandle { inner: self.inner.clone() }
1024    }
1025
1026    fn into_inner(
1027        self,
1028    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1029    {
1030        (self.inner, self.is_terminated)
1031    }
1032
1033    fn from_inner(
1034        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1035        is_terminated: bool,
1036    ) -> Self {
1037        Self { inner, is_terminated }
1038    }
1039}
1040
1041impl futures::Stream for ChildIteratorRequestStream {
1042    type Item = Result<ChildIteratorRequest, fidl::Error>;
1043
1044    fn poll_next(
1045        mut self: std::pin::Pin<&mut Self>,
1046        cx: &mut std::task::Context<'_>,
1047    ) -> std::task::Poll<Option<Self::Item>> {
1048        let this = &mut *self;
1049        if this.inner.check_shutdown(cx) {
1050            this.is_terminated = true;
1051            return std::task::Poll::Ready(None);
1052        }
1053        if this.is_terminated {
1054            panic!("polled ChildIteratorRequestStream after completion");
1055        }
1056        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1057            |bytes, handles| {
1058                match this.inner.channel().read_etc(cx, bytes, handles) {
1059                    std::task::Poll::Ready(Ok(())) => {}
1060                    std::task::Poll::Pending => return std::task::Poll::Pending,
1061                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1062                        this.is_terminated = true;
1063                        return std::task::Poll::Ready(None);
1064                    }
1065                    std::task::Poll::Ready(Err(e)) => {
1066                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1067                            e.into(),
1068                        ))));
1069                    }
1070                }
1071
1072                // A message has been received from the channel
1073                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1074
1075                std::task::Poll::Ready(Some(match header.ordinal {
1076                    0x40e4c3882b050d08 => {
1077                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1078                        let mut req = fidl::new_empty!(
1079                            fidl::encoding::EmptyPayload,
1080                            fidl::encoding::DefaultFuchsiaResourceDialect
1081                        );
1082                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1083                        let control_handle =
1084                            ChildIteratorControlHandle { inner: this.inner.clone() };
1085                        Ok(ChildIteratorRequest::Next {
1086                            responder: ChildIteratorNextResponder {
1087                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1088                                tx_id: header.tx_id,
1089                            },
1090                        })
1091                    }
1092                    _ => Err(fidl::Error::UnknownOrdinal {
1093                        ordinal: header.ordinal,
1094                        protocol_name:
1095                            <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1096                    }),
1097                }))
1098            },
1099        )
1100    }
1101}
1102
1103/// A protocol to iterate over the list of children in a realm.
1104#[derive(Debug)]
1105pub enum ChildIteratorRequest {
1106    /// Advance the iterator and return the next batch of children.
1107    ///
1108    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
1109    /// no more children.
1110    Next { responder: ChildIteratorNextResponder },
1111}
1112
1113impl ChildIteratorRequest {
1114    #[allow(irrefutable_let_patterns)]
1115    pub fn into_next(self) -> Option<(ChildIteratorNextResponder)> {
1116        if let ChildIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
1117    }
1118
1119    /// Name of the method defined in FIDL
1120    pub fn method_name(&self) -> &'static str {
1121        match *self {
1122            ChildIteratorRequest::Next { .. } => "next",
1123        }
1124    }
1125}
1126
1127#[derive(Debug, Clone)]
1128pub struct ChildIteratorControlHandle {
1129    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1130}
1131
1132impl fidl::endpoints::ControlHandle for ChildIteratorControlHandle {
1133    fn shutdown(&self) {
1134        self.inner.shutdown()
1135    }
1136
1137    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1138        self.inner.shutdown_with_epitaph(status)
1139    }
1140
1141    fn is_closed(&self) -> bool {
1142        self.inner.channel().is_closed()
1143    }
1144    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1145        self.inner.channel().on_closed()
1146    }
1147
1148    #[cfg(target_os = "fuchsia")]
1149    fn signal_peer(
1150        &self,
1151        clear_mask: zx::Signals,
1152        set_mask: zx::Signals,
1153    ) -> Result<(), zx_status::Status> {
1154        use fidl::Peered;
1155        self.inner.channel().signal_peer(clear_mask, set_mask)
1156    }
1157}
1158
1159impl ChildIteratorControlHandle {}
1160
1161#[must_use = "FIDL methods require a response to be sent"]
1162#[derive(Debug)]
1163pub struct ChildIteratorNextResponder {
1164    control_handle: std::mem::ManuallyDrop<ChildIteratorControlHandle>,
1165    tx_id: u32,
1166}
1167
1168/// Set the the channel to be shutdown (see [`ChildIteratorControlHandle::shutdown`])
1169/// if the responder is dropped without sending a response, so that the client
1170/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1171impl std::ops::Drop for ChildIteratorNextResponder {
1172    fn drop(&mut self) {
1173        self.control_handle.shutdown();
1174        // Safety: drops once, never accessed again
1175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1176    }
1177}
1178
1179impl fidl::endpoints::Responder for ChildIteratorNextResponder {
1180    type ControlHandle = ChildIteratorControlHandle;
1181
1182    fn control_handle(&self) -> &ChildIteratorControlHandle {
1183        &self.control_handle
1184    }
1185
1186    fn drop_without_shutdown(mut self) {
1187        // Safety: drops once, never accessed again due to mem::forget
1188        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1189        // Prevent Drop from running (which would shut down the channel)
1190        std::mem::forget(self);
1191    }
1192}
1193
1194impl ChildIteratorNextResponder {
1195    /// Sends a response to the FIDL transaction.
1196    ///
1197    /// Sets the channel to shutdown if an error occurs.
1198    pub fn send(
1199        self,
1200        mut children: &[fidl_fuchsia_component_decl::ChildRef],
1201    ) -> Result<(), fidl::Error> {
1202        let _result = self.send_raw(children);
1203        if _result.is_err() {
1204            self.control_handle.shutdown();
1205        }
1206        self.drop_without_shutdown();
1207        _result
1208    }
1209
1210    /// Similar to "send" but does not shutdown the channel if an error occurs.
1211    pub fn send_no_shutdown_on_err(
1212        self,
1213        mut children: &[fidl_fuchsia_component_decl::ChildRef],
1214    ) -> Result<(), fidl::Error> {
1215        let _result = self.send_raw(children);
1216        self.drop_without_shutdown();
1217        _result
1218    }
1219
1220    fn send_raw(
1221        &self,
1222        mut children: &[fidl_fuchsia_component_decl::ChildRef],
1223    ) -> Result<(), fidl::Error> {
1224        self.control_handle.inner.send::<ChildIteratorNextResponse>(
1225            (children,),
1226            self.tx_id,
1227            0x40e4c3882b050d08,
1228            fidl::encoding::DynamicFlags::empty(),
1229        )
1230    }
1231}
1232
1233#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1234pub struct ControllerMarker;
1235
1236impl fidl::endpoints::ProtocolMarker for ControllerMarker {
1237    type Proxy = ControllerProxy;
1238    type RequestStream = ControllerRequestStream;
1239    #[cfg(target_os = "fuchsia")]
1240    type SynchronousProxy = ControllerSynchronousProxy;
1241
1242    const DEBUG_NAME: &'static str = "(anonymous) Controller";
1243}
1244pub type ControllerStartResult = Result<(), Error>;
1245pub type ControllerIsStartedResult = Result<bool, Error>;
1246pub type ControllerOpenExposedDirResult = Result<(), Error>;
1247pub type ControllerGetExposedDictionaryResult =
1248    Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>;
1249pub type ControllerGetOutputDictionaryResult = Result<fidl::EventPair, Error>;
1250pub type ControllerDestroyResult = Result<(), Error>;
1251
1252pub trait ControllerProxyInterface: Send + Sync {
1253    type StartResponseFut: std::future::Future<Output = Result<ControllerStartResult, fidl::Error>>
1254        + Send;
1255    fn r#start(
1256        &self,
1257        args: StartChildArgs,
1258        execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1259    ) -> Self::StartResponseFut;
1260    type IsStartedResponseFut: std::future::Future<Output = Result<ControllerIsStartedResult, fidl::Error>>
1261        + Send;
1262    fn r#is_started(&self) -> Self::IsStartedResponseFut;
1263    type OpenExposedDirResponseFut: std::future::Future<Output = Result<ControllerOpenExposedDirResult, fidl::Error>>
1264        + Send;
1265    fn r#open_exposed_dir(
1266        &self,
1267        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1268    ) -> Self::OpenExposedDirResponseFut;
1269    type GetExposedDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetExposedDictionaryResult, fidl::Error>>
1270        + Send;
1271    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut;
1272    type GetOutputDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetOutputDictionaryResult, fidl::Error>>
1273        + Send;
1274    fn r#get_output_dictionary(&self) -> Self::GetOutputDictionaryResponseFut;
1275    type DestroyResponseFut: std::future::Future<Output = Result<ControllerDestroyResult, fidl::Error>>
1276        + Send;
1277    fn r#destroy(&self) -> Self::DestroyResponseFut;
1278}
1279#[derive(Debug)]
1280#[cfg(target_os = "fuchsia")]
1281pub struct ControllerSynchronousProxy {
1282    client: fidl::client::sync::Client,
1283}
1284
1285#[cfg(target_os = "fuchsia")]
1286impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
1287    type Proxy = ControllerProxy;
1288    type Protocol = ControllerMarker;
1289
1290    fn from_channel(inner: fidl::Channel) -> Self {
1291        Self::new(inner)
1292    }
1293
1294    fn into_channel(self) -> fidl::Channel {
1295        self.client.into_channel()
1296    }
1297
1298    fn as_channel(&self) -> &fidl::Channel {
1299        self.client.as_channel()
1300    }
1301}
1302
1303#[cfg(target_os = "fuchsia")]
1304impl ControllerSynchronousProxy {
1305    pub fn new(channel: fidl::Channel) -> Self {
1306        let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1307        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1308    }
1309
1310    pub fn into_channel(self) -> fidl::Channel {
1311        self.client.into_channel()
1312    }
1313
1314    /// Waits until an event arrives and returns it. It is safe for other
1315    /// threads to make concurrent requests while waiting for an event.
1316    pub fn wait_for_event(
1317        &self,
1318        deadline: zx::MonotonicInstant,
1319    ) -> Result<ControllerEvent, fidl::Error> {
1320        ControllerEvent::decode(self.client.wait_for_event(deadline)?)
1321    }
1322
1323    /// Start the component, optionally providing additional handles to be given
1324    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1325    /// currently running.
1326    pub fn r#start(
1327        &self,
1328        mut args: StartChildArgs,
1329        mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1330        ___deadline: zx::MonotonicInstant,
1331    ) -> Result<ControllerStartResult, fidl::Error> {
1332        let _response = self.client.send_query::<
1333            ControllerStartRequest,
1334            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1335        >(
1336            (&mut args, execution_controller,),
1337            0x68878076b8d2eac5,
1338            fidl::encoding::DynamicFlags::FLEXIBLE,
1339            ___deadline,
1340        )?
1341        .into_result::<ControllerMarker>("start")?;
1342        Ok(_response.map(|x| x))
1343    }
1344
1345    /// Returns true if this instance is currently running.
1346    pub fn r#is_started(
1347        &self,
1348        ___deadline: zx::MonotonicInstant,
1349    ) -> Result<ControllerIsStartedResult, fidl::Error> {
1350        let _response = self.client.send_query::<
1351            fidl::encoding::EmptyPayload,
1352            fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1353        >(
1354            (),
1355            0x2155e6e1db2083c3,
1356            fidl::encoding::DynamicFlags::FLEXIBLE,
1357            ___deadline,
1358        )?
1359        .into_result::<ControllerMarker>("is_started")?;
1360        Ok(_response.map(|x| x.is_started))
1361    }
1362
1363    /// Opens the exposed directory of the controlled component, through which
1364    /// capabilities the component exposed via `ComponentDecl.exposes` are
1365    /// available, on success.
1366    ///
1367    /// Binding to the exposed directory requires that the component be
1368    /// resolved, but it will not be started until/unless some capability is
1369    /// requested that requires it to be.
1370    ///
1371    /// If this component is destroyed, any outstanding connections to
1372    /// `exposed_dir` will be closed.
1373    ///
1374    /// Errors:
1375    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
1376    pub fn r#open_exposed_dir(
1377        &self,
1378        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1379        ___deadline: zx::MonotonicInstant,
1380    ) -> Result<ControllerOpenExposedDirResult, fidl::Error> {
1381        let _response = self.client.send_query::<
1382            ControllerOpenExposedDirRequest,
1383            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1384        >(
1385            (exposed_dir,),
1386            0x253cabb9a840ed94,
1387            fidl::encoding::DynamicFlags::empty(),
1388            ___deadline,
1389        )?;
1390        Ok(_response.map(|x| x))
1391    }
1392
1393    /// Returns the dictionary containing the component's exposed capabilities.
1394    pub fn r#get_exposed_dictionary(
1395        &self,
1396        ___deadline: zx::MonotonicInstant,
1397    ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1398        let _response = self.client.send_query::<
1399            fidl::encoding::EmptyPayload,
1400            fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1401        >(
1402            (),
1403            0x7e48373e5eda1f9b,
1404            fidl::encoding::DynamicFlags::FLEXIBLE,
1405            ___deadline,
1406        )?
1407        .into_result::<ControllerMarker>("get_exposed_dictionary")?;
1408        Ok(_response.map(|x| x.dictionary))
1409    }
1410
1411    /// Returns a reference to the component's output dictionary, which may be
1412    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
1413    pub fn r#get_output_dictionary(
1414        &self,
1415        ___deadline: zx::MonotonicInstant,
1416    ) -> Result<ControllerGetOutputDictionaryResult, fidl::Error> {
1417        let _response = self.client.send_query::<
1418            fidl::encoding::EmptyPayload,
1419            fidl::encoding::FlexibleResultType<ControllerGetOutputDictionaryResponse, Error>,
1420        >(
1421            (),
1422            0x3a0c4696620ad221,
1423            fidl::encoding::DynamicFlags::FLEXIBLE,
1424            ___deadline,
1425        )?
1426        .into_result::<ControllerMarker>("get_output_dictionary")?;
1427        Ok(_response.map(|x| x.dictionary))
1428    }
1429
1430    /// Destroys this component. When this method returns, the component is
1431    /// either destroyed or in the case of an error no destruction happened.
1432    ///
1433    /// Errors:
1434    ///
1435    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1436    /// Currently, this can happen if the component is a static child of its
1437    /// parent.
1438    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
1439    ///   manager's logs will contain more detail.
1440    pub fn r#destroy(
1441        &self,
1442        ___deadline: zx::MonotonicInstant,
1443    ) -> Result<ControllerDestroyResult, fidl::Error> {
1444        let _response = self.client.send_query::<
1445            fidl::encoding::EmptyPayload,
1446            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1447        >(
1448            (),
1449            0x74529fa68b5c1741,
1450            fidl::encoding::DynamicFlags::FLEXIBLE,
1451            ___deadline,
1452        )?
1453        .into_result::<ControllerMarker>("destroy")?;
1454        Ok(_response.map(|x| x))
1455    }
1456}
1457
1458#[cfg(target_os = "fuchsia")]
1459impl From<ControllerSynchronousProxy> for zx::NullableHandle {
1460    fn from(value: ControllerSynchronousProxy) -> Self {
1461        value.into_channel().into()
1462    }
1463}
1464
1465#[cfg(target_os = "fuchsia")]
1466impl From<fidl::Channel> for ControllerSynchronousProxy {
1467    fn from(value: fidl::Channel) -> Self {
1468        Self::new(value)
1469    }
1470}
1471
1472#[cfg(target_os = "fuchsia")]
1473impl fidl::endpoints::FromClient for ControllerSynchronousProxy {
1474    type Protocol = ControllerMarker;
1475
1476    fn from_client(value: fidl::endpoints::ClientEnd<ControllerMarker>) -> Self {
1477        Self::new(value.into_channel())
1478    }
1479}
1480
1481#[derive(Debug, Clone)]
1482pub struct ControllerProxy {
1483    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1484}
1485
1486impl fidl::endpoints::Proxy for ControllerProxy {
1487    type Protocol = ControllerMarker;
1488
1489    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1490        Self::new(inner)
1491    }
1492
1493    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1494        self.client.into_channel().map_err(|client| Self { client })
1495    }
1496
1497    fn as_channel(&self) -> &::fidl::AsyncChannel {
1498        self.client.as_channel()
1499    }
1500}
1501
1502impl ControllerProxy {
1503    /// Create a new Proxy for fuchsia.component/Controller.
1504    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1505        let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1506        Self { client: fidl::client::Client::new(channel, protocol_name) }
1507    }
1508
1509    /// Get a Stream of events from the remote end of the protocol.
1510    ///
1511    /// # Panics
1512    ///
1513    /// Panics if the event stream was already taken.
1514    pub fn take_event_stream(&self) -> ControllerEventStream {
1515        ControllerEventStream { event_receiver: self.client.take_event_receiver() }
1516    }
1517
1518    /// Start the component, optionally providing additional handles to be given
1519    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1520    /// currently running.
1521    pub fn r#start(
1522        &self,
1523        mut args: StartChildArgs,
1524        mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1525    ) -> fidl::client::QueryResponseFut<
1526        ControllerStartResult,
1527        fidl::encoding::DefaultFuchsiaResourceDialect,
1528    > {
1529        ControllerProxyInterface::r#start(self, args, execution_controller)
1530    }
1531
1532    /// Returns true if this instance is currently running.
1533    pub fn r#is_started(
1534        &self,
1535    ) -> fidl::client::QueryResponseFut<
1536        ControllerIsStartedResult,
1537        fidl::encoding::DefaultFuchsiaResourceDialect,
1538    > {
1539        ControllerProxyInterface::r#is_started(self)
1540    }
1541
1542    /// Opens the exposed directory of the controlled component, through which
1543    /// capabilities the component exposed via `ComponentDecl.exposes` are
1544    /// available, on success.
1545    ///
1546    /// Binding to the exposed directory requires that the component be
1547    /// resolved, but it will not be started until/unless some capability is
1548    /// requested that requires it to be.
1549    ///
1550    /// If this component is destroyed, any outstanding connections to
1551    /// `exposed_dir` will be closed.
1552    ///
1553    /// Errors:
1554    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
1555    pub fn r#open_exposed_dir(
1556        &self,
1557        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1558    ) -> fidl::client::QueryResponseFut<
1559        ControllerOpenExposedDirResult,
1560        fidl::encoding::DefaultFuchsiaResourceDialect,
1561    > {
1562        ControllerProxyInterface::r#open_exposed_dir(self, exposed_dir)
1563    }
1564
1565    /// Returns the dictionary containing the component's exposed capabilities.
1566    pub fn r#get_exposed_dictionary(
1567        &self,
1568    ) -> fidl::client::QueryResponseFut<
1569        ControllerGetExposedDictionaryResult,
1570        fidl::encoding::DefaultFuchsiaResourceDialect,
1571    > {
1572        ControllerProxyInterface::r#get_exposed_dictionary(self)
1573    }
1574
1575    /// Returns a reference to the component's output dictionary, which may be
1576    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
1577    pub fn r#get_output_dictionary(
1578        &self,
1579    ) -> fidl::client::QueryResponseFut<
1580        ControllerGetOutputDictionaryResult,
1581        fidl::encoding::DefaultFuchsiaResourceDialect,
1582    > {
1583        ControllerProxyInterface::r#get_output_dictionary(self)
1584    }
1585
1586    /// Destroys this component. When this method returns, the component is
1587    /// either destroyed or in the case of an error no destruction happened.
1588    ///
1589    /// Errors:
1590    ///
1591    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1592    /// Currently, this can happen if the component is a static child of its
1593    /// parent.
1594    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
1595    ///   manager's logs will contain more detail.
1596    pub fn r#destroy(
1597        &self,
1598    ) -> fidl::client::QueryResponseFut<
1599        ControllerDestroyResult,
1600        fidl::encoding::DefaultFuchsiaResourceDialect,
1601    > {
1602        ControllerProxyInterface::r#destroy(self)
1603    }
1604}
1605
1606impl ControllerProxyInterface for ControllerProxy {
1607    type StartResponseFut = fidl::client::QueryResponseFut<
1608        ControllerStartResult,
1609        fidl::encoding::DefaultFuchsiaResourceDialect,
1610    >;
1611    fn r#start(
1612        &self,
1613        mut args: StartChildArgs,
1614        mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1615    ) -> Self::StartResponseFut {
1616        fn _decode(
1617            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1618        ) -> Result<ControllerStartResult, fidl::Error> {
1619            let _response = fidl::client::decode_transaction_body::<
1620                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1621                fidl::encoding::DefaultFuchsiaResourceDialect,
1622                0x68878076b8d2eac5,
1623            >(_buf?)?
1624            .into_result::<ControllerMarker>("start")?;
1625            Ok(_response.map(|x| x))
1626        }
1627        self.client.send_query_and_decode::<ControllerStartRequest, ControllerStartResult>(
1628            (&mut args, execution_controller),
1629            0x68878076b8d2eac5,
1630            fidl::encoding::DynamicFlags::FLEXIBLE,
1631            _decode,
1632        )
1633    }
1634
1635    type IsStartedResponseFut = fidl::client::QueryResponseFut<
1636        ControllerIsStartedResult,
1637        fidl::encoding::DefaultFuchsiaResourceDialect,
1638    >;
1639    fn r#is_started(&self) -> Self::IsStartedResponseFut {
1640        fn _decode(
1641            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1642        ) -> Result<ControllerIsStartedResult, fidl::Error> {
1643            let _response = fidl::client::decode_transaction_body::<
1644                fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1645                fidl::encoding::DefaultFuchsiaResourceDialect,
1646                0x2155e6e1db2083c3,
1647            >(_buf?)?
1648            .into_result::<ControllerMarker>("is_started")?;
1649            Ok(_response.map(|x| x.is_started))
1650        }
1651        self.client
1652            .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerIsStartedResult>(
1653                (),
1654                0x2155e6e1db2083c3,
1655                fidl::encoding::DynamicFlags::FLEXIBLE,
1656                _decode,
1657            )
1658    }
1659
1660    type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
1661        ControllerOpenExposedDirResult,
1662        fidl::encoding::DefaultFuchsiaResourceDialect,
1663    >;
1664    fn r#open_exposed_dir(
1665        &self,
1666        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1667    ) -> Self::OpenExposedDirResponseFut {
1668        fn _decode(
1669            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1670        ) -> Result<ControllerOpenExposedDirResult, fidl::Error> {
1671            let _response = fidl::client::decode_transaction_body::<
1672                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1673                fidl::encoding::DefaultFuchsiaResourceDialect,
1674                0x253cabb9a840ed94,
1675            >(_buf?)?;
1676            Ok(_response.map(|x| x))
1677        }
1678        self.client.send_query_and_decode::<
1679            ControllerOpenExposedDirRequest,
1680            ControllerOpenExposedDirResult,
1681        >(
1682            (exposed_dir,),
1683            0x253cabb9a840ed94,
1684            fidl::encoding::DynamicFlags::empty(),
1685            _decode,
1686        )
1687    }
1688
1689    type GetExposedDictionaryResponseFut = fidl::client::QueryResponseFut<
1690        ControllerGetExposedDictionaryResult,
1691        fidl::encoding::DefaultFuchsiaResourceDialect,
1692    >;
1693    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut {
1694        fn _decode(
1695            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1696        ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1697            let _response = fidl::client::decode_transaction_body::<
1698                fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1699                fidl::encoding::DefaultFuchsiaResourceDialect,
1700                0x7e48373e5eda1f9b,
1701            >(_buf?)?
1702            .into_result::<ControllerMarker>("get_exposed_dictionary")?;
1703            Ok(_response.map(|x| x.dictionary))
1704        }
1705        self.client.send_query_and_decode::<
1706            fidl::encoding::EmptyPayload,
1707            ControllerGetExposedDictionaryResult,
1708        >(
1709            (),
1710            0x7e48373e5eda1f9b,
1711            fidl::encoding::DynamicFlags::FLEXIBLE,
1712            _decode,
1713        )
1714    }
1715
1716    type GetOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
1717        ControllerGetOutputDictionaryResult,
1718        fidl::encoding::DefaultFuchsiaResourceDialect,
1719    >;
1720    fn r#get_output_dictionary(&self) -> Self::GetOutputDictionaryResponseFut {
1721        fn _decode(
1722            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1723        ) -> Result<ControllerGetOutputDictionaryResult, fidl::Error> {
1724            let _response = fidl::client::decode_transaction_body::<
1725                fidl::encoding::FlexibleResultType<ControllerGetOutputDictionaryResponse, Error>,
1726                fidl::encoding::DefaultFuchsiaResourceDialect,
1727                0x3a0c4696620ad221,
1728            >(_buf?)?
1729            .into_result::<ControllerMarker>("get_output_dictionary")?;
1730            Ok(_response.map(|x| x.dictionary))
1731        }
1732        self.client.send_query_and_decode::<
1733            fidl::encoding::EmptyPayload,
1734            ControllerGetOutputDictionaryResult,
1735        >(
1736            (),
1737            0x3a0c4696620ad221,
1738            fidl::encoding::DynamicFlags::FLEXIBLE,
1739            _decode,
1740        )
1741    }
1742
1743    type DestroyResponseFut = fidl::client::QueryResponseFut<
1744        ControllerDestroyResult,
1745        fidl::encoding::DefaultFuchsiaResourceDialect,
1746    >;
1747    fn r#destroy(&self) -> Self::DestroyResponseFut {
1748        fn _decode(
1749            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1750        ) -> Result<ControllerDestroyResult, fidl::Error> {
1751            let _response = fidl::client::decode_transaction_body::<
1752                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1753                fidl::encoding::DefaultFuchsiaResourceDialect,
1754                0x74529fa68b5c1741,
1755            >(_buf?)?
1756            .into_result::<ControllerMarker>("destroy")?;
1757            Ok(_response.map(|x| x))
1758        }
1759        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerDestroyResult>(
1760            (),
1761            0x74529fa68b5c1741,
1762            fidl::encoding::DynamicFlags::FLEXIBLE,
1763            _decode,
1764        )
1765    }
1766}
1767
1768pub struct ControllerEventStream {
1769    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1770}
1771
1772impl std::marker::Unpin for ControllerEventStream {}
1773
1774impl futures::stream::FusedStream for ControllerEventStream {
1775    fn is_terminated(&self) -> bool {
1776        self.event_receiver.is_terminated()
1777    }
1778}
1779
1780impl futures::Stream for ControllerEventStream {
1781    type Item = Result<ControllerEvent, fidl::Error>;
1782
1783    fn poll_next(
1784        mut self: std::pin::Pin<&mut Self>,
1785        cx: &mut std::task::Context<'_>,
1786    ) -> std::task::Poll<Option<Self::Item>> {
1787        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1788            &mut self.event_receiver,
1789            cx
1790        )?) {
1791            Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1792            None => std::task::Poll::Ready(None),
1793        }
1794    }
1795}
1796
1797#[derive(Debug)]
1798pub enum ControllerEvent {
1799    #[non_exhaustive]
1800    _UnknownEvent {
1801        /// Ordinal of the event that was sent.
1802        ordinal: u64,
1803    },
1804}
1805
1806impl ControllerEvent {
1807    /// Decodes a message buffer as a [`ControllerEvent`].
1808    fn decode(
1809        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1810    ) -> Result<ControllerEvent, fidl::Error> {
1811        let (bytes, _handles) = buf.split_mut();
1812        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1813        debug_assert_eq!(tx_header.tx_id, 0);
1814        match tx_header.ordinal {
1815            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1816                Ok(ControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1817            }
1818            _ => Err(fidl::Error::UnknownOrdinal {
1819                ordinal: tx_header.ordinal,
1820                protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1821            }),
1822        }
1823    }
1824}
1825
1826/// A Stream of incoming requests for fuchsia.component/Controller.
1827pub struct ControllerRequestStream {
1828    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1829    is_terminated: bool,
1830}
1831
1832impl std::marker::Unpin for ControllerRequestStream {}
1833
1834impl futures::stream::FusedStream for ControllerRequestStream {
1835    fn is_terminated(&self) -> bool {
1836        self.is_terminated
1837    }
1838}
1839
1840impl fidl::endpoints::RequestStream for ControllerRequestStream {
1841    type Protocol = ControllerMarker;
1842    type ControlHandle = ControllerControlHandle;
1843
1844    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1845        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1846    }
1847
1848    fn control_handle(&self) -> Self::ControlHandle {
1849        ControllerControlHandle { inner: self.inner.clone() }
1850    }
1851
1852    fn into_inner(
1853        self,
1854    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1855    {
1856        (self.inner, self.is_terminated)
1857    }
1858
1859    fn from_inner(
1860        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1861        is_terminated: bool,
1862    ) -> Self {
1863        Self { inner, is_terminated }
1864    }
1865}
1866
1867impl futures::Stream for ControllerRequestStream {
1868    type Item = Result<ControllerRequest, fidl::Error>;
1869
1870    fn poll_next(
1871        mut self: std::pin::Pin<&mut Self>,
1872        cx: &mut std::task::Context<'_>,
1873    ) -> std::task::Poll<Option<Self::Item>> {
1874        let this = &mut *self;
1875        if this.inner.check_shutdown(cx) {
1876            this.is_terminated = true;
1877            return std::task::Poll::Ready(None);
1878        }
1879        if this.is_terminated {
1880            panic!("polled ControllerRequestStream after completion");
1881        }
1882        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1883            |bytes, handles| {
1884                match this.inner.channel().read_etc(cx, bytes, handles) {
1885                    std::task::Poll::Ready(Ok(())) => {}
1886                    std::task::Poll::Pending => return std::task::Poll::Pending,
1887                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1888                        this.is_terminated = true;
1889                        return std::task::Poll::Ready(None);
1890                    }
1891                    std::task::Poll::Ready(Err(e)) => {
1892                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1893                            e.into(),
1894                        ))));
1895                    }
1896                }
1897
1898                // A message has been received from the channel
1899                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1900
1901                std::task::Poll::Ready(Some(match header.ordinal {
1902                    0x68878076b8d2eac5 => {
1903                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1904                        let mut req = fidl::new_empty!(
1905                            ControllerStartRequest,
1906                            fidl::encoding::DefaultFuchsiaResourceDialect
1907                        );
1908                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1909                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1910                        Ok(ControllerRequest::Start {
1911                            args: req.args,
1912                            execution_controller: req.execution_controller,
1913
1914                            responder: ControllerStartResponder {
1915                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1916                                tx_id: header.tx_id,
1917                            },
1918                        })
1919                    }
1920                    0x2155e6e1db2083c3 => {
1921                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1922                        let mut req = fidl::new_empty!(
1923                            fidl::encoding::EmptyPayload,
1924                            fidl::encoding::DefaultFuchsiaResourceDialect
1925                        );
1926                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1927                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1928                        Ok(ControllerRequest::IsStarted {
1929                            responder: ControllerIsStartedResponder {
1930                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1931                                tx_id: header.tx_id,
1932                            },
1933                        })
1934                    }
1935                    0x253cabb9a840ed94 => {
1936                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1937                        let mut req = fidl::new_empty!(
1938                            ControllerOpenExposedDirRequest,
1939                            fidl::encoding::DefaultFuchsiaResourceDialect
1940                        );
1941                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
1942                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1943                        Ok(ControllerRequest::OpenExposedDir {
1944                            exposed_dir: req.exposed_dir,
1945
1946                            responder: ControllerOpenExposedDirResponder {
1947                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1948                                tx_id: header.tx_id,
1949                            },
1950                        })
1951                    }
1952                    0x7e48373e5eda1f9b => {
1953                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1954                        let mut req = fidl::new_empty!(
1955                            fidl::encoding::EmptyPayload,
1956                            fidl::encoding::DefaultFuchsiaResourceDialect
1957                        );
1958                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1959                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1960                        Ok(ControllerRequest::GetExposedDictionary {
1961                            responder: ControllerGetExposedDictionaryResponder {
1962                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1963                                tx_id: header.tx_id,
1964                            },
1965                        })
1966                    }
1967                    0x3a0c4696620ad221 => {
1968                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1969                        let mut req = fidl::new_empty!(
1970                            fidl::encoding::EmptyPayload,
1971                            fidl::encoding::DefaultFuchsiaResourceDialect
1972                        );
1973                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1974                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1975                        Ok(ControllerRequest::GetOutputDictionary {
1976                            responder: ControllerGetOutputDictionaryResponder {
1977                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1978                                tx_id: header.tx_id,
1979                            },
1980                        })
1981                    }
1982                    0x74529fa68b5c1741 => {
1983                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1984                        let mut req = fidl::new_empty!(
1985                            fidl::encoding::EmptyPayload,
1986                            fidl::encoding::DefaultFuchsiaResourceDialect
1987                        );
1988                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1989                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1990                        Ok(ControllerRequest::Destroy {
1991                            responder: ControllerDestroyResponder {
1992                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1993                                tx_id: header.tx_id,
1994                            },
1995                        })
1996                    }
1997                    _ if header.tx_id == 0
1998                        && header
1999                            .dynamic_flags()
2000                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2001                    {
2002                        Ok(ControllerRequest::_UnknownMethod {
2003                            ordinal: header.ordinal,
2004                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
2005                            method_type: fidl::MethodType::OneWay,
2006                        })
2007                    }
2008                    _ if header
2009                        .dynamic_flags()
2010                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2011                    {
2012                        this.inner.send_framework_err(
2013                            fidl::encoding::FrameworkErr::UnknownMethod,
2014                            header.tx_id,
2015                            header.ordinal,
2016                            header.dynamic_flags(),
2017                            (bytes, handles),
2018                        )?;
2019                        Ok(ControllerRequest::_UnknownMethod {
2020                            ordinal: header.ordinal,
2021                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
2022                            method_type: fidl::MethodType::TwoWay,
2023                        })
2024                    }
2025                    _ => Err(fidl::Error::UnknownOrdinal {
2026                        ordinal: header.ordinal,
2027                        protocol_name:
2028                            <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2029                    }),
2030                }))
2031            },
2032        )
2033    }
2034}
2035
2036/// A protocol used to operate on a component.
2037///
2038/// One may get access to a `Controller` when creating a component with the
2039/// `Realm.CreateChild` method. You may also obtain a `Controller` for an
2040/// existing child component with the `Realm.OpenController` method.
2041#[derive(Debug)]
2042pub enum ControllerRequest {
2043    /// Start the component, optionally providing additional handles to be given
2044    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
2045    /// currently running.
2046    Start {
2047        args: StartChildArgs,
2048        execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
2049        responder: ControllerStartResponder,
2050    },
2051    /// Returns true if this instance is currently running.
2052    IsStarted { responder: ControllerIsStartedResponder },
2053    /// Opens the exposed directory of the controlled component, through which
2054    /// capabilities the component exposed via `ComponentDecl.exposes` are
2055    /// available, on success.
2056    ///
2057    /// Binding to the exposed directory requires that the component be
2058    /// resolved, but it will not be started until/unless some capability is
2059    /// requested that requires it to be.
2060    ///
2061    /// If this component is destroyed, any outstanding connections to
2062    /// `exposed_dir` will be closed.
2063    ///
2064    /// Errors:
2065    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
2066    OpenExposedDir {
2067        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2068        responder: ControllerOpenExposedDirResponder,
2069    },
2070    /// Returns the dictionary containing the component's exposed capabilities.
2071    GetExposedDictionary { responder: ControllerGetExposedDictionaryResponder },
2072    /// Returns a reference to the component's output dictionary, which may be
2073    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
2074    GetOutputDictionary { responder: ControllerGetOutputDictionaryResponder },
2075    /// Destroys this component. When this method returns, the component is
2076    /// either destroyed or in the case of an error no destruction happened.
2077    ///
2078    /// Errors:
2079    ///
2080    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
2081    /// Currently, this can happen if the component is a static child of its
2082    /// parent.
2083    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
2084    ///   manager's logs will contain more detail.
2085    Destroy { responder: ControllerDestroyResponder },
2086    /// An interaction was received which does not match any known method.
2087    #[non_exhaustive]
2088    _UnknownMethod {
2089        /// Ordinal of the method that was called.
2090        ordinal: u64,
2091        control_handle: ControllerControlHandle,
2092        method_type: fidl::MethodType,
2093    },
2094}
2095
2096impl ControllerRequest {
2097    #[allow(irrefutable_let_patterns)]
2098    pub fn into_start(
2099        self,
2100    ) -> Option<(
2101        StartChildArgs,
2102        fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
2103        ControllerStartResponder,
2104    )> {
2105        if let ControllerRequest::Start { args, execution_controller, responder } = self {
2106            Some((args, execution_controller, responder))
2107        } else {
2108            None
2109        }
2110    }
2111
2112    #[allow(irrefutable_let_patterns)]
2113    pub fn into_is_started(self) -> Option<(ControllerIsStartedResponder)> {
2114        if let ControllerRequest::IsStarted { responder } = self { Some((responder)) } else { None }
2115    }
2116
2117    #[allow(irrefutable_let_patterns)]
2118    pub fn into_open_exposed_dir(
2119        self,
2120    ) -> Option<(
2121        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2122        ControllerOpenExposedDirResponder,
2123    )> {
2124        if let ControllerRequest::OpenExposedDir { exposed_dir, responder } = self {
2125            Some((exposed_dir, responder))
2126        } else {
2127            None
2128        }
2129    }
2130
2131    #[allow(irrefutable_let_patterns)]
2132    pub fn into_get_exposed_dictionary(self) -> Option<(ControllerGetExposedDictionaryResponder)> {
2133        if let ControllerRequest::GetExposedDictionary { responder } = self {
2134            Some((responder))
2135        } else {
2136            None
2137        }
2138    }
2139
2140    #[allow(irrefutable_let_patterns)]
2141    pub fn into_get_output_dictionary(self) -> Option<(ControllerGetOutputDictionaryResponder)> {
2142        if let ControllerRequest::GetOutputDictionary { responder } = self {
2143            Some((responder))
2144        } else {
2145            None
2146        }
2147    }
2148
2149    #[allow(irrefutable_let_patterns)]
2150    pub fn into_destroy(self) -> Option<(ControllerDestroyResponder)> {
2151        if let ControllerRequest::Destroy { responder } = self { Some((responder)) } else { None }
2152    }
2153
2154    /// Name of the method defined in FIDL
2155    pub fn method_name(&self) -> &'static str {
2156        match *self {
2157            ControllerRequest::Start { .. } => "start",
2158            ControllerRequest::IsStarted { .. } => "is_started",
2159            ControllerRequest::OpenExposedDir { .. } => "open_exposed_dir",
2160            ControllerRequest::GetExposedDictionary { .. } => "get_exposed_dictionary",
2161            ControllerRequest::GetOutputDictionary { .. } => "get_output_dictionary",
2162            ControllerRequest::Destroy { .. } => "destroy",
2163            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2164                "unknown one-way method"
2165            }
2166            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2167                "unknown two-way method"
2168            }
2169        }
2170    }
2171}
2172
2173#[derive(Debug, Clone)]
2174pub struct ControllerControlHandle {
2175    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2176}
2177
2178impl fidl::endpoints::ControlHandle for ControllerControlHandle {
2179    fn shutdown(&self) {
2180        self.inner.shutdown()
2181    }
2182
2183    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2184        self.inner.shutdown_with_epitaph(status)
2185    }
2186
2187    fn is_closed(&self) -> bool {
2188        self.inner.channel().is_closed()
2189    }
2190    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2191        self.inner.channel().on_closed()
2192    }
2193
2194    #[cfg(target_os = "fuchsia")]
2195    fn signal_peer(
2196        &self,
2197        clear_mask: zx::Signals,
2198        set_mask: zx::Signals,
2199    ) -> Result<(), zx_status::Status> {
2200        use fidl::Peered;
2201        self.inner.channel().signal_peer(clear_mask, set_mask)
2202    }
2203}
2204
2205impl ControllerControlHandle {}
2206
2207#[must_use = "FIDL methods require a response to be sent"]
2208#[derive(Debug)]
2209pub struct ControllerStartResponder {
2210    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2211    tx_id: u32,
2212}
2213
2214/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2215/// if the responder is dropped without sending a response, so that the client
2216/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2217impl std::ops::Drop for ControllerStartResponder {
2218    fn drop(&mut self) {
2219        self.control_handle.shutdown();
2220        // Safety: drops once, never accessed again
2221        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2222    }
2223}
2224
2225impl fidl::endpoints::Responder for ControllerStartResponder {
2226    type ControlHandle = ControllerControlHandle;
2227
2228    fn control_handle(&self) -> &ControllerControlHandle {
2229        &self.control_handle
2230    }
2231
2232    fn drop_without_shutdown(mut self) {
2233        // Safety: drops once, never accessed again due to mem::forget
2234        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2235        // Prevent Drop from running (which would shut down the channel)
2236        std::mem::forget(self);
2237    }
2238}
2239
2240impl ControllerStartResponder {
2241    /// Sends a response to the FIDL transaction.
2242    ///
2243    /// Sets the channel to shutdown if an error occurs.
2244    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2245        let _result = self.send_raw(result);
2246        if _result.is_err() {
2247            self.control_handle.shutdown();
2248        }
2249        self.drop_without_shutdown();
2250        _result
2251    }
2252
2253    /// Similar to "send" but does not shutdown the channel if an error occurs.
2254    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2255        let _result = self.send_raw(result);
2256        self.drop_without_shutdown();
2257        _result
2258    }
2259
2260    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2261        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2262            fidl::encoding::EmptyStruct,
2263            Error,
2264        >>(
2265            fidl::encoding::FlexibleResult::new(result),
2266            self.tx_id,
2267            0x68878076b8d2eac5,
2268            fidl::encoding::DynamicFlags::FLEXIBLE,
2269        )
2270    }
2271}
2272
2273#[must_use = "FIDL methods require a response to be sent"]
2274#[derive(Debug)]
2275pub struct ControllerIsStartedResponder {
2276    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2277    tx_id: u32,
2278}
2279
2280/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2281/// if the responder is dropped without sending a response, so that the client
2282/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2283impl std::ops::Drop for ControllerIsStartedResponder {
2284    fn drop(&mut self) {
2285        self.control_handle.shutdown();
2286        // Safety: drops once, never accessed again
2287        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2288    }
2289}
2290
2291impl fidl::endpoints::Responder for ControllerIsStartedResponder {
2292    type ControlHandle = ControllerControlHandle;
2293
2294    fn control_handle(&self) -> &ControllerControlHandle {
2295        &self.control_handle
2296    }
2297
2298    fn drop_without_shutdown(mut self) {
2299        // Safety: drops once, never accessed again due to mem::forget
2300        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2301        // Prevent Drop from running (which would shut down the channel)
2302        std::mem::forget(self);
2303    }
2304}
2305
2306impl ControllerIsStartedResponder {
2307    /// Sends a response to the FIDL transaction.
2308    ///
2309    /// Sets the channel to shutdown if an error occurs.
2310    pub fn send(self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
2311        let _result = self.send_raw(result);
2312        if _result.is_err() {
2313            self.control_handle.shutdown();
2314        }
2315        self.drop_without_shutdown();
2316        _result
2317    }
2318
2319    /// Similar to "send" but does not shutdown the channel if an error occurs.
2320    pub fn send_no_shutdown_on_err(
2321        self,
2322        mut result: Result<bool, Error>,
2323    ) -> Result<(), fidl::Error> {
2324        let _result = self.send_raw(result);
2325        self.drop_without_shutdown();
2326        _result
2327    }
2328
2329    fn send_raw(&self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
2330        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2331            ControllerIsStartedResponse,
2332            Error,
2333        >>(
2334            fidl::encoding::FlexibleResult::new(result.map(|is_started| (is_started,))),
2335            self.tx_id,
2336            0x2155e6e1db2083c3,
2337            fidl::encoding::DynamicFlags::FLEXIBLE,
2338        )
2339    }
2340}
2341
2342#[must_use = "FIDL methods require a response to be sent"]
2343#[derive(Debug)]
2344pub struct ControllerOpenExposedDirResponder {
2345    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2346    tx_id: u32,
2347}
2348
2349/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2350/// if the responder is dropped without sending a response, so that the client
2351/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2352impl std::ops::Drop for ControllerOpenExposedDirResponder {
2353    fn drop(&mut self) {
2354        self.control_handle.shutdown();
2355        // Safety: drops once, never accessed again
2356        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2357    }
2358}
2359
2360impl fidl::endpoints::Responder for ControllerOpenExposedDirResponder {
2361    type ControlHandle = ControllerControlHandle;
2362
2363    fn control_handle(&self) -> &ControllerControlHandle {
2364        &self.control_handle
2365    }
2366
2367    fn drop_without_shutdown(mut self) {
2368        // Safety: drops once, never accessed again due to mem::forget
2369        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2370        // Prevent Drop from running (which would shut down the channel)
2371        std::mem::forget(self);
2372    }
2373}
2374
2375impl ControllerOpenExposedDirResponder {
2376    /// Sends a response to the FIDL transaction.
2377    ///
2378    /// Sets the channel to shutdown if an error occurs.
2379    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2380        let _result = self.send_raw(result);
2381        if _result.is_err() {
2382            self.control_handle.shutdown();
2383        }
2384        self.drop_without_shutdown();
2385        _result
2386    }
2387
2388    /// Similar to "send" but does not shutdown the channel if an error occurs.
2389    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2390        let _result = self.send_raw(result);
2391        self.drop_without_shutdown();
2392        _result
2393    }
2394
2395    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2396        self.control_handle
2397            .inner
2398            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2399                result,
2400                self.tx_id,
2401                0x253cabb9a840ed94,
2402                fidl::encoding::DynamicFlags::empty(),
2403            )
2404    }
2405}
2406
2407#[must_use = "FIDL methods require a response to be sent"]
2408#[derive(Debug)]
2409pub struct ControllerGetExposedDictionaryResponder {
2410    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2411    tx_id: u32,
2412}
2413
2414/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2415/// if the responder is dropped without sending a response, so that the client
2416/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2417impl std::ops::Drop for ControllerGetExposedDictionaryResponder {
2418    fn drop(&mut self) {
2419        self.control_handle.shutdown();
2420        // Safety: drops once, never accessed again
2421        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2422    }
2423}
2424
2425impl fidl::endpoints::Responder for ControllerGetExposedDictionaryResponder {
2426    type ControlHandle = ControllerControlHandle;
2427
2428    fn control_handle(&self) -> &ControllerControlHandle {
2429        &self.control_handle
2430    }
2431
2432    fn drop_without_shutdown(mut self) {
2433        // Safety: drops once, never accessed again due to mem::forget
2434        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2435        // Prevent Drop from running (which would shut down the channel)
2436        std::mem::forget(self);
2437    }
2438}
2439
2440impl ControllerGetExposedDictionaryResponder {
2441    /// Sends a response to the FIDL transaction.
2442    ///
2443    /// Sets the channel to shutdown if an error occurs.
2444    pub fn send(
2445        self,
2446        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2447    ) -> Result<(), fidl::Error> {
2448        let _result = self.send_raw(result);
2449        if _result.is_err() {
2450            self.control_handle.shutdown();
2451        }
2452        self.drop_without_shutdown();
2453        _result
2454    }
2455
2456    /// Similar to "send" but does not shutdown the channel if an error occurs.
2457    pub fn send_no_shutdown_on_err(
2458        self,
2459        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2460    ) -> Result<(), fidl::Error> {
2461        let _result = self.send_raw(result);
2462        self.drop_without_shutdown();
2463        _result
2464    }
2465
2466    fn send_raw(
2467        &self,
2468        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2469    ) -> Result<(), fidl::Error> {
2470        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2471            ControllerGetExposedDictionaryResponse,
2472            Error,
2473        >>(
2474            fidl::encoding::FlexibleResult::new(
2475                result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
2476            ),
2477            self.tx_id,
2478            0x7e48373e5eda1f9b,
2479            fidl::encoding::DynamicFlags::FLEXIBLE,
2480        )
2481    }
2482}
2483
2484#[must_use = "FIDL methods require a response to be sent"]
2485#[derive(Debug)]
2486pub struct ControllerGetOutputDictionaryResponder {
2487    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2488    tx_id: u32,
2489}
2490
2491/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2492/// if the responder is dropped without sending a response, so that the client
2493/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2494impl std::ops::Drop for ControllerGetOutputDictionaryResponder {
2495    fn drop(&mut self) {
2496        self.control_handle.shutdown();
2497        // Safety: drops once, never accessed again
2498        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2499    }
2500}
2501
2502impl fidl::endpoints::Responder for ControllerGetOutputDictionaryResponder {
2503    type ControlHandle = ControllerControlHandle;
2504
2505    fn control_handle(&self) -> &ControllerControlHandle {
2506        &self.control_handle
2507    }
2508
2509    fn drop_without_shutdown(mut self) {
2510        // Safety: drops once, never accessed again due to mem::forget
2511        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2512        // Prevent Drop from running (which would shut down the channel)
2513        std::mem::forget(self);
2514    }
2515}
2516
2517impl ControllerGetOutputDictionaryResponder {
2518    /// Sends a response to the FIDL transaction.
2519    ///
2520    /// Sets the channel to shutdown if an error occurs.
2521    pub fn send(self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
2522        let _result = self.send_raw(result);
2523        if _result.is_err() {
2524            self.control_handle.shutdown();
2525        }
2526        self.drop_without_shutdown();
2527        _result
2528    }
2529
2530    /// Similar to "send" but does not shutdown the channel if an error occurs.
2531    pub fn send_no_shutdown_on_err(
2532        self,
2533        mut result: Result<fidl::EventPair, Error>,
2534    ) -> Result<(), fidl::Error> {
2535        let _result = self.send_raw(result);
2536        self.drop_without_shutdown();
2537        _result
2538    }
2539
2540    fn send_raw(&self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
2541        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2542            ControllerGetOutputDictionaryResponse,
2543            Error,
2544        >>(
2545            fidl::encoding::FlexibleResult::new(result.map(|dictionary| (dictionary,))),
2546            self.tx_id,
2547            0x3a0c4696620ad221,
2548            fidl::encoding::DynamicFlags::FLEXIBLE,
2549        )
2550    }
2551}
2552
2553#[must_use = "FIDL methods require a response to be sent"]
2554#[derive(Debug)]
2555pub struct ControllerDestroyResponder {
2556    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2557    tx_id: u32,
2558}
2559
2560/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2561/// if the responder is dropped without sending a response, so that the client
2562/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2563impl std::ops::Drop for ControllerDestroyResponder {
2564    fn drop(&mut self) {
2565        self.control_handle.shutdown();
2566        // Safety: drops once, never accessed again
2567        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2568    }
2569}
2570
2571impl fidl::endpoints::Responder for ControllerDestroyResponder {
2572    type ControlHandle = ControllerControlHandle;
2573
2574    fn control_handle(&self) -> &ControllerControlHandle {
2575        &self.control_handle
2576    }
2577
2578    fn drop_without_shutdown(mut self) {
2579        // Safety: drops once, never accessed again due to mem::forget
2580        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2581        // Prevent Drop from running (which would shut down the channel)
2582        std::mem::forget(self);
2583    }
2584}
2585
2586impl ControllerDestroyResponder {
2587    /// Sends a response to the FIDL transaction.
2588    ///
2589    /// Sets the channel to shutdown if an error occurs.
2590    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2591        let _result = self.send_raw(result);
2592        if _result.is_err() {
2593            self.control_handle.shutdown();
2594        }
2595        self.drop_without_shutdown();
2596        _result
2597    }
2598
2599    /// Similar to "send" but does not shutdown the channel if an error occurs.
2600    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2601        let _result = self.send_raw(result);
2602        self.drop_without_shutdown();
2603        _result
2604    }
2605
2606    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2607        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2608            fidl::encoding::EmptyStruct,
2609            Error,
2610        >>(
2611            fidl::encoding::FlexibleResult::new(result),
2612            self.tx_id,
2613            0x74529fa68b5c1741,
2614            fidl::encoding::DynamicFlags::FLEXIBLE,
2615        )
2616    }
2617}
2618
2619#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2620pub struct EventStreamMarker;
2621
2622impl fidl::endpoints::ProtocolMarker for EventStreamMarker {
2623    type Proxy = EventStreamProxy;
2624    type RequestStream = EventStreamRequestStream;
2625    #[cfg(target_os = "fuchsia")]
2626    type SynchronousProxy = EventStreamSynchronousProxy;
2627
2628    const DEBUG_NAME: &'static str = "fuchsia.component.EventStream";
2629}
2630impl fidl::endpoints::DiscoverableProtocolMarker for EventStreamMarker {}
2631
2632pub trait EventStreamProxyInterface: Send + Sync {
2633    type GetNextResponseFut: std::future::Future<Output = Result<Vec<Event>, fidl::Error>> + Send;
2634    fn r#get_next(&self) -> Self::GetNextResponseFut;
2635    type WaitForReadyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2636    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut;
2637}
2638#[derive(Debug)]
2639#[cfg(target_os = "fuchsia")]
2640pub struct EventStreamSynchronousProxy {
2641    client: fidl::client::sync::Client,
2642}
2643
2644#[cfg(target_os = "fuchsia")]
2645impl fidl::endpoints::SynchronousProxy for EventStreamSynchronousProxy {
2646    type Proxy = EventStreamProxy;
2647    type Protocol = EventStreamMarker;
2648
2649    fn from_channel(inner: fidl::Channel) -> Self {
2650        Self::new(inner)
2651    }
2652
2653    fn into_channel(self) -> fidl::Channel {
2654        self.client.into_channel()
2655    }
2656
2657    fn as_channel(&self) -> &fidl::Channel {
2658        self.client.as_channel()
2659    }
2660}
2661
2662#[cfg(target_os = "fuchsia")]
2663impl EventStreamSynchronousProxy {
2664    pub fn new(channel: fidl::Channel) -> Self {
2665        let protocol_name = <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2666        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2667    }
2668
2669    pub fn into_channel(self) -> fidl::Channel {
2670        self.client.into_channel()
2671    }
2672
2673    /// Waits until an event arrives and returns it. It is safe for other
2674    /// threads to make concurrent requests while waiting for an event.
2675    pub fn wait_for_event(
2676        &self,
2677        deadline: zx::MonotonicInstant,
2678    ) -> Result<EventStreamEvent, fidl::Error> {
2679        EventStreamEvent::decode(self.client.wait_for_event(deadline)?)
2680    }
2681
2682    pub fn r#get_next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Event>, fidl::Error> {
2683        let _response =
2684            self.client.send_query::<fidl::encoding::EmptyPayload, EventStreamGetNextResponse>(
2685                (),
2686                0x3f24c9495978eb86,
2687                fidl::encoding::DynamicFlags::empty(),
2688                ___deadline,
2689            )?;
2690        Ok(_response.events)
2691    }
2692
2693    /// Returns immediately. Used to indicate that the FIDL connection
2694    /// completed. This is needed for non-static streams to verify
2695    /// that subscribe has completed before components are started.
2696    pub fn r#wait_for_ready(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2697        let _response =
2698            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
2699                (),
2700                0x31331f9578d2e682,
2701                fidl::encoding::DynamicFlags::empty(),
2702                ___deadline,
2703            )?;
2704        Ok(_response)
2705    }
2706}
2707
2708#[cfg(target_os = "fuchsia")]
2709impl From<EventStreamSynchronousProxy> for zx::NullableHandle {
2710    fn from(value: EventStreamSynchronousProxy) -> Self {
2711        value.into_channel().into()
2712    }
2713}
2714
2715#[cfg(target_os = "fuchsia")]
2716impl From<fidl::Channel> for EventStreamSynchronousProxy {
2717    fn from(value: fidl::Channel) -> Self {
2718        Self::new(value)
2719    }
2720}
2721
2722#[cfg(target_os = "fuchsia")]
2723impl fidl::endpoints::FromClient for EventStreamSynchronousProxy {
2724    type Protocol = EventStreamMarker;
2725
2726    fn from_client(value: fidl::endpoints::ClientEnd<EventStreamMarker>) -> Self {
2727        Self::new(value.into_channel())
2728    }
2729}
2730
2731#[derive(Debug, Clone)]
2732pub struct EventStreamProxy {
2733    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2734}
2735
2736impl fidl::endpoints::Proxy for EventStreamProxy {
2737    type Protocol = EventStreamMarker;
2738
2739    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2740        Self::new(inner)
2741    }
2742
2743    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2744        self.client.into_channel().map_err(|client| Self { client })
2745    }
2746
2747    fn as_channel(&self) -> &::fidl::AsyncChannel {
2748        self.client.as_channel()
2749    }
2750}
2751
2752impl EventStreamProxy {
2753    /// Create a new Proxy for fuchsia.component/EventStream.
2754    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2755        let protocol_name = <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2756        Self { client: fidl::client::Client::new(channel, protocol_name) }
2757    }
2758
2759    /// Get a Stream of events from the remote end of the protocol.
2760    ///
2761    /// # Panics
2762    ///
2763    /// Panics if the event stream was already taken.
2764    pub fn take_event_stream(&self) -> EventStreamEventStream {
2765        EventStreamEventStream { event_receiver: self.client.take_event_receiver() }
2766    }
2767
2768    pub fn r#get_next(
2769        &self,
2770    ) -> fidl::client::QueryResponseFut<Vec<Event>, fidl::encoding::DefaultFuchsiaResourceDialect>
2771    {
2772        EventStreamProxyInterface::r#get_next(self)
2773    }
2774
2775    /// Returns immediately. Used to indicate that the FIDL connection
2776    /// completed. This is needed for non-static streams to verify
2777    /// that subscribe has completed before components are started.
2778    pub fn r#wait_for_ready(
2779        &self,
2780    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2781        EventStreamProxyInterface::r#wait_for_ready(self)
2782    }
2783}
2784
2785impl EventStreamProxyInterface for EventStreamProxy {
2786    type GetNextResponseFut =
2787        fidl::client::QueryResponseFut<Vec<Event>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2788    fn r#get_next(&self) -> Self::GetNextResponseFut {
2789        fn _decode(
2790            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2791        ) -> Result<Vec<Event>, fidl::Error> {
2792            let _response = fidl::client::decode_transaction_body::<
2793                EventStreamGetNextResponse,
2794                fidl::encoding::DefaultFuchsiaResourceDialect,
2795                0x3f24c9495978eb86,
2796            >(_buf?)?;
2797            Ok(_response.events)
2798        }
2799        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Event>>(
2800            (),
2801            0x3f24c9495978eb86,
2802            fidl::encoding::DynamicFlags::empty(),
2803            _decode,
2804        )
2805    }
2806
2807    type WaitForReadyResponseFut =
2808        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2809    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut {
2810        fn _decode(
2811            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2812        ) -> Result<(), fidl::Error> {
2813            let _response = fidl::client::decode_transaction_body::<
2814                fidl::encoding::EmptyPayload,
2815                fidl::encoding::DefaultFuchsiaResourceDialect,
2816                0x31331f9578d2e682,
2817            >(_buf?)?;
2818            Ok(_response)
2819        }
2820        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2821            (),
2822            0x31331f9578d2e682,
2823            fidl::encoding::DynamicFlags::empty(),
2824            _decode,
2825        )
2826    }
2827}
2828
2829pub struct EventStreamEventStream {
2830    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2831}
2832
2833impl std::marker::Unpin for EventStreamEventStream {}
2834
2835impl futures::stream::FusedStream for EventStreamEventStream {
2836    fn is_terminated(&self) -> bool {
2837        self.event_receiver.is_terminated()
2838    }
2839}
2840
2841impl futures::Stream for EventStreamEventStream {
2842    type Item = Result<EventStreamEvent, fidl::Error>;
2843
2844    fn poll_next(
2845        mut self: std::pin::Pin<&mut Self>,
2846        cx: &mut std::task::Context<'_>,
2847    ) -> std::task::Poll<Option<Self::Item>> {
2848        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2849            &mut self.event_receiver,
2850            cx
2851        )?) {
2852            Some(buf) => std::task::Poll::Ready(Some(EventStreamEvent::decode(buf))),
2853            None => std::task::Poll::Ready(None),
2854        }
2855    }
2856}
2857
2858#[derive(Debug)]
2859pub enum EventStreamEvent {}
2860
2861impl EventStreamEvent {
2862    /// Decodes a message buffer as a [`EventStreamEvent`].
2863    fn decode(
2864        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2865    ) -> Result<EventStreamEvent, fidl::Error> {
2866        let (bytes, _handles) = buf.split_mut();
2867        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2868        debug_assert_eq!(tx_header.tx_id, 0);
2869        match tx_header.ordinal {
2870            _ => Err(fidl::Error::UnknownOrdinal {
2871                ordinal: tx_header.ordinal,
2872                protocol_name: <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2873            }),
2874        }
2875    }
2876}
2877
2878/// A Stream of incoming requests for fuchsia.component/EventStream.
2879pub struct EventStreamRequestStream {
2880    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2881    is_terminated: bool,
2882}
2883
2884impl std::marker::Unpin for EventStreamRequestStream {}
2885
2886impl futures::stream::FusedStream for EventStreamRequestStream {
2887    fn is_terminated(&self) -> bool {
2888        self.is_terminated
2889    }
2890}
2891
2892impl fidl::endpoints::RequestStream for EventStreamRequestStream {
2893    type Protocol = EventStreamMarker;
2894    type ControlHandle = EventStreamControlHandle;
2895
2896    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2897        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2898    }
2899
2900    fn control_handle(&self) -> Self::ControlHandle {
2901        EventStreamControlHandle { inner: self.inner.clone() }
2902    }
2903
2904    fn into_inner(
2905        self,
2906    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2907    {
2908        (self.inner, self.is_terminated)
2909    }
2910
2911    fn from_inner(
2912        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2913        is_terminated: bool,
2914    ) -> Self {
2915        Self { inner, is_terminated }
2916    }
2917}
2918
2919impl futures::Stream for EventStreamRequestStream {
2920    type Item = Result<EventStreamRequest, fidl::Error>;
2921
2922    fn poll_next(
2923        mut self: std::pin::Pin<&mut Self>,
2924        cx: &mut std::task::Context<'_>,
2925    ) -> std::task::Poll<Option<Self::Item>> {
2926        let this = &mut *self;
2927        if this.inner.check_shutdown(cx) {
2928            this.is_terminated = true;
2929            return std::task::Poll::Ready(None);
2930        }
2931        if this.is_terminated {
2932            panic!("polled EventStreamRequestStream after completion");
2933        }
2934        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2935            |bytes, handles| {
2936                match this.inner.channel().read_etc(cx, bytes, handles) {
2937                    std::task::Poll::Ready(Ok(())) => {}
2938                    std::task::Poll::Pending => return std::task::Poll::Pending,
2939                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2940                        this.is_terminated = true;
2941                        return std::task::Poll::Ready(None);
2942                    }
2943                    std::task::Poll::Ready(Err(e)) => {
2944                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2945                            e.into(),
2946                        ))));
2947                    }
2948                }
2949
2950                // A message has been received from the channel
2951                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2952
2953                std::task::Poll::Ready(Some(match header.ordinal {
2954                    0x3f24c9495978eb86 => {
2955                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2956                        let mut req = fidl::new_empty!(
2957                            fidl::encoding::EmptyPayload,
2958                            fidl::encoding::DefaultFuchsiaResourceDialect
2959                        );
2960                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2961                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2962                        Ok(EventStreamRequest::GetNext {
2963                            responder: EventStreamGetNextResponder {
2964                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2965                                tx_id: header.tx_id,
2966                            },
2967                        })
2968                    }
2969                    0x31331f9578d2e682 => {
2970                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2971                        let mut req = fidl::new_empty!(
2972                            fidl::encoding::EmptyPayload,
2973                            fidl::encoding::DefaultFuchsiaResourceDialect
2974                        );
2975                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2976                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
2977                        Ok(EventStreamRequest::WaitForReady {
2978                            responder: EventStreamWaitForReadyResponder {
2979                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2980                                tx_id: header.tx_id,
2981                            },
2982                        })
2983                    }
2984                    _ => Err(fidl::Error::UnknownOrdinal {
2985                        ordinal: header.ordinal,
2986                        protocol_name:
2987                            <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2988                    }),
2989                }))
2990            },
2991        )
2992    }
2993}
2994
2995/// Listener for events on the component hierarchy.
2996/// Can't be used outside of the platform.
2997#[derive(Debug)]
2998pub enum EventStreamRequest {
2999    GetNext {
3000        responder: EventStreamGetNextResponder,
3001    },
3002    /// Returns immediately. Used to indicate that the FIDL connection
3003    /// completed. This is needed for non-static streams to verify
3004    /// that subscribe has completed before components are started.
3005    WaitForReady {
3006        responder: EventStreamWaitForReadyResponder,
3007    },
3008}
3009
3010impl EventStreamRequest {
3011    #[allow(irrefutable_let_patterns)]
3012    pub fn into_get_next(self) -> Option<(EventStreamGetNextResponder)> {
3013        if let EventStreamRequest::GetNext { responder } = self { Some((responder)) } else { None }
3014    }
3015
3016    #[allow(irrefutable_let_patterns)]
3017    pub fn into_wait_for_ready(self) -> Option<(EventStreamWaitForReadyResponder)> {
3018        if let EventStreamRequest::WaitForReady { responder } = self {
3019            Some((responder))
3020        } else {
3021            None
3022        }
3023    }
3024
3025    /// Name of the method defined in FIDL
3026    pub fn method_name(&self) -> &'static str {
3027        match *self {
3028            EventStreamRequest::GetNext { .. } => "get_next",
3029            EventStreamRequest::WaitForReady { .. } => "wait_for_ready",
3030        }
3031    }
3032}
3033
3034#[derive(Debug, Clone)]
3035pub struct EventStreamControlHandle {
3036    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3037}
3038
3039impl fidl::endpoints::ControlHandle for EventStreamControlHandle {
3040    fn shutdown(&self) {
3041        self.inner.shutdown()
3042    }
3043
3044    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3045        self.inner.shutdown_with_epitaph(status)
3046    }
3047
3048    fn is_closed(&self) -> bool {
3049        self.inner.channel().is_closed()
3050    }
3051    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3052        self.inner.channel().on_closed()
3053    }
3054
3055    #[cfg(target_os = "fuchsia")]
3056    fn signal_peer(
3057        &self,
3058        clear_mask: zx::Signals,
3059        set_mask: zx::Signals,
3060    ) -> Result<(), zx_status::Status> {
3061        use fidl::Peered;
3062        self.inner.channel().signal_peer(clear_mask, set_mask)
3063    }
3064}
3065
3066impl EventStreamControlHandle {}
3067
3068#[must_use = "FIDL methods require a response to be sent"]
3069#[derive(Debug)]
3070pub struct EventStreamGetNextResponder {
3071    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
3072    tx_id: u32,
3073}
3074
3075/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
3076/// if the responder is dropped without sending a response, so that the client
3077/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3078impl std::ops::Drop for EventStreamGetNextResponder {
3079    fn drop(&mut self) {
3080        self.control_handle.shutdown();
3081        // Safety: drops once, never accessed again
3082        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3083    }
3084}
3085
3086impl fidl::endpoints::Responder for EventStreamGetNextResponder {
3087    type ControlHandle = EventStreamControlHandle;
3088
3089    fn control_handle(&self) -> &EventStreamControlHandle {
3090        &self.control_handle
3091    }
3092
3093    fn drop_without_shutdown(mut self) {
3094        // Safety: drops once, never accessed again due to mem::forget
3095        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3096        // Prevent Drop from running (which would shut down the channel)
3097        std::mem::forget(self);
3098    }
3099}
3100
3101impl EventStreamGetNextResponder {
3102    /// Sends a response to the FIDL transaction.
3103    ///
3104    /// Sets the channel to shutdown if an error occurs.
3105    pub fn send(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3106        let _result = self.send_raw(events);
3107        if _result.is_err() {
3108            self.control_handle.shutdown();
3109        }
3110        self.drop_without_shutdown();
3111        _result
3112    }
3113
3114    /// Similar to "send" but does not shutdown the channel if an error occurs.
3115    pub fn send_no_shutdown_on_err(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3116        let _result = self.send_raw(events);
3117        self.drop_without_shutdown();
3118        _result
3119    }
3120
3121    fn send_raw(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3122        self.control_handle.inner.send::<EventStreamGetNextResponse>(
3123            (events.as_mut(),),
3124            self.tx_id,
3125            0x3f24c9495978eb86,
3126            fidl::encoding::DynamicFlags::empty(),
3127        )
3128    }
3129}
3130
3131#[must_use = "FIDL methods require a response to be sent"]
3132#[derive(Debug)]
3133pub struct EventStreamWaitForReadyResponder {
3134    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
3135    tx_id: u32,
3136}
3137
3138/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
3139/// if the responder is dropped without sending a response, so that the client
3140/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3141impl std::ops::Drop for EventStreamWaitForReadyResponder {
3142    fn drop(&mut self) {
3143        self.control_handle.shutdown();
3144        // Safety: drops once, never accessed again
3145        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3146    }
3147}
3148
3149impl fidl::endpoints::Responder for EventStreamWaitForReadyResponder {
3150    type ControlHandle = EventStreamControlHandle;
3151
3152    fn control_handle(&self) -> &EventStreamControlHandle {
3153        &self.control_handle
3154    }
3155
3156    fn drop_without_shutdown(mut self) {
3157        // Safety: drops once, never accessed again due to mem::forget
3158        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3159        // Prevent Drop from running (which would shut down the channel)
3160        std::mem::forget(self);
3161    }
3162}
3163
3164impl EventStreamWaitForReadyResponder {
3165    /// Sends a response to the FIDL transaction.
3166    ///
3167    /// Sets the channel to shutdown if an error occurs.
3168    pub fn send(self) -> Result<(), fidl::Error> {
3169        let _result = self.send_raw();
3170        if _result.is_err() {
3171            self.control_handle.shutdown();
3172        }
3173        self.drop_without_shutdown();
3174        _result
3175    }
3176
3177    /// Similar to "send" but does not shutdown the channel if an error occurs.
3178    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3179        let _result = self.send_raw();
3180        self.drop_without_shutdown();
3181        _result
3182    }
3183
3184    fn send_raw(&self) -> Result<(), fidl::Error> {
3185        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3186            (),
3187            self.tx_id,
3188            0x31331f9578d2e682,
3189            fidl::encoding::DynamicFlags::empty(),
3190        )
3191    }
3192}
3193
3194#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3195pub struct ExecutionControllerMarker;
3196
3197impl fidl::endpoints::ProtocolMarker for ExecutionControllerMarker {
3198    type Proxy = ExecutionControllerProxy;
3199    type RequestStream = ExecutionControllerRequestStream;
3200    #[cfg(target_os = "fuchsia")]
3201    type SynchronousProxy = ExecutionControllerSynchronousProxy;
3202
3203    const DEBUG_NAME: &'static str = "(anonymous) ExecutionController";
3204}
3205
3206pub trait ExecutionControllerProxyInterface: Send + Sync {
3207    fn r#stop(&self) -> Result<(), fidl::Error>;
3208}
3209#[derive(Debug)]
3210#[cfg(target_os = "fuchsia")]
3211pub struct ExecutionControllerSynchronousProxy {
3212    client: fidl::client::sync::Client,
3213}
3214
3215#[cfg(target_os = "fuchsia")]
3216impl fidl::endpoints::SynchronousProxy for ExecutionControllerSynchronousProxy {
3217    type Proxy = ExecutionControllerProxy;
3218    type Protocol = ExecutionControllerMarker;
3219
3220    fn from_channel(inner: fidl::Channel) -> Self {
3221        Self::new(inner)
3222    }
3223
3224    fn into_channel(self) -> fidl::Channel {
3225        self.client.into_channel()
3226    }
3227
3228    fn as_channel(&self) -> &fidl::Channel {
3229        self.client.as_channel()
3230    }
3231}
3232
3233#[cfg(target_os = "fuchsia")]
3234impl ExecutionControllerSynchronousProxy {
3235    pub fn new(channel: fidl::Channel) -> Self {
3236        let protocol_name =
3237            <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3238        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3239    }
3240
3241    pub fn into_channel(self) -> fidl::Channel {
3242        self.client.into_channel()
3243    }
3244
3245    /// Waits until an event arrives and returns it. It is safe for other
3246    /// threads to make concurrent requests while waiting for an event.
3247    pub fn wait_for_event(
3248        &self,
3249        deadline: zx::MonotonicInstant,
3250    ) -> Result<ExecutionControllerEvent, fidl::Error> {
3251        ExecutionControllerEvent::decode(self.client.wait_for_event(deadline)?)
3252    }
3253
3254    /// Initiates a stop action on this component. Once complete, OnStop will be
3255    /// called with the stopped payload and this channel is closed.
3256    ///
3257    /// Note that a component may stop running on its own at any time, so it is
3258    /// possible for `OnStop` to be received before `Stop` is called.
3259    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3260        self.client.send::<fidl::encoding::EmptyPayload>(
3261            (),
3262            0x56d23cec21036117,
3263            fidl::encoding::DynamicFlags::FLEXIBLE,
3264        )
3265    }
3266}
3267
3268#[cfg(target_os = "fuchsia")]
3269impl From<ExecutionControllerSynchronousProxy> for zx::NullableHandle {
3270    fn from(value: ExecutionControllerSynchronousProxy) -> Self {
3271        value.into_channel().into()
3272    }
3273}
3274
3275#[cfg(target_os = "fuchsia")]
3276impl From<fidl::Channel> for ExecutionControllerSynchronousProxy {
3277    fn from(value: fidl::Channel) -> Self {
3278        Self::new(value)
3279    }
3280}
3281
3282#[cfg(target_os = "fuchsia")]
3283impl fidl::endpoints::FromClient for ExecutionControllerSynchronousProxy {
3284    type Protocol = ExecutionControllerMarker;
3285
3286    fn from_client(value: fidl::endpoints::ClientEnd<ExecutionControllerMarker>) -> Self {
3287        Self::new(value.into_channel())
3288    }
3289}
3290
3291#[derive(Debug, Clone)]
3292pub struct ExecutionControllerProxy {
3293    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3294}
3295
3296impl fidl::endpoints::Proxy for ExecutionControllerProxy {
3297    type Protocol = ExecutionControllerMarker;
3298
3299    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3300        Self::new(inner)
3301    }
3302
3303    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3304        self.client.into_channel().map_err(|client| Self { client })
3305    }
3306
3307    fn as_channel(&self) -> &::fidl::AsyncChannel {
3308        self.client.as_channel()
3309    }
3310}
3311
3312impl ExecutionControllerProxy {
3313    /// Create a new Proxy for fuchsia.component/ExecutionController.
3314    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3315        let protocol_name =
3316            <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3317        Self { client: fidl::client::Client::new(channel, protocol_name) }
3318    }
3319
3320    /// Get a Stream of events from the remote end of the protocol.
3321    ///
3322    /// # Panics
3323    ///
3324    /// Panics if the event stream was already taken.
3325    pub fn take_event_stream(&self) -> ExecutionControllerEventStream {
3326        ExecutionControllerEventStream { event_receiver: self.client.take_event_receiver() }
3327    }
3328
3329    /// Initiates a stop action on this component. Once complete, OnStop will be
3330    /// called with the stopped payload and this channel is closed.
3331    ///
3332    /// Note that a component may stop running on its own at any time, so it is
3333    /// possible for `OnStop` to be received before `Stop` is called.
3334    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3335        ExecutionControllerProxyInterface::r#stop(self)
3336    }
3337}
3338
3339impl ExecutionControllerProxyInterface for ExecutionControllerProxy {
3340    fn r#stop(&self) -> Result<(), fidl::Error> {
3341        self.client.send::<fidl::encoding::EmptyPayload>(
3342            (),
3343            0x56d23cec21036117,
3344            fidl::encoding::DynamicFlags::FLEXIBLE,
3345        )
3346    }
3347}
3348
3349pub struct ExecutionControllerEventStream {
3350    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3351}
3352
3353impl std::marker::Unpin for ExecutionControllerEventStream {}
3354
3355impl futures::stream::FusedStream for ExecutionControllerEventStream {
3356    fn is_terminated(&self) -> bool {
3357        self.event_receiver.is_terminated()
3358    }
3359}
3360
3361impl futures::Stream for ExecutionControllerEventStream {
3362    type Item = Result<ExecutionControllerEvent, fidl::Error>;
3363
3364    fn poll_next(
3365        mut self: std::pin::Pin<&mut Self>,
3366        cx: &mut std::task::Context<'_>,
3367    ) -> std::task::Poll<Option<Self::Item>> {
3368        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3369            &mut self.event_receiver,
3370            cx
3371        )?) {
3372            Some(buf) => std::task::Poll::Ready(Some(ExecutionControllerEvent::decode(buf))),
3373            None => std::task::Poll::Ready(None),
3374        }
3375    }
3376}
3377
3378#[derive(Debug)]
3379pub enum ExecutionControllerEvent {
3380    OnStop {
3381        stopped_payload: StoppedPayload,
3382    },
3383    #[non_exhaustive]
3384    _UnknownEvent {
3385        /// Ordinal of the event that was sent.
3386        ordinal: u64,
3387    },
3388}
3389
3390impl ExecutionControllerEvent {
3391    #[allow(irrefutable_let_patterns)]
3392    pub fn into_on_stop(self) -> Option<StoppedPayload> {
3393        if let ExecutionControllerEvent::OnStop { stopped_payload } = self {
3394            Some((stopped_payload))
3395        } else {
3396            None
3397        }
3398    }
3399
3400    /// Decodes a message buffer as a [`ExecutionControllerEvent`].
3401    fn decode(
3402        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3403    ) -> Result<ExecutionControllerEvent, fidl::Error> {
3404        let (bytes, _handles) = buf.split_mut();
3405        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3406        debug_assert_eq!(tx_header.tx_id, 0);
3407        match tx_header.ordinal {
3408            0x62d5018e2174f57f => {
3409                let mut out = fidl::new_empty!(
3410                    ExecutionControllerOnStopRequest,
3411                    fidl::encoding::DefaultFuchsiaResourceDialect
3412                );
3413                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ExecutionControllerOnStopRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3414                Ok((ExecutionControllerEvent::OnStop { stopped_payload: out.stopped_payload }))
3415            }
3416            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3417                Ok(ExecutionControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3418            }
3419            _ => Err(fidl::Error::UnknownOrdinal {
3420                ordinal: tx_header.ordinal,
3421                protocol_name:
3422                    <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3423            }),
3424        }
3425    }
3426}
3427
3428/// A Stream of incoming requests for fuchsia.component/ExecutionController.
3429pub struct ExecutionControllerRequestStream {
3430    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3431    is_terminated: bool,
3432}
3433
3434impl std::marker::Unpin for ExecutionControllerRequestStream {}
3435
3436impl futures::stream::FusedStream for ExecutionControllerRequestStream {
3437    fn is_terminated(&self) -> bool {
3438        self.is_terminated
3439    }
3440}
3441
3442impl fidl::endpoints::RequestStream for ExecutionControllerRequestStream {
3443    type Protocol = ExecutionControllerMarker;
3444    type ControlHandle = ExecutionControllerControlHandle;
3445
3446    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3447        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3448    }
3449
3450    fn control_handle(&self) -> Self::ControlHandle {
3451        ExecutionControllerControlHandle { inner: self.inner.clone() }
3452    }
3453
3454    fn into_inner(
3455        self,
3456    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3457    {
3458        (self.inner, self.is_terminated)
3459    }
3460
3461    fn from_inner(
3462        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3463        is_terminated: bool,
3464    ) -> Self {
3465        Self { inner, is_terminated }
3466    }
3467}
3468
3469impl futures::Stream for ExecutionControllerRequestStream {
3470    type Item = Result<ExecutionControllerRequest, fidl::Error>;
3471
3472    fn poll_next(
3473        mut self: std::pin::Pin<&mut Self>,
3474        cx: &mut std::task::Context<'_>,
3475    ) -> std::task::Poll<Option<Self::Item>> {
3476        let this = &mut *self;
3477        if this.inner.check_shutdown(cx) {
3478            this.is_terminated = true;
3479            return std::task::Poll::Ready(None);
3480        }
3481        if this.is_terminated {
3482            panic!("polled ExecutionControllerRequestStream after completion");
3483        }
3484        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3485            |bytes, handles| {
3486                match this.inner.channel().read_etc(cx, bytes, handles) {
3487                    std::task::Poll::Ready(Ok(())) => {}
3488                    std::task::Poll::Pending => return std::task::Poll::Pending,
3489                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3490                        this.is_terminated = true;
3491                        return std::task::Poll::Ready(None);
3492                    }
3493                    std::task::Poll::Ready(Err(e)) => {
3494                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3495                            e.into(),
3496                        ))));
3497                    }
3498                }
3499
3500                // A message has been received from the channel
3501                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3502
3503                std::task::Poll::Ready(Some(match header.ordinal {
3504                0x56d23cec21036117 => {
3505                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3506                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3507                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3508                    let control_handle = ExecutionControllerControlHandle {
3509                        inner: this.inner.clone(),
3510                    };
3511                    Ok(ExecutionControllerRequest::Stop {
3512                        control_handle,
3513                    })
3514                }
3515                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3516                    Ok(ExecutionControllerRequest::_UnknownMethod {
3517                        ordinal: header.ordinal,
3518                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
3519                        method_type: fidl::MethodType::OneWay,
3520                    })
3521                }
3522                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3523                    this.inner.send_framework_err(
3524                        fidl::encoding::FrameworkErr::UnknownMethod,
3525                        header.tx_id,
3526                        header.ordinal,
3527                        header.dynamic_flags(),
3528                        (bytes, handles),
3529                    )?;
3530                    Ok(ExecutionControllerRequest::_UnknownMethod {
3531                        ordinal: header.ordinal,
3532                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
3533                        method_type: fidl::MethodType::TwoWay,
3534                    })
3535                }
3536                _ => Err(fidl::Error::UnknownOrdinal {
3537                    ordinal: header.ordinal,
3538                    protocol_name: <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3539                }),
3540            }))
3541            },
3542        )
3543    }
3544}
3545
3546#[derive(Debug)]
3547pub enum ExecutionControllerRequest {
3548    /// Initiates a stop action on this component. Once complete, OnStop will be
3549    /// called with the stopped payload and this channel is closed.
3550    ///
3551    /// Note that a component may stop running on its own at any time, so it is
3552    /// possible for `OnStop` to be received before `Stop` is called.
3553    Stop { control_handle: ExecutionControllerControlHandle },
3554    /// An interaction was received which does not match any known method.
3555    #[non_exhaustive]
3556    _UnknownMethod {
3557        /// Ordinal of the method that was called.
3558        ordinal: u64,
3559        control_handle: ExecutionControllerControlHandle,
3560        method_type: fidl::MethodType,
3561    },
3562}
3563
3564impl ExecutionControllerRequest {
3565    #[allow(irrefutable_let_patterns)]
3566    pub fn into_stop(self) -> Option<(ExecutionControllerControlHandle)> {
3567        if let ExecutionControllerRequest::Stop { control_handle } = self {
3568            Some((control_handle))
3569        } else {
3570            None
3571        }
3572    }
3573
3574    /// Name of the method defined in FIDL
3575    pub fn method_name(&self) -> &'static str {
3576        match *self {
3577            ExecutionControllerRequest::Stop { .. } => "stop",
3578            ExecutionControllerRequest::_UnknownMethod {
3579                method_type: fidl::MethodType::OneWay,
3580                ..
3581            } => "unknown one-way method",
3582            ExecutionControllerRequest::_UnknownMethod {
3583                method_type: fidl::MethodType::TwoWay,
3584                ..
3585            } => "unknown two-way method",
3586        }
3587    }
3588}
3589
3590#[derive(Debug, Clone)]
3591pub struct ExecutionControllerControlHandle {
3592    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3593}
3594
3595impl fidl::endpoints::ControlHandle for ExecutionControllerControlHandle {
3596    fn shutdown(&self) {
3597        self.inner.shutdown()
3598    }
3599
3600    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3601        self.inner.shutdown_with_epitaph(status)
3602    }
3603
3604    fn is_closed(&self) -> bool {
3605        self.inner.channel().is_closed()
3606    }
3607    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3608        self.inner.channel().on_closed()
3609    }
3610
3611    #[cfg(target_os = "fuchsia")]
3612    fn signal_peer(
3613        &self,
3614        clear_mask: zx::Signals,
3615        set_mask: zx::Signals,
3616    ) -> Result<(), zx_status::Status> {
3617        use fidl::Peered;
3618        self.inner.channel().signal_peer(clear_mask, set_mask)
3619    }
3620}
3621
3622impl ExecutionControllerControlHandle {
3623    pub fn send_on_stop(&self, mut stopped_payload: &StoppedPayload) -> Result<(), fidl::Error> {
3624        self.inner.send::<ExecutionControllerOnStopRequest>(
3625            (stopped_payload,),
3626            0,
3627            0x62d5018e2174f57f,
3628            fidl::encoding::DynamicFlags::FLEXIBLE,
3629        )
3630    }
3631}
3632
3633#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3634pub struct IntrospectorMarker;
3635
3636impl fidl::endpoints::ProtocolMarker for IntrospectorMarker {
3637    type Proxy = IntrospectorProxy;
3638    type RequestStream = IntrospectorRequestStream;
3639    #[cfg(target_os = "fuchsia")]
3640    type SynchronousProxy = IntrospectorSynchronousProxy;
3641
3642    const DEBUG_NAME: &'static str = "fuchsia.component.Introspector";
3643}
3644impl fidl::endpoints::DiscoverableProtocolMarker for IntrospectorMarker {}
3645pub type IntrospectorGetMonikerResult = Result<String, Error>;
3646
3647pub trait IntrospectorProxyInterface: Send + Sync {
3648    type GetMonikerResponseFut: std::future::Future<Output = Result<IntrospectorGetMonikerResult, fidl::Error>>
3649        + Send;
3650    fn r#get_moniker(&self, component_instance: fidl::Event) -> Self::GetMonikerResponseFut;
3651}
3652#[derive(Debug)]
3653#[cfg(target_os = "fuchsia")]
3654pub struct IntrospectorSynchronousProxy {
3655    client: fidl::client::sync::Client,
3656}
3657
3658#[cfg(target_os = "fuchsia")]
3659impl fidl::endpoints::SynchronousProxy for IntrospectorSynchronousProxy {
3660    type Proxy = IntrospectorProxy;
3661    type Protocol = IntrospectorMarker;
3662
3663    fn from_channel(inner: fidl::Channel) -> Self {
3664        Self::new(inner)
3665    }
3666
3667    fn into_channel(self) -> fidl::Channel {
3668        self.client.into_channel()
3669    }
3670
3671    fn as_channel(&self) -> &fidl::Channel {
3672        self.client.as_channel()
3673    }
3674}
3675
3676#[cfg(target_os = "fuchsia")]
3677impl IntrospectorSynchronousProxy {
3678    pub fn new(channel: fidl::Channel) -> Self {
3679        let protocol_name = <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3680        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3681    }
3682
3683    pub fn into_channel(self) -> fidl::Channel {
3684        self.client.into_channel()
3685    }
3686
3687    /// Waits until an event arrives and returns it. It is safe for other
3688    /// threads to make concurrent requests while waiting for an event.
3689    pub fn wait_for_event(
3690        &self,
3691        deadline: zx::MonotonicInstant,
3692    ) -> Result<IntrospectorEvent, fidl::Error> {
3693        IntrospectorEvent::decode(self.client.wait_for_event(deadline)?)
3694    }
3695
3696    /// Obtains the moniker relative to this realm of the component
3697    /// corresponding to the provided token. Runners may obtain the token via
3698    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
3699    ///
3700    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
3701    /// does not correspond to a component under this realm.
3702    pub fn r#get_moniker(
3703        &self,
3704        mut component_instance: fidl::Event,
3705        ___deadline: zx::MonotonicInstant,
3706    ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
3707        let _response = self.client.send_query::<
3708            IntrospectorGetMonikerRequest,
3709            fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
3710        >(
3711            (component_instance,),
3712            0x2f980ceb37bf458,
3713            fidl::encoding::DynamicFlags::FLEXIBLE,
3714            ___deadline,
3715        )?
3716        .into_result::<IntrospectorMarker>("get_moniker")?;
3717        Ok(_response.map(|x| x.moniker))
3718    }
3719}
3720
3721#[cfg(target_os = "fuchsia")]
3722impl From<IntrospectorSynchronousProxy> for zx::NullableHandle {
3723    fn from(value: IntrospectorSynchronousProxy) -> Self {
3724        value.into_channel().into()
3725    }
3726}
3727
3728#[cfg(target_os = "fuchsia")]
3729impl From<fidl::Channel> for IntrospectorSynchronousProxy {
3730    fn from(value: fidl::Channel) -> Self {
3731        Self::new(value)
3732    }
3733}
3734
3735#[cfg(target_os = "fuchsia")]
3736impl fidl::endpoints::FromClient for IntrospectorSynchronousProxy {
3737    type Protocol = IntrospectorMarker;
3738
3739    fn from_client(value: fidl::endpoints::ClientEnd<IntrospectorMarker>) -> Self {
3740        Self::new(value.into_channel())
3741    }
3742}
3743
3744#[derive(Debug, Clone)]
3745pub struct IntrospectorProxy {
3746    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3747}
3748
3749impl fidl::endpoints::Proxy for IntrospectorProxy {
3750    type Protocol = IntrospectorMarker;
3751
3752    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3753        Self::new(inner)
3754    }
3755
3756    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3757        self.client.into_channel().map_err(|client| Self { client })
3758    }
3759
3760    fn as_channel(&self) -> &::fidl::AsyncChannel {
3761        self.client.as_channel()
3762    }
3763}
3764
3765impl IntrospectorProxy {
3766    /// Create a new Proxy for fuchsia.component/Introspector.
3767    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3768        let protocol_name = <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3769        Self { client: fidl::client::Client::new(channel, protocol_name) }
3770    }
3771
3772    /// Get a Stream of events from the remote end of the protocol.
3773    ///
3774    /// # Panics
3775    ///
3776    /// Panics if the event stream was already taken.
3777    pub fn take_event_stream(&self) -> IntrospectorEventStream {
3778        IntrospectorEventStream { event_receiver: self.client.take_event_receiver() }
3779    }
3780
3781    /// Obtains the moniker relative to this realm of the component
3782    /// corresponding to the provided token. Runners may obtain the token via
3783    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
3784    ///
3785    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
3786    /// does not correspond to a component under this realm.
3787    pub fn r#get_moniker(
3788        &self,
3789        mut component_instance: fidl::Event,
3790    ) -> fidl::client::QueryResponseFut<
3791        IntrospectorGetMonikerResult,
3792        fidl::encoding::DefaultFuchsiaResourceDialect,
3793    > {
3794        IntrospectorProxyInterface::r#get_moniker(self, component_instance)
3795    }
3796}
3797
3798impl IntrospectorProxyInterface for IntrospectorProxy {
3799    type GetMonikerResponseFut = fidl::client::QueryResponseFut<
3800        IntrospectorGetMonikerResult,
3801        fidl::encoding::DefaultFuchsiaResourceDialect,
3802    >;
3803    fn r#get_moniker(&self, mut component_instance: fidl::Event) -> Self::GetMonikerResponseFut {
3804        fn _decode(
3805            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3806        ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
3807            let _response = fidl::client::decode_transaction_body::<
3808                fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
3809                fidl::encoding::DefaultFuchsiaResourceDialect,
3810                0x2f980ceb37bf458,
3811            >(_buf?)?
3812            .into_result::<IntrospectorMarker>("get_moniker")?;
3813            Ok(_response.map(|x| x.moniker))
3814        }
3815        self.client
3816            .send_query_and_decode::<IntrospectorGetMonikerRequest, IntrospectorGetMonikerResult>(
3817                (component_instance,),
3818                0x2f980ceb37bf458,
3819                fidl::encoding::DynamicFlags::FLEXIBLE,
3820                _decode,
3821            )
3822    }
3823}
3824
3825pub struct IntrospectorEventStream {
3826    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3827}
3828
3829impl std::marker::Unpin for IntrospectorEventStream {}
3830
3831impl futures::stream::FusedStream for IntrospectorEventStream {
3832    fn is_terminated(&self) -> bool {
3833        self.event_receiver.is_terminated()
3834    }
3835}
3836
3837impl futures::Stream for IntrospectorEventStream {
3838    type Item = Result<IntrospectorEvent, fidl::Error>;
3839
3840    fn poll_next(
3841        mut self: std::pin::Pin<&mut Self>,
3842        cx: &mut std::task::Context<'_>,
3843    ) -> std::task::Poll<Option<Self::Item>> {
3844        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3845            &mut self.event_receiver,
3846            cx
3847        )?) {
3848            Some(buf) => std::task::Poll::Ready(Some(IntrospectorEvent::decode(buf))),
3849            None => std::task::Poll::Ready(None),
3850        }
3851    }
3852}
3853
3854#[derive(Debug)]
3855pub enum IntrospectorEvent {
3856    #[non_exhaustive]
3857    _UnknownEvent {
3858        /// Ordinal of the event that was sent.
3859        ordinal: u64,
3860    },
3861}
3862
3863impl IntrospectorEvent {
3864    /// Decodes a message buffer as a [`IntrospectorEvent`].
3865    fn decode(
3866        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3867    ) -> Result<IntrospectorEvent, fidl::Error> {
3868        let (bytes, _handles) = buf.split_mut();
3869        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3870        debug_assert_eq!(tx_header.tx_id, 0);
3871        match tx_header.ordinal {
3872            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3873                Ok(IntrospectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3874            }
3875            _ => Err(fidl::Error::UnknownOrdinal {
3876                ordinal: tx_header.ordinal,
3877                protocol_name: <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3878            }),
3879        }
3880    }
3881}
3882
3883/// A Stream of incoming requests for fuchsia.component/Introspector.
3884pub struct IntrospectorRequestStream {
3885    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3886    is_terminated: bool,
3887}
3888
3889impl std::marker::Unpin for IntrospectorRequestStream {}
3890
3891impl futures::stream::FusedStream for IntrospectorRequestStream {
3892    fn is_terminated(&self) -> bool {
3893        self.is_terminated
3894    }
3895}
3896
3897impl fidl::endpoints::RequestStream for IntrospectorRequestStream {
3898    type Protocol = IntrospectorMarker;
3899    type ControlHandle = IntrospectorControlHandle;
3900
3901    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3902        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3903    }
3904
3905    fn control_handle(&self) -> Self::ControlHandle {
3906        IntrospectorControlHandle { inner: self.inner.clone() }
3907    }
3908
3909    fn into_inner(
3910        self,
3911    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3912    {
3913        (self.inner, self.is_terminated)
3914    }
3915
3916    fn from_inner(
3917        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3918        is_terminated: bool,
3919    ) -> Self {
3920        Self { inner, is_terminated }
3921    }
3922}
3923
3924impl futures::Stream for IntrospectorRequestStream {
3925    type Item = Result<IntrospectorRequest, fidl::Error>;
3926
3927    fn poll_next(
3928        mut self: std::pin::Pin<&mut Self>,
3929        cx: &mut std::task::Context<'_>,
3930    ) -> std::task::Poll<Option<Self::Item>> {
3931        let this = &mut *self;
3932        if this.inner.check_shutdown(cx) {
3933            this.is_terminated = true;
3934            return std::task::Poll::Ready(None);
3935        }
3936        if this.is_terminated {
3937            panic!("polled IntrospectorRequestStream after completion");
3938        }
3939        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3940            |bytes, handles| {
3941                match this.inner.channel().read_etc(cx, bytes, handles) {
3942                    std::task::Poll::Ready(Ok(())) => {}
3943                    std::task::Poll::Pending => return std::task::Poll::Pending,
3944                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3945                        this.is_terminated = true;
3946                        return std::task::Poll::Ready(None);
3947                    }
3948                    std::task::Poll::Ready(Err(e)) => {
3949                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3950                            e.into(),
3951                        ))));
3952                    }
3953                }
3954
3955                // A message has been received from the channel
3956                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3957
3958                std::task::Poll::Ready(Some(match header.ordinal {
3959                    0x2f980ceb37bf458 => {
3960                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3961                        let mut req = fidl::new_empty!(
3962                            IntrospectorGetMonikerRequest,
3963                            fidl::encoding::DefaultFuchsiaResourceDialect
3964                        );
3965                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<IntrospectorGetMonikerRequest>(&header, _body_bytes, handles, &mut req)?;
3966                        let control_handle =
3967                            IntrospectorControlHandle { inner: this.inner.clone() };
3968                        Ok(IntrospectorRequest::GetMoniker {
3969                            component_instance: req.component_instance,
3970
3971                            responder: IntrospectorGetMonikerResponder {
3972                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3973                                tx_id: header.tx_id,
3974                            },
3975                        })
3976                    }
3977                    _ if header.tx_id == 0
3978                        && header
3979                            .dynamic_flags()
3980                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3981                    {
3982                        Ok(IntrospectorRequest::_UnknownMethod {
3983                            ordinal: header.ordinal,
3984                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
3985                            method_type: fidl::MethodType::OneWay,
3986                        })
3987                    }
3988                    _ if header
3989                        .dynamic_flags()
3990                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
3991                    {
3992                        this.inner.send_framework_err(
3993                            fidl::encoding::FrameworkErr::UnknownMethod,
3994                            header.tx_id,
3995                            header.ordinal,
3996                            header.dynamic_flags(),
3997                            (bytes, handles),
3998                        )?;
3999                        Ok(IntrospectorRequest::_UnknownMethod {
4000                            ordinal: header.ordinal,
4001                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
4002                            method_type: fidl::MethodType::TwoWay,
4003                        })
4004                    }
4005                    _ => Err(fidl::Error::UnknownOrdinal {
4006                        ordinal: header.ordinal,
4007                        protocol_name:
4008                            <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4009                    }),
4010                }))
4011            },
4012        )
4013    }
4014}
4015
4016/// A protocol used by a component instance to obtain information about
4017/// components in its own realm.
4018///
4019/// This protocol only supports getting the moniker at the moment but could
4020/// expand to other privileged information such as the URL of a component.
4021///
4022/// The component framework provides this capability to components that use
4023/// `fuchsia.component.Introspector` from framework.
4024#[derive(Debug)]
4025pub enum IntrospectorRequest {
4026    /// Obtains the moniker relative to this realm of the component
4027    /// corresponding to the provided token. Runners may obtain the token via
4028    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
4029    ///
4030    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
4031    /// does not correspond to a component under this realm.
4032    GetMoniker { component_instance: fidl::Event, responder: IntrospectorGetMonikerResponder },
4033    /// An interaction was received which does not match any known method.
4034    #[non_exhaustive]
4035    _UnknownMethod {
4036        /// Ordinal of the method that was called.
4037        ordinal: u64,
4038        control_handle: IntrospectorControlHandle,
4039        method_type: fidl::MethodType,
4040    },
4041}
4042
4043impl IntrospectorRequest {
4044    #[allow(irrefutable_let_patterns)]
4045    pub fn into_get_moniker(self) -> Option<(fidl::Event, IntrospectorGetMonikerResponder)> {
4046        if let IntrospectorRequest::GetMoniker { component_instance, responder } = self {
4047            Some((component_instance, responder))
4048        } else {
4049            None
4050        }
4051    }
4052
4053    /// Name of the method defined in FIDL
4054    pub fn method_name(&self) -> &'static str {
4055        match *self {
4056            IntrospectorRequest::GetMoniker { .. } => "get_moniker",
4057            IntrospectorRequest::_UnknownMethod {
4058                method_type: fidl::MethodType::OneWay, ..
4059            } => "unknown one-way method",
4060            IntrospectorRequest::_UnknownMethod {
4061                method_type: fidl::MethodType::TwoWay, ..
4062            } => "unknown two-way method",
4063        }
4064    }
4065}
4066
4067#[derive(Debug, Clone)]
4068pub struct IntrospectorControlHandle {
4069    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4070}
4071
4072impl fidl::endpoints::ControlHandle for IntrospectorControlHandle {
4073    fn shutdown(&self) {
4074        self.inner.shutdown()
4075    }
4076
4077    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4078        self.inner.shutdown_with_epitaph(status)
4079    }
4080
4081    fn is_closed(&self) -> bool {
4082        self.inner.channel().is_closed()
4083    }
4084    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4085        self.inner.channel().on_closed()
4086    }
4087
4088    #[cfg(target_os = "fuchsia")]
4089    fn signal_peer(
4090        &self,
4091        clear_mask: zx::Signals,
4092        set_mask: zx::Signals,
4093    ) -> Result<(), zx_status::Status> {
4094        use fidl::Peered;
4095        self.inner.channel().signal_peer(clear_mask, set_mask)
4096    }
4097}
4098
4099impl IntrospectorControlHandle {}
4100
4101#[must_use = "FIDL methods require a response to be sent"]
4102#[derive(Debug)]
4103pub struct IntrospectorGetMonikerResponder {
4104    control_handle: std::mem::ManuallyDrop<IntrospectorControlHandle>,
4105    tx_id: u32,
4106}
4107
4108/// Set the the channel to be shutdown (see [`IntrospectorControlHandle::shutdown`])
4109/// if the responder is dropped without sending a response, so that the client
4110/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4111impl std::ops::Drop for IntrospectorGetMonikerResponder {
4112    fn drop(&mut self) {
4113        self.control_handle.shutdown();
4114        // Safety: drops once, never accessed again
4115        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4116    }
4117}
4118
4119impl fidl::endpoints::Responder for IntrospectorGetMonikerResponder {
4120    type ControlHandle = IntrospectorControlHandle;
4121
4122    fn control_handle(&self) -> &IntrospectorControlHandle {
4123        &self.control_handle
4124    }
4125
4126    fn drop_without_shutdown(mut self) {
4127        // Safety: drops once, never accessed again due to mem::forget
4128        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4129        // Prevent Drop from running (which would shut down the channel)
4130        std::mem::forget(self);
4131    }
4132}
4133
4134impl IntrospectorGetMonikerResponder {
4135    /// Sends a response to the FIDL transaction.
4136    ///
4137    /// Sets the channel to shutdown if an error occurs.
4138    pub fn send(self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
4139        let _result = self.send_raw(result);
4140        if _result.is_err() {
4141            self.control_handle.shutdown();
4142        }
4143        self.drop_without_shutdown();
4144        _result
4145    }
4146
4147    /// Similar to "send" but does not shutdown the channel if an error occurs.
4148    pub fn send_no_shutdown_on_err(
4149        self,
4150        mut result: Result<&str, Error>,
4151    ) -> Result<(), fidl::Error> {
4152        let _result = self.send_raw(result);
4153        self.drop_without_shutdown();
4154        _result
4155    }
4156
4157    fn send_raw(&self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
4158        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4159            IntrospectorGetMonikerResponse,
4160            Error,
4161        >>(
4162            fidl::encoding::FlexibleResult::new(result.map(|moniker| (moniker,))),
4163            self.tx_id,
4164            0x2f980ceb37bf458,
4165            fidl::encoding::DynamicFlags::FLEXIBLE,
4166        )
4167    }
4168}
4169
4170#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4171pub struct NamespaceMarker;
4172
4173impl fidl::endpoints::ProtocolMarker for NamespaceMarker {
4174    type Proxy = NamespaceProxy;
4175    type RequestStream = NamespaceRequestStream;
4176    #[cfg(target_os = "fuchsia")]
4177    type SynchronousProxy = NamespaceSynchronousProxy;
4178
4179    const DEBUG_NAME: &'static str = "fuchsia.component.Namespace";
4180}
4181impl fidl::endpoints::DiscoverableProtocolMarker for NamespaceMarker {}
4182pub type NamespaceCreateResult = Result<Vec<NamespaceEntry>, NamespaceError>;
4183
4184pub trait NamespaceProxyInterface: Send + Sync {
4185    type CreateResponseFut: std::future::Future<Output = Result<NamespaceCreateResult, fidl::Error>>
4186        + Send;
4187    fn r#create(&self, entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut;
4188}
4189#[derive(Debug)]
4190#[cfg(target_os = "fuchsia")]
4191pub struct NamespaceSynchronousProxy {
4192    client: fidl::client::sync::Client,
4193}
4194
4195#[cfg(target_os = "fuchsia")]
4196impl fidl::endpoints::SynchronousProxy for NamespaceSynchronousProxy {
4197    type Proxy = NamespaceProxy;
4198    type Protocol = NamespaceMarker;
4199
4200    fn from_channel(inner: fidl::Channel) -> Self {
4201        Self::new(inner)
4202    }
4203
4204    fn into_channel(self) -> fidl::Channel {
4205        self.client.into_channel()
4206    }
4207
4208    fn as_channel(&self) -> &fidl::Channel {
4209        self.client.as_channel()
4210    }
4211}
4212
4213#[cfg(target_os = "fuchsia")]
4214impl NamespaceSynchronousProxy {
4215    pub fn new(channel: fidl::Channel) -> Self {
4216        let protocol_name = <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4217        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4218    }
4219
4220    pub fn into_channel(self) -> fidl::Channel {
4221        self.client.into_channel()
4222    }
4223
4224    /// Waits until an event arrives and returns it. It is safe for other
4225    /// threads to make concurrent requests while waiting for an event.
4226    pub fn wait_for_event(
4227        &self,
4228        deadline: zx::MonotonicInstant,
4229    ) -> Result<NamespaceEvent, fidl::Error> {
4230        NamespaceEvent::decode(self.client.wait_for_event(deadline)?)
4231    }
4232
4233    pub fn r#create(
4234        &self,
4235        mut entries: Vec<NamespaceInputEntry>,
4236        ___deadline: zx::MonotonicInstant,
4237    ) -> Result<NamespaceCreateResult, fidl::Error> {
4238        let _response = self.client.send_query::<
4239            NamespaceCreateRequest,
4240            fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
4241        >(
4242            (entries.as_mut(),),
4243            0x4329fe12b2a790f9,
4244            fidl::encoding::DynamicFlags::FLEXIBLE,
4245            ___deadline,
4246        )?
4247        .into_result::<NamespaceMarker>("create")?;
4248        Ok(_response.map(|x| x.entries))
4249    }
4250}
4251
4252#[cfg(target_os = "fuchsia")]
4253impl From<NamespaceSynchronousProxy> for zx::NullableHandle {
4254    fn from(value: NamespaceSynchronousProxy) -> Self {
4255        value.into_channel().into()
4256    }
4257}
4258
4259#[cfg(target_os = "fuchsia")]
4260impl From<fidl::Channel> for NamespaceSynchronousProxy {
4261    fn from(value: fidl::Channel) -> Self {
4262        Self::new(value)
4263    }
4264}
4265
4266#[cfg(target_os = "fuchsia")]
4267impl fidl::endpoints::FromClient for NamespaceSynchronousProxy {
4268    type Protocol = NamespaceMarker;
4269
4270    fn from_client(value: fidl::endpoints::ClientEnd<NamespaceMarker>) -> Self {
4271        Self::new(value.into_channel())
4272    }
4273}
4274
4275#[derive(Debug, Clone)]
4276pub struct NamespaceProxy {
4277    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4278}
4279
4280impl fidl::endpoints::Proxy for NamespaceProxy {
4281    type Protocol = NamespaceMarker;
4282
4283    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4284        Self::new(inner)
4285    }
4286
4287    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4288        self.client.into_channel().map_err(|client| Self { client })
4289    }
4290
4291    fn as_channel(&self) -> &::fidl::AsyncChannel {
4292        self.client.as_channel()
4293    }
4294}
4295
4296impl NamespaceProxy {
4297    /// Create a new Proxy for fuchsia.component/Namespace.
4298    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4299        let protocol_name = <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4300        Self { client: fidl::client::Client::new(channel, protocol_name) }
4301    }
4302
4303    /// Get a Stream of events from the remote end of the protocol.
4304    ///
4305    /// # Panics
4306    ///
4307    /// Panics if the event stream was already taken.
4308    pub fn take_event_stream(&self) -> NamespaceEventStream {
4309        NamespaceEventStream { event_receiver: self.client.take_event_receiver() }
4310    }
4311
4312    pub fn r#create(
4313        &self,
4314        mut entries: Vec<NamespaceInputEntry>,
4315    ) -> fidl::client::QueryResponseFut<
4316        NamespaceCreateResult,
4317        fidl::encoding::DefaultFuchsiaResourceDialect,
4318    > {
4319        NamespaceProxyInterface::r#create(self, entries)
4320    }
4321}
4322
4323impl NamespaceProxyInterface for NamespaceProxy {
4324    type CreateResponseFut = fidl::client::QueryResponseFut<
4325        NamespaceCreateResult,
4326        fidl::encoding::DefaultFuchsiaResourceDialect,
4327    >;
4328    fn r#create(&self, mut entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut {
4329        fn _decode(
4330            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4331        ) -> Result<NamespaceCreateResult, fidl::Error> {
4332            let _response = fidl::client::decode_transaction_body::<
4333                fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
4334                fidl::encoding::DefaultFuchsiaResourceDialect,
4335                0x4329fe12b2a790f9,
4336            >(_buf?)?
4337            .into_result::<NamespaceMarker>("create")?;
4338            Ok(_response.map(|x| x.entries))
4339        }
4340        self.client.send_query_and_decode::<NamespaceCreateRequest, NamespaceCreateResult>(
4341            (entries.as_mut(),),
4342            0x4329fe12b2a790f9,
4343            fidl::encoding::DynamicFlags::FLEXIBLE,
4344            _decode,
4345        )
4346    }
4347}
4348
4349pub struct NamespaceEventStream {
4350    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4351}
4352
4353impl std::marker::Unpin for NamespaceEventStream {}
4354
4355impl futures::stream::FusedStream for NamespaceEventStream {
4356    fn is_terminated(&self) -> bool {
4357        self.event_receiver.is_terminated()
4358    }
4359}
4360
4361impl futures::Stream for NamespaceEventStream {
4362    type Item = Result<NamespaceEvent, fidl::Error>;
4363
4364    fn poll_next(
4365        mut self: std::pin::Pin<&mut Self>,
4366        cx: &mut std::task::Context<'_>,
4367    ) -> std::task::Poll<Option<Self::Item>> {
4368        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4369            &mut self.event_receiver,
4370            cx
4371        )?) {
4372            Some(buf) => std::task::Poll::Ready(Some(NamespaceEvent::decode(buf))),
4373            None => std::task::Poll::Ready(None),
4374        }
4375    }
4376}
4377
4378#[derive(Debug)]
4379pub enum NamespaceEvent {
4380    #[non_exhaustive]
4381    _UnknownEvent {
4382        /// Ordinal of the event that was sent.
4383        ordinal: u64,
4384    },
4385}
4386
4387impl NamespaceEvent {
4388    /// Decodes a message buffer as a [`NamespaceEvent`].
4389    fn decode(
4390        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4391    ) -> Result<NamespaceEvent, fidl::Error> {
4392        let (bytes, _handles) = buf.split_mut();
4393        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4394        debug_assert_eq!(tx_header.tx_id, 0);
4395        match tx_header.ordinal {
4396            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4397                Ok(NamespaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4398            }
4399            _ => Err(fidl::Error::UnknownOrdinal {
4400                ordinal: tx_header.ordinal,
4401                protocol_name: <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4402            }),
4403        }
4404    }
4405}
4406
4407/// A Stream of incoming requests for fuchsia.component/Namespace.
4408pub struct NamespaceRequestStream {
4409    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4410    is_terminated: bool,
4411}
4412
4413impl std::marker::Unpin for NamespaceRequestStream {}
4414
4415impl futures::stream::FusedStream for NamespaceRequestStream {
4416    fn is_terminated(&self) -> bool {
4417        self.is_terminated
4418    }
4419}
4420
4421impl fidl::endpoints::RequestStream for NamespaceRequestStream {
4422    type Protocol = NamespaceMarker;
4423    type ControlHandle = NamespaceControlHandle;
4424
4425    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4426        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4427    }
4428
4429    fn control_handle(&self) -> Self::ControlHandle {
4430        NamespaceControlHandle { inner: self.inner.clone() }
4431    }
4432
4433    fn into_inner(
4434        self,
4435    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4436    {
4437        (self.inner, self.is_terminated)
4438    }
4439
4440    fn from_inner(
4441        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4442        is_terminated: bool,
4443    ) -> Self {
4444        Self { inner, is_terminated }
4445    }
4446}
4447
4448impl futures::Stream for NamespaceRequestStream {
4449    type Item = Result<NamespaceRequest, fidl::Error>;
4450
4451    fn poll_next(
4452        mut self: std::pin::Pin<&mut Self>,
4453        cx: &mut std::task::Context<'_>,
4454    ) -> std::task::Poll<Option<Self::Item>> {
4455        let this = &mut *self;
4456        if this.inner.check_shutdown(cx) {
4457            this.is_terminated = true;
4458            return std::task::Poll::Ready(None);
4459        }
4460        if this.is_terminated {
4461            panic!("polled NamespaceRequestStream after completion");
4462        }
4463        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4464            |bytes, handles| {
4465                match this.inner.channel().read_etc(cx, bytes, handles) {
4466                    std::task::Poll::Ready(Ok(())) => {}
4467                    std::task::Poll::Pending => return std::task::Poll::Pending,
4468                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4469                        this.is_terminated = true;
4470                        return std::task::Poll::Ready(None);
4471                    }
4472                    std::task::Poll::Ready(Err(e)) => {
4473                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4474                            e.into(),
4475                        ))));
4476                    }
4477                }
4478
4479                // A message has been received from the channel
4480                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4481
4482                std::task::Poll::Ready(Some(match header.ordinal {
4483                    0x4329fe12b2a790f9 => {
4484                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4485                        let mut req = fidl::new_empty!(
4486                            NamespaceCreateRequest,
4487                            fidl::encoding::DefaultFuchsiaResourceDialect
4488                        );
4489                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NamespaceCreateRequest>(&header, _body_bytes, handles, &mut req)?;
4490                        let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
4491                        Ok(NamespaceRequest::Create {
4492                            entries: req.entries,
4493
4494                            responder: NamespaceCreateResponder {
4495                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4496                                tx_id: header.tx_id,
4497                            },
4498                        })
4499                    }
4500                    _ if header.tx_id == 0
4501                        && header
4502                            .dynamic_flags()
4503                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4504                    {
4505                        Ok(NamespaceRequest::_UnknownMethod {
4506                            ordinal: header.ordinal,
4507                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
4508                            method_type: fidl::MethodType::OneWay,
4509                        })
4510                    }
4511                    _ if header
4512                        .dynamic_flags()
4513                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4514                    {
4515                        this.inner.send_framework_err(
4516                            fidl::encoding::FrameworkErr::UnknownMethod,
4517                            header.tx_id,
4518                            header.ordinal,
4519                            header.dynamic_flags(),
4520                            (bytes, handles),
4521                        )?;
4522                        Ok(NamespaceRequest::_UnknownMethod {
4523                            ordinal: header.ordinal,
4524                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
4525                            method_type: fidl::MethodType::TwoWay,
4526                        })
4527                    }
4528                    _ => Err(fidl::Error::UnknownOrdinal {
4529                        ordinal: header.ordinal,
4530                        protocol_name:
4531                            <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4532                    }),
4533                }))
4534            },
4535        )
4536    }
4537}
4538
4539/// Protocol for performing namespace operations.
4540#[derive(Debug)]
4541pub enum NamespaceRequest {
4542    Create {
4543        entries: Vec<NamespaceInputEntry>,
4544        responder: NamespaceCreateResponder,
4545    },
4546    /// An interaction was received which does not match any known method.
4547    #[non_exhaustive]
4548    _UnknownMethod {
4549        /// Ordinal of the method that was called.
4550        ordinal: u64,
4551        control_handle: NamespaceControlHandle,
4552        method_type: fidl::MethodType,
4553    },
4554}
4555
4556impl NamespaceRequest {
4557    #[allow(irrefutable_let_patterns)]
4558    pub fn into_create(self) -> Option<(Vec<NamespaceInputEntry>, NamespaceCreateResponder)> {
4559        if let NamespaceRequest::Create { entries, responder } = self {
4560            Some((entries, responder))
4561        } else {
4562            None
4563        }
4564    }
4565
4566    /// Name of the method defined in FIDL
4567    pub fn method_name(&self) -> &'static str {
4568        match *self {
4569            NamespaceRequest::Create { .. } => "create",
4570            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4571                "unknown one-way method"
4572            }
4573            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4574                "unknown two-way method"
4575            }
4576        }
4577    }
4578}
4579
4580#[derive(Debug, Clone)]
4581pub struct NamespaceControlHandle {
4582    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4583}
4584
4585impl fidl::endpoints::ControlHandle for NamespaceControlHandle {
4586    fn shutdown(&self) {
4587        self.inner.shutdown()
4588    }
4589
4590    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4591        self.inner.shutdown_with_epitaph(status)
4592    }
4593
4594    fn is_closed(&self) -> bool {
4595        self.inner.channel().is_closed()
4596    }
4597    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4598        self.inner.channel().on_closed()
4599    }
4600
4601    #[cfg(target_os = "fuchsia")]
4602    fn signal_peer(
4603        &self,
4604        clear_mask: zx::Signals,
4605        set_mask: zx::Signals,
4606    ) -> Result<(), zx_status::Status> {
4607        use fidl::Peered;
4608        self.inner.channel().signal_peer(clear_mask, set_mask)
4609    }
4610}
4611
4612impl NamespaceControlHandle {}
4613
4614#[must_use = "FIDL methods require a response to be sent"]
4615#[derive(Debug)]
4616pub struct NamespaceCreateResponder {
4617    control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
4618    tx_id: u32,
4619}
4620
4621/// Set the the channel to be shutdown (see [`NamespaceControlHandle::shutdown`])
4622/// if the responder is dropped without sending a response, so that the client
4623/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4624impl std::ops::Drop for NamespaceCreateResponder {
4625    fn drop(&mut self) {
4626        self.control_handle.shutdown();
4627        // Safety: drops once, never accessed again
4628        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4629    }
4630}
4631
4632impl fidl::endpoints::Responder for NamespaceCreateResponder {
4633    type ControlHandle = NamespaceControlHandle;
4634
4635    fn control_handle(&self) -> &NamespaceControlHandle {
4636        &self.control_handle
4637    }
4638
4639    fn drop_without_shutdown(mut self) {
4640        // Safety: drops once, never accessed again due to mem::forget
4641        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4642        // Prevent Drop from running (which would shut down the channel)
4643        std::mem::forget(self);
4644    }
4645}
4646
4647impl NamespaceCreateResponder {
4648    /// Sends a response to the FIDL transaction.
4649    ///
4650    /// Sets the channel to shutdown if an error occurs.
4651    pub fn send(
4652        self,
4653        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4654    ) -> Result<(), fidl::Error> {
4655        let _result = self.send_raw(result);
4656        if _result.is_err() {
4657            self.control_handle.shutdown();
4658        }
4659        self.drop_without_shutdown();
4660        _result
4661    }
4662
4663    /// Similar to "send" but does not shutdown the channel if an error occurs.
4664    pub fn send_no_shutdown_on_err(
4665        self,
4666        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4667    ) -> Result<(), fidl::Error> {
4668        let _result = self.send_raw(result);
4669        self.drop_without_shutdown();
4670        _result
4671    }
4672
4673    fn send_raw(
4674        &self,
4675        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4676    ) -> Result<(), fidl::Error> {
4677        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4678            NamespaceCreateResponse,
4679            NamespaceError,
4680        >>(
4681            fidl::encoding::FlexibleResult::new(
4682                result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
4683            ),
4684            self.tx_id,
4685            0x4329fe12b2a790f9,
4686            fidl::encoding::DynamicFlags::FLEXIBLE,
4687        )
4688    }
4689}
4690
4691#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4692pub struct RealmMarker;
4693
4694impl fidl::endpoints::ProtocolMarker for RealmMarker {
4695    type Proxy = RealmProxy;
4696    type RequestStream = RealmRequestStream;
4697    #[cfg(target_os = "fuchsia")]
4698    type SynchronousProxy = RealmSynchronousProxy;
4699
4700    const DEBUG_NAME: &'static str = "fuchsia.component.Realm";
4701}
4702impl fidl::endpoints::DiscoverableProtocolMarker for RealmMarker {}
4703pub type RealmOpenControllerResult = Result<(), Error>;
4704pub type RealmOpenExposedDirResult = Result<(), Error>;
4705pub type RealmCreateChildResult = Result<(), Error>;
4706pub type RealmDestroyChildResult = Result<(), Error>;
4707pub type RealmListChildrenResult = Result<(), Error>;
4708pub type RealmGetResolvedInfoResult = Result<fidl_fuchsia_component_resolution::Component, Error>;
4709pub type RealmGetChildOutputDictionaryDeprecatedResult =
4710    Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>;
4711pub type RealmGetChildOutputDictionaryResult = Result<fidl::EventPair, Error>;
4712
4713pub trait RealmProxyInterface: Send + Sync {
4714    type OpenControllerResponseFut: std::future::Future<Output = Result<RealmOpenControllerResult, fidl::Error>>
4715        + Send;
4716    fn r#open_controller(
4717        &self,
4718        child: &fidl_fuchsia_component_decl::ChildRef,
4719        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4720    ) -> Self::OpenControllerResponseFut;
4721    type OpenExposedDirResponseFut: std::future::Future<Output = Result<RealmOpenExposedDirResult, fidl::Error>>
4722        + Send;
4723    fn r#open_exposed_dir(
4724        &self,
4725        child: &fidl_fuchsia_component_decl::ChildRef,
4726        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4727    ) -> Self::OpenExposedDirResponseFut;
4728    type CreateChildResponseFut: std::future::Future<Output = Result<RealmCreateChildResult, fidl::Error>>
4729        + Send;
4730    fn r#create_child(
4731        &self,
4732        collection: &fidl_fuchsia_component_decl::CollectionRef,
4733        decl: &fidl_fuchsia_component_decl::Child,
4734        args: CreateChildArgs,
4735    ) -> Self::CreateChildResponseFut;
4736    type DestroyChildResponseFut: std::future::Future<Output = Result<RealmDestroyChildResult, fidl::Error>>
4737        + Send;
4738    fn r#destroy_child(
4739        &self,
4740        child: &fidl_fuchsia_component_decl::ChildRef,
4741    ) -> Self::DestroyChildResponseFut;
4742    type ListChildrenResponseFut: std::future::Future<Output = Result<RealmListChildrenResult, fidl::Error>>
4743        + Send;
4744    fn r#list_children(
4745        &self,
4746        collection: &fidl_fuchsia_component_decl::CollectionRef,
4747        iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
4748    ) -> Self::ListChildrenResponseFut;
4749    type GetResolvedInfoResponseFut: std::future::Future<Output = Result<RealmGetResolvedInfoResult, fidl::Error>>
4750        + Send;
4751    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut;
4752    type GetChildOutputDictionaryDeprecatedResponseFut: std::future::Future<
4753            Output = Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error>,
4754        > + Send;
4755    fn r#get_child_output_dictionary_deprecated(
4756        &self,
4757        child: &fidl_fuchsia_component_decl::ChildRef,
4758    ) -> Self::GetChildOutputDictionaryDeprecatedResponseFut;
4759    type GetChildOutputDictionaryResponseFut: std::future::Future<Output = Result<RealmGetChildOutputDictionaryResult, fidl::Error>>
4760        + Send;
4761    fn r#get_child_output_dictionary(
4762        &self,
4763        child: &fidl_fuchsia_component_decl::ChildRef,
4764    ) -> Self::GetChildOutputDictionaryResponseFut;
4765}
4766#[derive(Debug)]
4767#[cfg(target_os = "fuchsia")]
4768pub struct RealmSynchronousProxy {
4769    client: fidl::client::sync::Client,
4770}
4771
4772#[cfg(target_os = "fuchsia")]
4773impl fidl::endpoints::SynchronousProxy for RealmSynchronousProxy {
4774    type Proxy = RealmProxy;
4775    type Protocol = RealmMarker;
4776
4777    fn from_channel(inner: fidl::Channel) -> Self {
4778        Self::new(inner)
4779    }
4780
4781    fn into_channel(self) -> fidl::Channel {
4782        self.client.into_channel()
4783    }
4784
4785    fn as_channel(&self) -> &fidl::Channel {
4786        self.client.as_channel()
4787    }
4788}
4789
4790#[cfg(target_os = "fuchsia")]
4791impl RealmSynchronousProxy {
4792    pub fn new(channel: fidl::Channel) -> Self {
4793        let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4794        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4795    }
4796
4797    pub fn into_channel(self) -> fidl::Channel {
4798        self.client.into_channel()
4799    }
4800
4801    /// Waits until an event arrives and returns it. It is safe for other
4802    /// threads to make concurrent requests while waiting for an event.
4803    pub fn wait_for_event(
4804        &self,
4805        deadline: zx::MonotonicInstant,
4806    ) -> Result<RealmEvent, fidl::Error> {
4807        RealmEvent::decode(self.client.wait_for_event(deadline)?)
4808    }
4809
4810    /// Operate on a child component. See documentation for [`Controller`].
4811    ///
4812    /// Errors:
4813    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4814    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4815    /// - `INSTANCE_DIED`: This realm no longer exists.
4816    pub fn r#open_controller(
4817        &self,
4818        mut child: &fidl_fuchsia_component_decl::ChildRef,
4819        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4820        ___deadline: zx::MonotonicInstant,
4821    ) -> Result<RealmOpenControllerResult, fidl::Error> {
4822        let _response = self.client.send_query::<
4823            RealmOpenControllerRequest,
4824            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4825        >(
4826            (child, controller,),
4827            0x7150b7898d1b1180,
4828            fidl::encoding::DynamicFlags::empty(),
4829            ___deadline,
4830        )?;
4831        Ok(_response.map(|x| x))
4832    }
4833
4834    /// Opens the exposed directory of a child component. When this function
4835    /// successfully returns, `exposed_dir` is bound to a directory that
4836    /// contains the capabilities which the child exposed to its realm via
4837    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
4838    /// component's manifest). The child component will not start as a result of
4839    /// this call.
4840    ///
4841    /// `exposed_dir` is open as long as `child` exists.
4842    ///
4843    /// Errors:
4844    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
4845    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4846    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
4847    /// - `INSTANCE_DIED`: This realm no longer exists.
4848    pub fn r#open_exposed_dir(
4849        &self,
4850        mut child: &fidl_fuchsia_component_decl::ChildRef,
4851        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4852        ___deadline: zx::MonotonicInstant,
4853    ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
4854        let _response = self.client.send_query::<
4855            RealmOpenExposedDirRequest,
4856            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4857        >(
4858            (child, exposed_dir,),
4859            0x7f993235ca59f92c,
4860            fidl::encoding::DynamicFlags::empty(),
4861            ___deadline,
4862        )?;
4863        Ok(_response.map(|x| x))
4864    }
4865
4866    /// Creates a child component instance dynamically. When this function
4867    /// returns successfully, the instance exists, but it may not be running.
4868    ///
4869    /// The environment of the child instance is determined by the environment
4870    /// of the collection. `decl` must not set `environment`.
4871    ///
4872    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
4873    /// [CreateChild] will start the component and return once the component is
4874    /// started. Otherwise, [CreateChild] will return immediately after creating
4875    /// the component and will not start or resolve it.
4876    ///
4877    /// Errors:
4878    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
4879    ///   is not a valid declaration.
4880    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4881    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
4882    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
4883    ///   in a `SingleRun` collection.
4884    /// - `NO_SPACE`: Could not allocate storage for the new instance.
4885    /// - `INSTANCE_DIED`: This realm no longer exists.
4886    pub fn r#create_child(
4887        &self,
4888        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4889        mut decl: &fidl_fuchsia_component_decl::Child,
4890        mut args: CreateChildArgs,
4891        ___deadline: zx::MonotonicInstant,
4892    ) -> Result<RealmCreateChildResult, fidl::Error> {
4893        let _response = self.client.send_query::<
4894            RealmCreateChildRequest,
4895            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4896        >(
4897            (collection, decl, &mut args,),
4898            0x43e48ce8483d7560,
4899            fidl::encoding::DynamicFlags::empty(),
4900            ___deadline,
4901        )?;
4902        Ok(_response.map(|x| x))
4903    }
4904
4905    /// Destroys a dynamically-created component instance. When this function
4906    /// returns, the instance is destroyed and has stopped running.  However,
4907    /// cleanup of the component's resources (such as its isolated storage) may
4908    /// happen in the background after this function returns.
4909    ///
4910    /// Errors:
4911    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
4912    ///   to a dynamic instance.
4913    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
4914    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4915    /// - `INSTANCE_DIED`: This realm no longer exists.
4916    pub fn r#destroy_child(
4917        &self,
4918        mut child: &fidl_fuchsia_component_decl::ChildRef,
4919        ___deadline: zx::MonotonicInstant,
4920    ) -> Result<RealmDestroyChildResult, fidl::Error> {
4921        let _response = self.client.send_query::<
4922            RealmDestroyChildRequest,
4923            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4924        >(
4925            (child,),
4926            0x71d8caf8850c9222,
4927            fidl::encoding::DynamicFlags::empty(),
4928            ___deadline,
4929        )?;
4930        Ok(_response.map(|x| x))
4931    }
4932
4933    /// Returns an iterator that lists all instances in a collection.
4934    ///
4935    /// NOTE: The results are not guaranteed to be consistent. Instances may be
4936    /// created or destroyed while the iterator is live, but those changes
4937    /// won't be observed by the iterator after this method returns.
4938    ///
4939    /// Errors:
4940    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
4941    /// does not have `ZX_RIGHT_WAIT`.
4942    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
4943    /// - `INSTANCE_DIED`: This realm no longer exists.
4944    /// - If `iter` does not have standard channel rights, this function may
4945    ///   return `ACCESS_DENIED` or component manager may close `iter`.
4946    pub fn r#list_children(
4947        &self,
4948        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
4949        mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
4950        ___deadline: zx::MonotonicInstant,
4951    ) -> Result<RealmListChildrenResult, fidl::Error> {
4952        let _response = self.client.send_query::<
4953            RealmListChildrenRequest,
4954            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
4955        >(
4956            (collection, iter,),
4957            0x6888a76683efc0a1,
4958            fidl::encoding::DynamicFlags::empty(),
4959            ___deadline,
4960        )?;
4961        Ok(_response.map(|x| x))
4962    }
4963
4964    /// Returns the set of information that was given to the component framework
4965    /// by this component's resolver.
4966    pub fn r#get_resolved_info(
4967        &self,
4968        ___deadline: zx::MonotonicInstant,
4969    ) -> Result<RealmGetResolvedInfoResult, fidl::Error> {
4970        let _response = self.client.send_query::<
4971            fidl::encoding::EmptyPayload,
4972            fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>,
4973        >(
4974            (),
4975            0x734f744cb7d210a2,
4976            fidl::encoding::DynamicFlags::empty(),
4977            ___deadline,
4978        )?;
4979        Ok(_response.map(|x| x.resolved_info))
4980    }
4981
4982    pub fn r#get_child_output_dictionary_deprecated(
4983        &self,
4984        mut child: &fidl_fuchsia_component_decl::ChildRef,
4985        ___deadline: zx::MonotonicInstant,
4986    ) -> Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error> {
4987        let _response = self.client.send_query::<
4988            RealmGetChildOutputDictionaryDeprecatedRequest,
4989            fidl::encoding::ResultType<RealmGetChildOutputDictionaryDeprecatedResponse, Error>,
4990        >(
4991            (child,),
4992            0x39245b02aba94364,
4993            fidl::encoding::DynamicFlags::empty(),
4994            ___deadline,
4995        )?;
4996        Ok(_response.map(|x| x.dictionary))
4997    }
4998
4999    /// Returns a reference to a child's output dictionary, which may be
5000    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
5001    pub fn r#get_child_output_dictionary(
5002        &self,
5003        mut child: &fidl_fuchsia_component_decl::ChildRef,
5004        ___deadline: zx::MonotonicInstant,
5005    ) -> Result<RealmGetChildOutputDictionaryResult, fidl::Error> {
5006        let _response = self.client.send_query::<
5007            RealmGetChildOutputDictionaryRequest,
5008            fidl::encoding::ResultType<RealmGetChildOutputDictionaryResponse, Error>,
5009        >(
5010            (child,),
5011            0x4259d08d261d5610,
5012            fidl::encoding::DynamicFlags::empty(),
5013            ___deadline,
5014        )?;
5015        Ok(_response.map(|x| x.dictionary))
5016    }
5017}
5018
5019#[cfg(target_os = "fuchsia")]
5020impl From<RealmSynchronousProxy> for zx::NullableHandle {
5021    fn from(value: RealmSynchronousProxy) -> Self {
5022        value.into_channel().into()
5023    }
5024}
5025
5026#[cfg(target_os = "fuchsia")]
5027impl From<fidl::Channel> for RealmSynchronousProxy {
5028    fn from(value: fidl::Channel) -> Self {
5029        Self::new(value)
5030    }
5031}
5032
5033#[cfg(target_os = "fuchsia")]
5034impl fidl::endpoints::FromClient for RealmSynchronousProxy {
5035    type Protocol = RealmMarker;
5036
5037    fn from_client(value: fidl::endpoints::ClientEnd<RealmMarker>) -> Self {
5038        Self::new(value.into_channel())
5039    }
5040}
5041
5042#[derive(Debug, Clone)]
5043pub struct RealmProxy {
5044    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5045}
5046
5047impl fidl::endpoints::Proxy for RealmProxy {
5048    type Protocol = RealmMarker;
5049
5050    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5051        Self::new(inner)
5052    }
5053
5054    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5055        self.client.into_channel().map_err(|client| Self { client })
5056    }
5057
5058    fn as_channel(&self) -> &::fidl::AsyncChannel {
5059        self.client.as_channel()
5060    }
5061}
5062
5063impl RealmProxy {
5064    /// Create a new Proxy for fuchsia.component/Realm.
5065    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5066        let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5067        Self { client: fidl::client::Client::new(channel, protocol_name) }
5068    }
5069
5070    /// Get a Stream of events from the remote end of the protocol.
5071    ///
5072    /// # Panics
5073    ///
5074    /// Panics if the event stream was already taken.
5075    pub fn take_event_stream(&self) -> RealmEventStream {
5076        RealmEventStream { event_receiver: self.client.take_event_receiver() }
5077    }
5078
5079    /// Operate on a child component. See documentation for [`Controller`].
5080    ///
5081    /// Errors:
5082    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5083    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5084    /// - `INSTANCE_DIED`: This realm no longer exists.
5085    pub fn r#open_controller(
5086        &self,
5087        mut child: &fidl_fuchsia_component_decl::ChildRef,
5088        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5089    ) -> fidl::client::QueryResponseFut<
5090        RealmOpenControllerResult,
5091        fidl::encoding::DefaultFuchsiaResourceDialect,
5092    > {
5093        RealmProxyInterface::r#open_controller(self, child, controller)
5094    }
5095
5096    /// Opens the exposed directory of a child component. When this function
5097    /// successfully returns, `exposed_dir` is bound to a directory that
5098    /// contains the capabilities which the child exposed to its realm via
5099    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
5100    /// component's manifest). The child component will not start as a result of
5101    /// this call.
5102    ///
5103    /// `exposed_dir` is open as long as `child` exists.
5104    ///
5105    /// Errors:
5106    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5107    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5108    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
5109    /// - `INSTANCE_DIED`: This realm no longer exists.
5110    pub fn r#open_exposed_dir(
5111        &self,
5112        mut child: &fidl_fuchsia_component_decl::ChildRef,
5113        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5114    ) -> fidl::client::QueryResponseFut<
5115        RealmOpenExposedDirResult,
5116        fidl::encoding::DefaultFuchsiaResourceDialect,
5117    > {
5118        RealmProxyInterface::r#open_exposed_dir(self, child, exposed_dir)
5119    }
5120
5121    /// Creates a child component instance dynamically. When this function
5122    /// returns successfully, the instance exists, but it may not be running.
5123    ///
5124    /// The environment of the child instance is determined by the environment
5125    /// of the collection. `decl` must not set `environment`.
5126    ///
5127    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
5128    /// [CreateChild] will start the component and return once the component is
5129    /// started. Otherwise, [CreateChild] will return immediately after creating
5130    /// the component and will not start or resolve it.
5131    ///
5132    /// Errors:
5133    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
5134    ///   is not a valid declaration.
5135    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5136    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
5137    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
5138    ///   in a `SingleRun` collection.
5139    /// - `NO_SPACE`: Could not allocate storage for the new instance.
5140    /// - `INSTANCE_DIED`: This realm no longer exists.
5141    pub fn r#create_child(
5142        &self,
5143        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5144        mut decl: &fidl_fuchsia_component_decl::Child,
5145        mut args: CreateChildArgs,
5146    ) -> fidl::client::QueryResponseFut<
5147        RealmCreateChildResult,
5148        fidl::encoding::DefaultFuchsiaResourceDialect,
5149    > {
5150        RealmProxyInterface::r#create_child(self, collection, decl, args)
5151    }
5152
5153    /// Destroys a dynamically-created component instance. When this function
5154    /// returns, the instance is destroyed and has stopped running.  However,
5155    /// cleanup of the component's resources (such as its isolated storage) may
5156    /// happen in the background after this function returns.
5157    ///
5158    /// Errors:
5159    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
5160    ///   to a dynamic instance.
5161    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5162    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5163    /// - `INSTANCE_DIED`: This realm no longer exists.
5164    pub fn r#destroy_child(
5165        &self,
5166        mut child: &fidl_fuchsia_component_decl::ChildRef,
5167    ) -> fidl::client::QueryResponseFut<
5168        RealmDestroyChildResult,
5169        fidl::encoding::DefaultFuchsiaResourceDialect,
5170    > {
5171        RealmProxyInterface::r#destroy_child(self, child)
5172    }
5173
5174    /// Returns an iterator that lists all instances in a collection.
5175    ///
5176    /// NOTE: The results are not guaranteed to be consistent. Instances may be
5177    /// created or destroyed while the iterator is live, but those changes
5178    /// won't be observed by the iterator after this method returns.
5179    ///
5180    /// Errors:
5181    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
5182    /// does not have `ZX_RIGHT_WAIT`.
5183    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5184    /// - `INSTANCE_DIED`: This realm no longer exists.
5185    /// - If `iter` does not have standard channel rights, this function may
5186    ///   return `ACCESS_DENIED` or component manager may close `iter`.
5187    pub fn r#list_children(
5188        &self,
5189        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5190        mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5191    ) -> fidl::client::QueryResponseFut<
5192        RealmListChildrenResult,
5193        fidl::encoding::DefaultFuchsiaResourceDialect,
5194    > {
5195        RealmProxyInterface::r#list_children(self, collection, iter)
5196    }
5197
5198    /// Returns the set of information that was given to the component framework
5199    /// by this component's resolver.
5200    pub fn r#get_resolved_info(
5201        &self,
5202    ) -> fidl::client::QueryResponseFut<
5203        RealmGetResolvedInfoResult,
5204        fidl::encoding::DefaultFuchsiaResourceDialect,
5205    > {
5206        RealmProxyInterface::r#get_resolved_info(self)
5207    }
5208
5209    pub fn r#get_child_output_dictionary_deprecated(
5210        &self,
5211        mut child: &fidl_fuchsia_component_decl::ChildRef,
5212    ) -> fidl::client::QueryResponseFut<
5213        RealmGetChildOutputDictionaryDeprecatedResult,
5214        fidl::encoding::DefaultFuchsiaResourceDialect,
5215    > {
5216        RealmProxyInterface::r#get_child_output_dictionary_deprecated(self, child)
5217    }
5218
5219    /// Returns a reference to a child's output dictionary, which may be
5220    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
5221    pub fn r#get_child_output_dictionary(
5222        &self,
5223        mut child: &fidl_fuchsia_component_decl::ChildRef,
5224    ) -> fidl::client::QueryResponseFut<
5225        RealmGetChildOutputDictionaryResult,
5226        fidl::encoding::DefaultFuchsiaResourceDialect,
5227    > {
5228        RealmProxyInterface::r#get_child_output_dictionary(self, child)
5229    }
5230}
5231
5232impl RealmProxyInterface for RealmProxy {
5233    type OpenControllerResponseFut = fidl::client::QueryResponseFut<
5234        RealmOpenControllerResult,
5235        fidl::encoding::DefaultFuchsiaResourceDialect,
5236    >;
5237    fn r#open_controller(
5238        &self,
5239        mut child: &fidl_fuchsia_component_decl::ChildRef,
5240        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5241    ) -> Self::OpenControllerResponseFut {
5242        fn _decode(
5243            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5244        ) -> Result<RealmOpenControllerResult, fidl::Error> {
5245            let _response = fidl::client::decode_transaction_body::<
5246                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5247                fidl::encoding::DefaultFuchsiaResourceDialect,
5248                0x7150b7898d1b1180,
5249            >(_buf?)?;
5250            Ok(_response.map(|x| x))
5251        }
5252        self.client.send_query_and_decode::<RealmOpenControllerRequest, RealmOpenControllerResult>(
5253            (child, controller),
5254            0x7150b7898d1b1180,
5255            fidl::encoding::DynamicFlags::empty(),
5256            _decode,
5257        )
5258    }
5259
5260    type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
5261        RealmOpenExposedDirResult,
5262        fidl::encoding::DefaultFuchsiaResourceDialect,
5263    >;
5264    fn r#open_exposed_dir(
5265        &self,
5266        mut child: &fidl_fuchsia_component_decl::ChildRef,
5267        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5268    ) -> Self::OpenExposedDirResponseFut {
5269        fn _decode(
5270            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5271        ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
5272            let _response = fidl::client::decode_transaction_body::<
5273                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5274                fidl::encoding::DefaultFuchsiaResourceDialect,
5275                0x7f993235ca59f92c,
5276            >(_buf?)?;
5277            Ok(_response.map(|x| x))
5278        }
5279        self.client.send_query_and_decode::<RealmOpenExposedDirRequest, RealmOpenExposedDirResult>(
5280            (child, exposed_dir),
5281            0x7f993235ca59f92c,
5282            fidl::encoding::DynamicFlags::empty(),
5283            _decode,
5284        )
5285    }
5286
5287    type CreateChildResponseFut = fidl::client::QueryResponseFut<
5288        RealmCreateChildResult,
5289        fidl::encoding::DefaultFuchsiaResourceDialect,
5290    >;
5291    fn r#create_child(
5292        &self,
5293        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5294        mut decl: &fidl_fuchsia_component_decl::Child,
5295        mut args: CreateChildArgs,
5296    ) -> Self::CreateChildResponseFut {
5297        fn _decode(
5298            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5299        ) -> Result<RealmCreateChildResult, fidl::Error> {
5300            let _response = fidl::client::decode_transaction_body::<
5301                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5302                fidl::encoding::DefaultFuchsiaResourceDialect,
5303                0x43e48ce8483d7560,
5304            >(_buf?)?;
5305            Ok(_response.map(|x| x))
5306        }
5307        self.client.send_query_and_decode::<RealmCreateChildRequest, RealmCreateChildResult>(
5308            (collection, decl, &mut args),
5309            0x43e48ce8483d7560,
5310            fidl::encoding::DynamicFlags::empty(),
5311            _decode,
5312        )
5313    }
5314
5315    type DestroyChildResponseFut = fidl::client::QueryResponseFut<
5316        RealmDestroyChildResult,
5317        fidl::encoding::DefaultFuchsiaResourceDialect,
5318    >;
5319    fn r#destroy_child(
5320        &self,
5321        mut child: &fidl_fuchsia_component_decl::ChildRef,
5322    ) -> Self::DestroyChildResponseFut {
5323        fn _decode(
5324            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5325        ) -> Result<RealmDestroyChildResult, fidl::Error> {
5326            let _response = fidl::client::decode_transaction_body::<
5327                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5328                fidl::encoding::DefaultFuchsiaResourceDialect,
5329                0x71d8caf8850c9222,
5330            >(_buf?)?;
5331            Ok(_response.map(|x| x))
5332        }
5333        self.client.send_query_and_decode::<RealmDestroyChildRequest, RealmDestroyChildResult>(
5334            (child,),
5335            0x71d8caf8850c9222,
5336            fidl::encoding::DynamicFlags::empty(),
5337            _decode,
5338        )
5339    }
5340
5341    type ListChildrenResponseFut = fidl::client::QueryResponseFut<
5342        RealmListChildrenResult,
5343        fidl::encoding::DefaultFuchsiaResourceDialect,
5344    >;
5345    fn r#list_children(
5346        &self,
5347        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5348        mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5349    ) -> Self::ListChildrenResponseFut {
5350        fn _decode(
5351            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5352        ) -> Result<RealmListChildrenResult, fidl::Error> {
5353            let _response = fidl::client::decode_transaction_body::<
5354                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5355                fidl::encoding::DefaultFuchsiaResourceDialect,
5356                0x6888a76683efc0a1,
5357            >(_buf?)?;
5358            Ok(_response.map(|x| x))
5359        }
5360        self.client.send_query_and_decode::<RealmListChildrenRequest, RealmListChildrenResult>(
5361            (collection, iter),
5362            0x6888a76683efc0a1,
5363            fidl::encoding::DynamicFlags::empty(),
5364            _decode,
5365        )
5366    }
5367
5368    type GetResolvedInfoResponseFut = fidl::client::QueryResponseFut<
5369        RealmGetResolvedInfoResult,
5370        fidl::encoding::DefaultFuchsiaResourceDialect,
5371    >;
5372    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut {
5373        fn _decode(
5374            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5375        ) -> Result<RealmGetResolvedInfoResult, fidl::Error> {
5376            let _response = fidl::client::decode_transaction_body::<
5377                fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>,
5378                fidl::encoding::DefaultFuchsiaResourceDialect,
5379                0x734f744cb7d210a2,
5380            >(_buf?)?;
5381            Ok(_response.map(|x| x.resolved_info))
5382        }
5383        self.client
5384            .send_query_and_decode::<fidl::encoding::EmptyPayload, RealmGetResolvedInfoResult>(
5385                (),
5386                0x734f744cb7d210a2,
5387                fidl::encoding::DynamicFlags::empty(),
5388                _decode,
5389            )
5390    }
5391
5392    type GetChildOutputDictionaryDeprecatedResponseFut = fidl::client::QueryResponseFut<
5393        RealmGetChildOutputDictionaryDeprecatedResult,
5394        fidl::encoding::DefaultFuchsiaResourceDialect,
5395    >;
5396    fn r#get_child_output_dictionary_deprecated(
5397        &self,
5398        mut child: &fidl_fuchsia_component_decl::ChildRef,
5399    ) -> Self::GetChildOutputDictionaryDeprecatedResponseFut {
5400        fn _decode(
5401            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5402        ) -> Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error> {
5403            let _response = fidl::client::decode_transaction_body::<
5404                fidl::encoding::ResultType<RealmGetChildOutputDictionaryDeprecatedResponse, Error>,
5405                fidl::encoding::DefaultFuchsiaResourceDialect,
5406                0x39245b02aba94364,
5407            >(_buf?)?;
5408            Ok(_response.map(|x| x.dictionary))
5409        }
5410        self.client.send_query_and_decode::<
5411            RealmGetChildOutputDictionaryDeprecatedRequest,
5412            RealmGetChildOutputDictionaryDeprecatedResult,
5413        >(
5414            (child,),
5415            0x39245b02aba94364,
5416            fidl::encoding::DynamicFlags::empty(),
5417            _decode,
5418        )
5419    }
5420
5421    type GetChildOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
5422        RealmGetChildOutputDictionaryResult,
5423        fidl::encoding::DefaultFuchsiaResourceDialect,
5424    >;
5425    fn r#get_child_output_dictionary(
5426        &self,
5427        mut child: &fidl_fuchsia_component_decl::ChildRef,
5428    ) -> Self::GetChildOutputDictionaryResponseFut {
5429        fn _decode(
5430            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5431        ) -> Result<RealmGetChildOutputDictionaryResult, fidl::Error> {
5432            let _response = fidl::client::decode_transaction_body::<
5433                fidl::encoding::ResultType<RealmGetChildOutputDictionaryResponse, Error>,
5434                fidl::encoding::DefaultFuchsiaResourceDialect,
5435                0x4259d08d261d5610,
5436            >(_buf?)?;
5437            Ok(_response.map(|x| x.dictionary))
5438        }
5439        self.client.send_query_and_decode::<
5440            RealmGetChildOutputDictionaryRequest,
5441            RealmGetChildOutputDictionaryResult,
5442        >(
5443            (child,),
5444            0x4259d08d261d5610,
5445            fidl::encoding::DynamicFlags::empty(),
5446            _decode,
5447        )
5448    }
5449}
5450
5451pub struct RealmEventStream {
5452    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5453}
5454
5455impl std::marker::Unpin for RealmEventStream {}
5456
5457impl futures::stream::FusedStream for RealmEventStream {
5458    fn is_terminated(&self) -> bool {
5459        self.event_receiver.is_terminated()
5460    }
5461}
5462
5463impl futures::Stream for RealmEventStream {
5464    type Item = Result<RealmEvent, fidl::Error>;
5465
5466    fn poll_next(
5467        mut self: std::pin::Pin<&mut Self>,
5468        cx: &mut std::task::Context<'_>,
5469    ) -> std::task::Poll<Option<Self::Item>> {
5470        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5471            &mut self.event_receiver,
5472            cx
5473        )?) {
5474            Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
5475            None => std::task::Poll::Ready(None),
5476        }
5477    }
5478}
5479
5480#[derive(Debug)]
5481pub enum RealmEvent {}
5482
5483impl RealmEvent {
5484    /// Decodes a message buffer as a [`RealmEvent`].
5485    fn decode(
5486        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5487    ) -> Result<RealmEvent, fidl::Error> {
5488        let (bytes, _handles) = buf.split_mut();
5489        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5490        debug_assert_eq!(tx_header.tx_id, 0);
5491        match tx_header.ordinal {
5492            _ => Err(fidl::Error::UnknownOrdinal {
5493                ordinal: tx_header.ordinal,
5494                protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5495            }),
5496        }
5497    }
5498}
5499
5500/// A Stream of incoming requests for fuchsia.component/Realm.
5501pub struct RealmRequestStream {
5502    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5503    is_terminated: bool,
5504}
5505
5506impl std::marker::Unpin for RealmRequestStream {}
5507
5508impl futures::stream::FusedStream for RealmRequestStream {
5509    fn is_terminated(&self) -> bool {
5510        self.is_terminated
5511    }
5512}
5513
5514impl fidl::endpoints::RequestStream for RealmRequestStream {
5515    type Protocol = RealmMarker;
5516    type ControlHandle = RealmControlHandle;
5517
5518    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5519        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5520    }
5521
5522    fn control_handle(&self) -> Self::ControlHandle {
5523        RealmControlHandle { inner: self.inner.clone() }
5524    }
5525
5526    fn into_inner(
5527        self,
5528    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5529    {
5530        (self.inner, self.is_terminated)
5531    }
5532
5533    fn from_inner(
5534        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5535        is_terminated: bool,
5536    ) -> Self {
5537        Self { inner, is_terminated }
5538    }
5539}
5540
5541impl futures::Stream for RealmRequestStream {
5542    type Item = Result<RealmRequest, fidl::Error>;
5543
5544    fn poll_next(
5545        mut self: std::pin::Pin<&mut Self>,
5546        cx: &mut std::task::Context<'_>,
5547    ) -> std::task::Poll<Option<Self::Item>> {
5548        let this = &mut *self;
5549        if this.inner.check_shutdown(cx) {
5550            this.is_terminated = true;
5551            return std::task::Poll::Ready(None);
5552        }
5553        if this.is_terminated {
5554            panic!("polled RealmRequestStream after completion");
5555        }
5556        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5557            |bytes, handles| {
5558                match this.inner.channel().read_etc(cx, bytes, handles) {
5559                    std::task::Poll::Ready(Ok(())) => {}
5560                    std::task::Poll::Pending => return std::task::Poll::Pending,
5561                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5562                        this.is_terminated = true;
5563                        return std::task::Poll::Ready(None);
5564                    }
5565                    std::task::Poll::Ready(Err(e)) => {
5566                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5567                            e.into(),
5568                        ))));
5569                    }
5570                }
5571
5572                // A message has been received from the channel
5573                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5574
5575                std::task::Poll::Ready(Some(match header.ordinal {
5576                    0x7150b7898d1b1180 => {
5577                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5578                        let mut req = fidl::new_empty!(
5579                            RealmOpenControllerRequest,
5580                            fidl::encoding::DefaultFuchsiaResourceDialect
5581                        );
5582                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmOpenControllerRequest>(&header, _body_bytes, handles, &mut req)?;
5583                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5584                        Ok(RealmRequest::OpenController {
5585                            child: req.child,
5586                            controller: req.controller,
5587
5588                            responder: RealmOpenControllerResponder {
5589                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5590                                tx_id: header.tx_id,
5591                            },
5592                        })
5593                    }
5594                    0x7f993235ca59f92c => {
5595                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5596                        let mut req = fidl::new_empty!(
5597                            RealmOpenExposedDirRequest,
5598                            fidl::encoding::DefaultFuchsiaResourceDialect
5599                        );
5600                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
5601                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5602                        Ok(RealmRequest::OpenExposedDir {
5603                            child: req.child,
5604                            exposed_dir: req.exposed_dir,
5605
5606                            responder: RealmOpenExposedDirResponder {
5607                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5608                                tx_id: header.tx_id,
5609                            },
5610                        })
5611                    }
5612                    0x43e48ce8483d7560 => {
5613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5614                        let mut req = fidl::new_empty!(
5615                            RealmCreateChildRequest,
5616                            fidl::encoding::DefaultFuchsiaResourceDialect
5617                        );
5618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmCreateChildRequest>(&header, _body_bytes, handles, &mut req)?;
5619                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5620                        Ok(RealmRequest::CreateChild {
5621                            collection: req.collection,
5622                            decl: req.decl,
5623                            args: req.args,
5624
5625                            responder: RealmCreateChildResponder {
5626                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5627                                tx_id: header.tx_id,
5628                            },
5629                        })
5630                    }
5631                    0x71d8caf8850c9222 => {
5632                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5633                        let mut req = fidl::new_empty!(
5634                            RealmDestroyChildRequest,
5635                            fidl::encoding::DefaultFuchsiaResourceDialect
5636                        );
5637                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmDestroyChildRequest>(&header, _body_bytes, handles, &mut req)?;
5638                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5639                        Ok(RealmRequest::DestroyChild {
5640                            child: req.child,
5641
5642                            responder: RealmDestroyChildResponder {
5643                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5644                                tx_id: header.tx_id,
5645                            },
5646                        })
5647                    }
5648                    0x6888a76683efc0a1 => {
5649                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5650                        let mut req = fidl::new_empty!(
5651                            RealmListChildrenRequest,
5652                            fidl::encoding::DefaultFuchsiaResourceDialect
5653                        );
5654                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmListChildrenRequest>(&header, _body_bytes, handles, &mut req)?;
5655                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5656                        Ok(RealmRequest::ListChildren {
5657                            collection: req.collection,
5658                            iter: req.iter,
5659
5660                            responder: RealmListChildrenResponder {
5661                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5662                                tx_id: header.tx_id,
5663                            },
5664                        })
5665                    }
5666                    0x734f744cb7d210a2 => {
5667                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5668                        let mut req = fidl::new_empty!(
5669                            fidl::encoding::EmptyPayload,
5670                            fidl::encoding::DefaultFuchsiaResourceDialect
5671                        );
5672                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5673                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5674                        Ok(RealmRequest::GetResolvedInfo {
5675                            responder: RealmGetResolvedInfoResponder {
5676                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5677                                tx_id: header.tx_id,
5678                            },
5679                        })
5680                    }
5681                    0x39245b02aba94364 => {
5682                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5683                        let mut req = fidl::new_empty!(
5684                            RealmGetChildOutputDictionaryDeprecatedRequest,
5685                            fidl::encoding::DefaultFuchsiaResourceDialect
5686                        );
5687                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmGetChildOutputDictionaryDeprecatedRequest>(&header, _body_bytes, handles, &mut req)?;
5688                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5689                        Ok(RealmRequest::GetChildOutputDictionaryDeprecated {
5690                            child: req.child,
5691
5692                            responder: RealmGetChildOutputDictionaryDeprecatedResponder {
5693                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5694                                tx_id: header.tx_id,
5695                            },
5696                        })
5697                    }
5698                    0x4259d08d261d5610 => {
5699                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5700                        let mut req = fidl::new_empty!(
5701                            RealmGetChildOutputDictionaryRequest,
5702                            fidl::encoding::DefaultFuchsiaResourceDialect
5703                        );
5704                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmGetChildOutputDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
5705                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5706                        Ok(RealmRequest::GetChildOutputDictionary {
5707                            child: req.child,
5708
5709                            responder: RealmGetChildOutputDictionaryResponder {
5710                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5711                                tx_id: header.tx_id,
5712                            },
5713                        })
5714                    }
5715                    _ => Err(fidl::Error::UnknownOrdinal {
5716                        ordinal: header.ordinal,
5717                        protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5718                    }),
5719                }))
5720            },
5721        )
5722    }
5723}
5724
5725/// A protocol used by a component instance to manage its own realm, such as for
5726/// binding to its children.
5727///
5728/// Requests to this protocol are processed in the order they are received.
5729/// Clients that wish to send requests in parallel should open multiple
5730/// connections.
5731///
5732/// The component framework provides this service to components that use
5733/// `fuchsia.component.Realm`.
5734#[derive(Debug)]
5735pub enum RealmRequest {
5736    /// Operate on a child component. See documentation for [`Controller`].
5737    ///
5738    /// Errors:
5739    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5740    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5741    /// - `INSTANCE_DIED`: This realm no longer exists.
5742    OpenController {
5743        child: fidl_fuchsia_component_decl::ChildRef,
5744        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5745        responder: RealmOpenControllerResponder,
5746    },
5747    /// Opens the exposed directory of a child component. When this function
5748    /// successfully returns, `exposed_dir` is bound to a directory that
5749    /// contains the capabilities which the child exposed to its realm via
5750    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
5751    /// component's manifest). The child component will not start as a result of
5752    /// this call.
5753    ///
5754    /// `exposed_dir` is open as long as `child` exists.
5755    ///
5756    /// Errors:
5757    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5758    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5759    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
5760    /// - `INSTANCE_DIED`: This realm no longer exists.
5761    OpenExposedDir {
5762        child: fidl_fuchsia_component_decl::ChildRef,
5763        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5764        responder: RealmOpenExposedDirResponder,
5765    },
5766    /// Creates a child component instance dynamically. When this function
5767    /// returns successfully, the instance exists, but it may not be running.
5768    ///
5769    /// The environment of the child instance is determined by the environment
5770    /// of the collection. `decl` must not set `environment`.
5771    ///
5772    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
5773    /// [CreateChild] will start the component and return once the component is
5774    /// started. Otherwise, [CreateChild] will return immediately after creating
5775    /// the component and will not start or resolve it.
5776    ///
5777    /// Errors:
5778    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
5779    ///   is not a valid declaration.
5780    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5781    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
5782    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
5783    ///   in a `SingleRun` collection.
5784    /// - `NO_SPACE`: Could not allocate storage for the new instance.
5785    /// - `INSTANCE_DIED`: This realm no longer exists.
5786    CreateChild {
5787        collection: fidl_fuchsia_component_decl::CollectionRef,
5788        decl: fidl_fuchsia_component_decl::Child,
5789        args: CreateChildArgs,
5790        responder: RealmCreateChildResponder,
5791    },
5792    /// Destroys a dynamically-created component instance. When this function
5793    /// returns, the instance is destroyed and has stopped running.  However,
5794    /// cleanup of the component's resources (such as its isolated storage) may
5795    /// happen in the background after this function returns.
5796    ///
5797    /// Errors:
5798    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
5799    ///   to a dynamic instance.
5800    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5801    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5802    /// - `INSTANCE_DIED`: This realm no longer exists.
5803    DestroyChild {
5804        child: fidl_fuchsia_component_decl::ChildRef,
5805        responder: RealmDestroyChildResponder,
5806    },
5807    /// Returns an iterator that lists all instances in a collection.
5808    ///
5809    /// NOTE: The results are not guaranteed to be consistent. Instances may be
5810    /// created or destroyed while the iterator is live, but those changes
5811    /// won't be observed by the iterator after this method returns.
5812    ///
5813    /// Errors:
5814    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
5815    /// does not have `ZX_RIGHT_WAIT`.
5816    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5817    /// - `INSTANCE_DIED`: This realm no longer exists.
5818    /// - If `iter` does not have standard channel rights, this function may
5819    ///   return `ACCESS_DENIED` or component manager may close `iter`.
5820    ListChildren {
5821        collection: fidl_fuchsia_component_decl::CollectionRef,
5822        iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5823        responder: RealmListChildrenResponder,
5824    },
5825    /// Returns the set of information that was given to the component framework
5826    /// by this component's resolver.
5827    GetResolvedInfo { responder: RealmGetResolvedInfoResponder },
5828    GetChildOutputDictionaryDeprecated {
5829        child: fidl_fuchsia_component_decl::ChildRef,
5830        responder: RealmGetChildOutputDictionaryDeprecatedResponder,
5831    },
5832    /// Returns a reference to a child's output dictionary, which may be
5833    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
5834    GetChildOutputDictionary {
5835        child: fidl_fuchsia_component_decl::ChildRef,
5836        responder: RealmGetChildOutputDictionaryResponder,
5837    },
5838}
5839
5840impl RealmRequest {
5841    #[allow(irrefutable_let_patterns)]
5842    pub fn into_open_controller(
5843        self,
5844    ) -> Option<(
5845        fidl_fuchsia_component_decl::ChildRef,
5846        fidl::endpoints::ServerEnd<ControllerMarker>,
5847        RealmOpenControllerResponder,
5848    )> {
5849        if let RealmRequest::OpenController { child, controller, responder } = self {
5850            Some((child, controller, responder))
5851        } else {
5852            None
5853        }
5854    }
5855
5856    #[allow(irrefutable_let_patterns)]
5857    pub fn into_open_exposed_dir(
5858        self,
5859    ) -> Option<(
5860        fidl_fuchsia_component_decl::ChildRef,
5861        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5862        RealmOpenExposedDirResponder,
5863    )> {
5864        if let RealmRequest::OpenExposedDir { child, exposed_dir, responder } = self {
5865            Some((child, exposed_dir, responder))
5866        } else {
5867            None
5868        }
5869    }
5870
5871    #[allow(irrefutable_let_patterns)]
5872    pub fn into_create_child(
5873        self,
5874    ) -> Option<(
5875        fidl_fuchsia_component_decl::CollectionRef,
5876        fidl_fuchsia_component_decl::Child,
5877        CreateChildArgs,
5878        RealmCreateChildResponder,
5879    )> {
5880        if let RealmRequest::CreateChild { collection, decl, args, responder } = self {
5881            Some((collection, decl, args, responder))
5882        } else {
5883            None
5884        }
5885    }
5886
5887    #[allow(irrefutable_let_patterns)]
5888    pub fn into_destroy_child(
5889        self,
5890    ) -> Option<(fidl_fuchsia_component_decl::ChildRef, RealmDestroyChildResponder)> {
5891        if let RealmRequest::DestroyChild { child, responder } = self {
5892            Some((child, responder))
5893        } else {
5894            None
5895        }
5896    }
5897
5898    #[allow(irrefutable_let_patterns)]
5899    pub fn into_list_children(
5900        self,
5901    ) -> Option<(
5902        fidl_fuchsia_component_decl::CollectionRef,
5903        fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5904        RealmListChildrenResponder,
5905    )> {
5906        if let RealmRequest::ListChildren { collection, iter, responder } = self {
5907            Some((collection, iter, responder))
5908        } else {
5909            None
5910        }
5911    }
5912
5913    #[allow(irrefutable_let_patterns)]
5914    pub fn into_get_resolved_info(self) -> Option<(RealmGetResolvedInfoResponder)> {
5915        if let RealmRequest::GetResolvedInfo { responder } = self {
5916            Some((responder))
5917        } else {
5918            None
5919        }
5920    }
5921
5922    #[allow(irrefutable_let_patterns)]
5923    pub fn into_get_child_output_dictionary_deprecated(
5924        self,
5925    ) -> Option<(
5926        fidl_fuchsia_component_decl::ChildRef,
5927        RealmGetChildOutputDictionaryDeprecatedResponder,
5928    )> {
5929        if let RealmRequest::GetChildOutputDictionaryDeprecated { child, responder } = self {
5930            Some((child, responder))
5931        } else {
5932            None
5933        }
5934    }
5935
5936    #[allow(irrefutable_let_patterns)]
5937    pub fn into_get_child_output_dictionary(
5938        self,
5939    ) -> Option<(fidl_fuchsia_component_decl::ChildRef, RealmGetChildOutputDictionaryResponder)>
5940    {
5941        if let RealmRequest::GetChildOutputDictionary { child, responder } = self {
5942            Some((child, responder))
5943        } else {
5944            None
5945        }
5946    }
5947
5948    /// Name of the method defined in FIDL
5949    pub fn method_name(&self) -> &'static str {
5950        match *self {
5951            RealmRequest::OpenController { .. } => "open_controller",
5952            RealmRequest::OpenExposedDir { .. } => "open_exposed_dir",
5953            RealmRequest::CreateChild { .. } => "create_child",
5954            RealmRequest::DestroyChild { .. } => "destroy_child",
5955            RealmRequest::ListChildren { .. } => "list_children",
5956            RealmRequest::GetResolvedInfo { .. } => "get_resolved_info",
5957            RealmRequest::GetChildOutputDictionaryDeprecated { .. } => {
5958                "get_child_output_dictionary_deprecated"
5959            }
5960            RealmRequest::GetChildOutputDictionary { .. } => "get_child_output_dictionary",
5961        }
5962    }
5963}
5964
5965#[derive(Debug, Clone)]
5966pub struct RealmControlHandle {
5967    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5968}
5969
5970impl fidl::endpoints::ControlHandle for RealmControlHandle {
5971    fn shutdown(&self) {
5972        self.inner.shutdown()
5973    }
5974
5975    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5976        self.inner.shutdown_with_epitaph(status)
5977    }
5978
5979    fn is_closed(&self) -> bool {
5980        self.inner.channel().is_closed()
5981    }
5982    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5983        self.inner.channel().on_closed()
5984    }
5985
5986    #[cfg(target_os = "fuchsia")]
5987    fn signal_peer(
5988        &self,
5989        clear_mask: zx::Signals,
5990        set_mask: zx::Signals,
5991    ) -> Result<(), zx_status::Status> {
5992        use fidl::Peered;
5993        self.inner.channel().signal_peer(clear_mask, set_mask)
5994    }
5995}
5996
5997impl RealmControlHandle {}
5998
5999#[must_use = "FIDL methods require a response to be sent"]
6000#[derive(Debug)]
6001pub struct RealmOpenControllerResponder {
6002    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6003    tx_id: u32,
6004}
6005
6006/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6007/// if the responder is dropped without sending a response, so that the client
6008/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6009impl std::ops::Drop for RealmOpenControllerResponder {
6010    fn drop(&mut self) {
6011        self.control_handle.shutdown();
6012        // Safety: drops once, never accessed again
6013        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6014    }
6015}
6016
6017impl fidl::endpoints::Responder for RealmOpenControllerResponder {
6018    type ControlHandle = RealmControlHandle;
6019
6020    fn control_handle(&self) -> &RealmControlHandle {
6021        &self.control_handle
6022    }
6023
6024    fn drop_without_shutdown(mut self) {
6025        // Safety: drops once, never accessed again due to mem::forget
6026        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6027        // Prevent Drop from running (which would shut down the channel)
6028        std::mem::forget(self);
6029    }
6030}
6031
6032impl RealmOpenControllerResponder {
6033    /// Sends a response to the FIDL transaction.
6034    ///
6035    /// Sets the channel to shutdown if an error occurs.
6036    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6037        let _result = self.send_raw(result);
6038        if _result.is_err() {
6039            self.control_handle.shutdown();
6040        }
6041        self.drop_without_shutdown();
6042        _result
6043    }
6044
6045    /// Similar to "send" but does not shutdown the channel if an error occurs.
6046    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6047        let _result = self.send_raw(result);
6048        self.drop_without_shutdown();
6049        _result
6050    }
6051
6052    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6053        self.control_handle
6054            .inner
6055            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6056                result,
6057                self.tx_id,
6058                0x7150b7898d1b1180,
6059                fidl::encoding::DynamicFlags::empty(),
6060            )
6061    }
6062}
6063
6064#[must_use = "FIDL methods require a response to be sent"]
6065#[derive(Debug)]
6066pub struct RealmOpenExposedDirResponder {
6067    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6068    tx_id: u32,
6069}
6070
6071/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6072/// if the responder is dropped without sending a response, so that the client
6073/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6074impl std::ops::Drop for RealmOpenExposedDirResponder {
6075    fn drop(&mut self) {
6076        self.control_handle.shutdown();
6077        // Safety: drops once, never accessed again
6078        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6079    }
6080}
6081
6082impl fidl::endpoints::Responder for RealmOpenExposedDirResponder {
6083    type ControlHandle = RealmControlHandle;
6084
6085    fn control_handle(&self) -> &RealmControlHandle {
6086        &self.control_handle
6087    }
6088
6089    fn drop_without_shutdown(mut self) {
6090        // Safety: drops once, never accessed again due to mem::forget
6091        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6092        // Prevent Drop from running (which would shut down the channel)
6093        std::mem::forget(self);
6094    }
6095}
6096
6097impl RealmOpenExposedDirResponder {
6098    /// Sends a response to the FIDL transaction.
6099    ///
6100    /// Sets the channel to shutdown if an error occurs.
6101    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6102        let _result = self.send_raw(result);
6103        if _result.is_err() {
6104            self.control_handle.shutdown();
6105        }
6106        self.drop_without_shutdown();
6107        _result
6108    }
6109
6110    /// Similar to "send" but does not shutdown the channel if an error occurs.
6111    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6112        let _result = self.send_raw(result);
6113        self.drop_without_shutdown();
6114        _result
6115    }
6116
6117    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6118        self.control_handle
6119            .inner
6120            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6121                result,
6122                self.tx_id,
6123                0x7f993235ca59f92c,
6124                fidl::encoding::DynamicFlags::empty(),
6125            )
6126    }
6127}
6128
6129#[must_use = "FIDL methods require a response to be sent"]
6130#[derive(Debug)]
6131pub struct RealmCreateChildResponder {
6132    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6133    tx_id: u32,
6134}
6135
6136/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6137/// if the responder is dropped without sending a response, so that the client
6138/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6139impl std::ops::Drop for RealmCreateChildResponder {
6140    fn drop(&mut self) {
6141        self.control_handle.shutdown();
6142        // Safety: drops once, never accessed again
6143        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6144    }
6145}
6146
6147impl fidl::endpoints::Responder for RealmCreateChildResponder {
6148    type ControlHandle = RealmControlHandle;
6149
6150    fn control_handle(&self) -> &RealmControlHandle {
6151        &self.control_handle
6152    }
6153
6154    fn drop_without_shutdown(mut self) {
6155        // Safety: drops once, never accessed again due to mem::forget
6156        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6157        // Prevent Drop from running (which would shut down the channel)
6158        std::mem::forget(self);
6159    }
6160}
6161
6162impl RealmCreateChildResponder {
6163    /// Sends a response to the FIDL transaction.
6164    ///
6165    /// Sets the channel to shutdown if an error occurs.
6166    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6167        let _result = self.send_raw(result);
6168        if _result.is_err() {
6169            self.control_handle.shutdown();
6170        }
6171        self.drop_without_shutdown();
6172        _result
6173    }
6174
6175    /// Similar to "send" but does not shutdown the channel if an error occurs.
6176    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6177        let _result = self.send_raw(result);
6178        self.drop_without_shutdown();
6179        _result
6180    }
6181
6182    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6183        self.control_handle
6184            .inner
6185            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6186                result,
6187                self.tx_id,
6188                0x43e48ce8483d7560,
6189                fidl::encoding::DynamicFlags::empty(),
6190            )
6191    }
6192}
6193
6194#[must_use = "FIDL methods require a response to be sent"]
6195#[derive(Debug)]
6196pub struct RealmDestroyChildResponder {
6197    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6198    tx_id: u32,
6199}
6200
6201/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6202/// if the responder is dropped without sending a response, so that the client
6203/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6204impl std::ops::Drop for RealmDestroyChildResponder {
6205    fn drop(&mut self) {
6206        self.control_handle.shutdown();
6207        // Safety: drops once, never accessed again
6208        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6209    }
6210}
6211
6212impl fidl::endpoints::Responder for RealmDestroyChildResponder {
6213    type ControlHandle = RealmControlHandle;
6214
6215    fn control_handle(&self) -> &RealmControlHandle {
6216        &self.control_handle
6217    }
6218
6219    fn drop_without_shutdown(mut self) {
6220        // Safety: drops once, never accessed again due to mem::forget
6221        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6222        // Prevent Drop from running (which would shut down the channel)
6223        std::mem::forget(self);
6224    }
6225}
6226
6227impl RealmDestroyChildResponder {
6228    /// Sends a response to the FIDL transaction.
6229    ///
6230    /// Sets the channel to shutdown if an error occurs.
6231    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6232        let _result = self.send_raw(result);
6233        if _result.is_err() {
6234            self.control_handle.shutdown();
6235        }
6236        self.drop_without_shutdown();
6237        _result
6238    }
6239
6240    /// Similar to "send" but does not shutdown the channel if an error occurs.
6241    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6242        let _result = self.send_raw(result);
6243        self.drop_without_shutdown();
6244        _result
6245    }
6246
6247    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6248        self.control_handle
6249            .inner
6250            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6251                result,
6252                self.tx_id,
6253                0x71d8caf8850c9222,
6254                fidl::encoding::DynamicFlags::empty(),
6255            )
6256    }
6257}
6258
6259#[must_use = "FIDL methods require a response to be sent"]
6260#[derive(Debug)]
6261pub struct RealmListChildrenResponder {
6262    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6263    tx_id: u32,
6264}
6265
6266/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6267/// if the responder is dropped without sending a response, so that the client
6268/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6269impl std::ops::Drop for RealmListChildrenResponder {
6270    fn drop(&mut self) {
6271        self.control_handle.shutdown();
6272        // Safety: drops once, never accessed again
6273        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6274    }
6275}
6276
6277impl fidl::endpoints::Responder for RealmListChildrenResponder {
6278    type ControlHandle = RealmControlHandle;
6279
6280    fn control_handle(&self) -> &RealmControlHandle {
6281        &self.control_handle
6282    }
6283
6284    fn drop_without_shutdown(mut self) {
6285        // Safety: drops once, never accessed again due to mem::forget
6286        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6287        // Prevent Drop from running (which would shut down the channel)
6288        std::mem::forget(self);
6289    }
6290}
6291
6292impl RealmListChildrenResponder {
6293    /// Sends a response to the FIDL transaction.
6294    ///
6295    /// Sets the channel to shutdown if an error occurs.
6296    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6297        let _result = self.send_raw(result);
6298        if _result.is_err() {
6299            self.control_handle.shutdown();
6300        }
6301        self.drop_without_shutdown();
6302        _result
6303    }
6304
6305    /// Similar to "send" but does not shutdown the channel if an error occurs.
6306    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6307        let _result = self.send_raw(result);
6308        self.drop_without_shutdown();
6309        _result
6310    }
6311
6312    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6313        self.control_handle
6314            .inner
6315            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6316                result,
6317                self.tx_id,
6318                0x6888a76683efc0a1,
6319                fidl::encoding::DynamicFlags::empty(),
6320            )
6321    }
6322}
6323
6324#[must_use = "FIDL methods require a response to be sent"]
6325#[derive(Debug)]
6326pub struct RealmGetResolvedInfoResponder {
6327    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6328    tx_id: u32,
6329}
6330
6331/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6332/// if the responder is dropped without sending a response, so that the client
6333/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6334impl std::ops::Drop for RealmGetResolvedInfoResponder {
6335    fn drop(&mut self) {
6336        self.control_handle.shutdown();
6337        // Safety: drops once, never accessed again
6338        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6339    }
6340}
6341
6342impl fidl::endpoints::Responder for RealmGetResolvedInfoResponder {
6343    type ControlHandle = RealmControlHandle;
6344
6345    fn control_handle(&self) -> &RealmControlHandle {
6346        &self.control_handle
6347    }
6348
6349    fn drop_without_shutdown(mut self) {
6350        // Safety: drops once, never accessed again due to mem::forget
6351        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6352        // Prevent Drop from running (which would shut down the channel)
6353        std::mem::forget(self);
6354    }
6355}
6356
6357impl RealmGetResolvedInfoResponder {
6358    /// Sends a response to the FIDL transaction.
6359    ///
6360    /// Sets the channel to shutdown if an error occurs.
6361    pub fn send(
6362        self,
6363        mut result: Result<fidl_fuchsia_component_resolution::Component, Error>,
6364    ) -> Result<(), fidl::Error> {
6365        let _result = self.send_raw(result);
6366        if _result.is_err() {
6367            self.control_handle.shutdown();
6368        }
6369        self.drop_without_shutdown();
6370        _result
6371    }
6372
6373    /// Similar to "send" but does not shutdown the channel if an error occurs.
6374    pub fn send_no_shutdown_on_err(
6375        self,
6376        mut result: Result<fidl_fuchsia_component_resolution::Component, Error>,
6377    ) -> Result<(), fidl::Error> {
6378        let _result = self.send_raw(result);
6379        self.drop_without_shutdown();
6380        _result
6381    }
6382
6383    fn send_raw(
6384        &self,
6385        mut result: Result<fidl_fuchsia_component_resolution::Component, Error>,
6386    ) -> Result<(), fidl::Error> {
6387        self.control_handle
6388            .inner
6389            .send::<fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>>(
6390                result.as_mut().map_err(|e| *e).map(|resolved_info| (resolved_info,)),
6391                self.tx_id,
6392                0x734f744cb7d210a2,
6393                fidl::encoding::DynamicFlags::empty(),
6394            )
6395    }
6396}
6397
6398#[must_use = "FIDL methods require a response to be sent"]
6399#[derive(Debug)]
6400pub struct RealmGetChildOutputDictionaryDeprecatedResponder {
6401    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6402    tx_id: u32,
6403}
6404
6405/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6406/// if the responder is dropped without sending a response, so that the client
6407/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6408impl std::ops::Drop for RealmGetChildOutputDictionaryDeprecatedResponder {
6409    fn drop(&mut self) {
6410        self.control_handle.shutdown();
6411        // Safety: drops once, never accessed again
6412        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6413    }
6414}
6415
6416impl fidl::endpoints::Responder for RealmGetChildOutputDictionaryDeprecatedResponder {
6417    type ControlHandle = RealmControlHandle;
6418
6419    fn control_handle(&self) -> &RealmControlHandle {
6420        &self.control_handle
6421    }
6422
6423    fn drop_without_shutdown(mut self) {
6424        // Safety: drops once, never accessed again due to mem::forget
6425        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6426        // Prevent Drop from running (which would shut down the channel)
6427        std::mem::forget(self);
6428    }
6429}
6430
6431impl RealmGetChildOutputDictionaryDeprecatedResponder {
6432    /// Sends a response to the FIDL transaction.
6433    ///
6434    /// Sets the channel to shutdown if an error occurs.
6435    pub fn send(
6436        self,
6437        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
6438    ) -> Result<(), fidl::Error> {
6439        let _result = self.send_raw(result);
6440        if _result.is_err() {
6441            self.control_handle.shutdown();
6442        }
6443        self.drop_without_shutdown();
6444        _result
6445    }
6446
6447    /// Similar to "send" but does not shutdown the channel if an error occurs.
6448    pub fn send_no_shutdown_on_err(
6449        self,
6450        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
6451    ) -> Result<(), fidl::Error> {
6452        let _result = self.send_raw(result);
6453        self.drop_without_shutdown();
6454        _result
6455    }
6456
6457    fn send_raw(
6458        &self,
6459        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
6460    ) -> Result<(), fidl::Error> {
6461        self.control_handle.inner.send::<fidl::encoding::ResultType<
6462            RealmGetChildOutputDictionaryDeprecatedResponse,
6463            Error,
6464        >>(
6465            result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
6466            self.tx_id,
6467            0x39245b02aba94364,
6468            fidl::encoding::DynamicFlags::empty(),
6469        )
6470    }
6471}
6472
6473#[must_use = "FIDL methods require a response to be sent"]
6474#[derive(Debug)]
6475pub struct RealmGetChildOutputDictionaryResponder {
6476    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6477    tx_id: u32,
6478}
6479
6480/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6481/// if the responder is dropped without sending a response, so that the client
6482/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6483impl std::ops::Drop for RealmGetChildOutputDictionaryResponder {
6484    fn drop(&mut self) {
6485        self.control_handle.shutdown();
6486        // Safety: drops once, never accessed again
6487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6488    }
6489}
6490
6491impl fidl::endpoints::Responder for RealmGetChildOutputDictionaryResponder {
6492    type ControlHandle = RealmControlHandle;
6493
6494    fn control_handle(&self) -> &RealmControlHandle {
6495        &self.control_handle
6496    }
6497
6498    fn drop_without_shutdown(mut self) {
6499        // Safety: drops once, never accessed again due to mem::forget
6500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6501        // Prevent Drop from running (which would shut down the channel)
6502        std::mem::forget(self);
6503    }
6504}
6505
6506impl RealmGetChildOutputDictionaryResponder {
6507    /// Sends a response to the FIDL transaction.
6508    ///
6509    /// Sets the channel to shutdown if an error occurs.
6510    pub fn send(self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
6511        let _result = self.send_raw(result);
6512        if _result.is_err() {
6513            self.control_handle.shutdown();
6514        }
6515        self.drop_without_shutdown();
6516        _result
6517    }
6518
6519    /// Similar to "send" but does not shutdown the channel if an error occurs.
6520    pub fn send_no_shutdown_on_err(
6521        self,
6522        mut result: Result<fidl::EventPair, Error>,
6523    ) -> Result<(), fidl::Error> {
6524        let _result = self.send_raw(result);
6525        self.drop_without_shutdown();
6526        _result
6527    }
6528
6529    fn send_raw(&self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
6530        self.control_handle.inner.send::<fidl::encoding::ResultType<
6531            RealmGetChildOutputDictionaryResponse,
6532            Error,
6533        >>(
6534            result.map(|dictionary| (dictionary,)),
6535            self.tx_id,
6536            0x4259d08d261d5610,
6537            fidl::encoding::DynamicFlags::empty(),
6538        )
6539    }
6540}
6541
6542#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6543pub struct StorageAdminMarker;
6544
6545impl fidl::endpoints::ProtocolMarker for StorageAdminMarker {
6546    type Proxy = StorageAdminProxy;
6547    type RequestStream = StorageAdminRequestStream;
6548    #[cfg(target_os = "fuchsia")]
6549    type SynchronousProxy = StorageAdminSynchronousProxy;
6550
6551    const DEBUG_NAME: &'static str = "fuchsia.component.StorageAdmin";
6552}
6553impl fidl::endpoints::DiscoverableProtocolMarker for StorageAdminMarker {}
6554pub type StorageAdminOpenStorageResult = Result<(), Error>;
6555pub type StorageAdminListStorageInRealmResult = Result<(), Error>;
6556pub type StorageAdminOpenComponentStorageByIdResult = Result<(), Error>;
6557pub type StorageAdminDeleteComponentStorageResult = Result<(), Error>;
6558pub type StorageAdminGetStatusResult = Result<StorageStatus, StatusError>;
6559pub type StorageAdminDeleteAllStorageContentsResult = Result<(), DeletionError>;
6560
6561pub trait StorageAdminProxyInterface: Send + Sync {
6562    type OpenStorageResponseFut: std::future::Future<Output = Result<StorageAdminOpenStorageResult, fidl::Error>>
6563        + Send;
6564    fn r#open_storage(
6565        &self,
6566        relative_moniker: &str,
6567        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6568    ) -> Self::OpenStorageResponseFut;
6569    type ListStorageInRealmResponseFut: std::future::Future<Output = Result<StorageAdminListStorageInRealmResult, fidl::Error>>
6570        + Send;
6571    fn r#list_storage_in_realm(
6572        &self,
6573        relative_moniker: &str,
6574        iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
6575    ) -> Self::ListStorageInRealmResponseFut;
6576    type OpenComponentStorageByIdResponseFut: std::future::Future<
6577            Output = Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error>,
6578        > + Send;
6579    fn r#open_component_storage_by_id(
6580        &self,
6581        id: &str,
6582        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6583    ) -> Self::OpenComponentStorageByIdResponseFut;
6584    type DeleteComponentStorageResponseFut: std::future::Future<Output = Result<StorageAdminDeleteComponentStorageResult, fidl::Error>>
6585        + Send;
6586    fn r#delete_component_storage(
6587        &self,
6588        relative_moniker: &str,
6589    ) -> Self::DeleteComponentStorageResponseFut;
6590    type GetStatusResponseFut: std::future::Future<Output = Result<StorageAdminGetStatusResult, fidl::Error>>
6591        + Send;
6592    fn r#get_status(&self) -> Self::GetStatusResponseFut;
6593    type DeleteAllStorageContentsResponseFut: std::future::Future<
6594            Output = Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error>,
6595        > + Send;
6596    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut;
6597}
6598#[derive(Debug)]
6599#[cfg(target_os = "fuchsia")]
6600pub struct StorageAdminSynchronousProxy {
6601    client: fidl::client::sync::Client,
6602}
6603
6604#[cfg(target_os = "fuchsia")]
6605impl fidl::endpoints::SynchronousProxy for StorageAdminSynchronousProxy {
6606    type Proxy = StorageAdminProxy;
6607    type Protocol = StorageAdminMarker;
6608
6609    fn from_channel(inner: fidl::Channel) -> Self {
6610        Self::new(inner)
6611    }
6612
6613    fn into_channel(self) -> fidl::Channel {
6614        self.client.into_channel()
6615    }
6616
6617    fn as_channel(&self) -> &fidl::Channel {
6618        self.client.as_channel()
6619    }
6620}
6621
6622#[cfg(target_os = "fuchsia")]
6623impl StorageAdminSynchronousProxy {
6624    pub fn new(channel: fidl::Channel) -> Self {
6625        let protocol_name = <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6626        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6627    }
6628
6629    pub fn into_channel(self) -> fidl::Channel {
6630        self.client.into_channel()
6631    }
6632
6633    /// Waits until an event arrives and returns it. It is safe for other
6634    /// threads to make concurrent requests while waiting for an event.
6635    pub fn wait_for_event(
6636        &self,
6637        deadline: zx::MonotonicInstant,
6638    ) -> Result<StorageAdminEvent, fidl::Error> {
6639        StorageAdminEvent::decode(self.client.wait_for_event(deadline)?)
6640    }
6641
6642    /// Opens the isolated directory for the given component. The provided
6643    /// moniker is relative to the component that declares the storage
6644    /// capability. Creates the backing sub-directory for this storage if it
6645    /// hasn't yet been created.
6646    pub fn r#open_storage(
6647        &self,
6648        mut relative_moniker: &str,
6649        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6650        ___deadline: zx::MonotonicInstant,
6651    ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
6652        let _response = self.client.send_query::<
6653            StorageAdminOpenStorageRequest,
6654            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6655        >(
6656            (relative_moniker, object,),
6657            0x6ceaa5904cfe4377,
6658            fidl::encoding::DynamicFlags::empty(),
6659            ___deadline,
6660        )?;
6661        Ok(_response.map(|x| x))
6662    }
6663
6664    /// Lists the descendant components under the specified realm that use the
6665    /// storage capability. The provided moniker is relative to the component
6666    /// that declares the storage capability.
6667    ///
6668    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
6669    /// if |relative_moniker| is malformed.
6670    pub fn r#list_storage_in_realm(
6671        &self,
6672        mut relative_moniker: &str,
6673        mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
6674        ___deadline: zx::MonotonicInstant,
6675    ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
6676        let _response = self.client.send_query::<
6677            StorageAdminListStorageInRealmRequest,
6678            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6679        >(
6680            (relative_moniker, iterator,),
6681            0x764f6d1f083e8bfb,
6682            fidl::encoding::DynamicFlags::empty(),
6683            ___deadline,
6684        )?;
6685        Ok(_response.map(|x| x))
6686    }
6687
6688    /// Opens the isolated directory for the given storage ID. Creates the
6689    /// backing sub-directory for this storage if it hasn't yet been created.
6690    pub fn r#open_component_storage_by_id(
6691        &self,
6692        mut id: &str,
6693        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6694        ___deadline: zx::MonotonicInstant,
6695    ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
6696        let _response = self.client.send_query::<
6697            StorageAdminOpenComponentStorageByIdRequest,
6698            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6699        >(
6700            (id, object,),
6701            0x4802102cc55d5df1,
6702            fidl::encoding::DynamicFlags::empty(),
6703            ___deadline,
6704        )?;
6705        Ok(_response.map(|x| x))
6706    }
6707
6708    /// Deletes the contents of the storage for this component. Preserves the
6709    /// component's subdirectory itself within the storage backing directory.
6710    /// The provided moniker is relative to the component that declares the
6711    /// storage capability.
6712    pub fn r#delete_component_storage(
6713        &self,
6714        mut relative_moniker: &str,
6715        ___deadline: zx::MonotonicInstant,
6716    ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
6717        let _response = self.client.send_query::<
6718            StorageAdminDeleteComponentStorageRequest,
6719            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6720        >(
6721            (relative_moniker,),
6722            0x1677c1cdfcdbf45a,
6723            fidl::encoding::DynamicFlags::empty(),
6724            ___deadline,
6725        )?;
6726        Ok(_response.map(|x| x))
6727    }
6728
6729    /// Get the current status of the storage.
6730    pub fn r#get_status(
6731        &self,
6732        ___deadline: zx::MonotonicInstant,
6733    ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
6734        let _response = self.client.send_query::<
6735            fidl::encoding::EmptyPayload,
6736            fidl::encoding::ResultType<StorageStatus, StatusError>,
6737        >(
6738            (),
6739            0x7729e325a6c526c8,
6740            fidl::encoding::DynamicFlags::empty(),
6741            ___deadline,
6742        )?;
6743        Ok(_response.map(|x| x))
6744    }
6745
6746    /// Deletes the contents of all the storage. Storage directories are
6747    /// retained so any components using storage will be able to continue using
6748    /// it to create new files and directories.
6749    ///
6750    /// Returns Error::INTERNAL only if no storage at all could be cleared.
6751    /// Returns successfully even if some errors happen during the deletion
6752    /// progress.
6753    pub fn r#delete_all_storage_contents(
6754        &self,
6755        ___deadline: zx::MonotonicInstant,
6756    ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
6757        let _response = self.client.send_query::<
6758            fidl::encoding::EmptyPayload,
6759            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
6760        >(
6761            (),
6762            0x2ee980b4b2d24adb,
6763            fidl::encoding::DynamicFlags::empty(),
6764            ___deadline,
6765        )?;
6766        Ok(_response.map(|x| x))
6767    }
6768}
6769
6770#[cfg(target_os = "fuchsia")]
6771impl From<StorageAdminSynchronousProxy> for zx::NullableHandle {
6772    fn from(value: StorageAdminSynchronousProxy) -> Self {
6773        value.into_channel().into()
6774    }
6775}
6776
6777#[cfg(target_os = "fuchsia")]
6778impl From<fidl::Channel> for StorageAdminSynchronousProxy {
6779    fn from(value: fidl::Channel) -> Self {
6780        Self::new(value)
6781    }
6782}
6783
6784#[cfg(target_os = "fuchsia")]
6785impl fidl::endpoints::FromClient for StorageAdminSynchronousProxy {
6786    type Protocol = StorageAdminMarker;
6787
6788    fn from_client(value: fidl::endpoints::ClientEnd<StorageAdminMarker>) -> Self {
6789        Self::new(value.into_channel())
6790    }
6791}
6792
6793#[derive(Debug, Clone)]
6794pub struct StorageAdminProxy {
6795    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
6796}
6797
6798impl fidl::endpoints::Proxy for StorageAdminProxy {
6799    type Protocol = StorageAdminMarker;
6800
6801    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
6802        Self::new(inner)
6803    }
6804
6805    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
6806        self.client.into_channel().map_err(|client| Self { client })
6807    }
6808
6809    fn as_channel(&self) -> &::fidl::AsyncChannel {
6810        self.client.as_channel()
6811    }
6812}
6813
6814impl StorageAdminProxy {
6815    /// Create a new Proxy for fuchsia.component/StorageAdmin.
6816    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
6817        let protocol_name = <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6818        Self { client: fidl::client::Client::new(channel, protocol_name) }
6819    }
6820
6821    /// Get a Stream of events from the remote end of the protocol.
6822    ///
6823    /// # Panics
6824    ///
6825    /// Panics if the event stream was already taken.
6826    pub fn take_event_stream(&self) -> StorageAdminEventStream {
6827        StorageAdminEventStream { event_receiver: self.client.take_event_receiver() }
6828    }
6829
6830    /// Opens the isolated directory for the given component. The provided
6831    /// moniker is relative to the component that declares the storage
6832    /// capability. Creates the backing sub-directory for this storage if it
6833    /// hasn't yet been created.
6834    pub fn r#open_storage(
6835        &self,
6836        mut relative_moniker: &str,
6837        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6838    ) -> fidl::client::QueryResponseFut<
6839        StorageAdminOpenStorageResult,
6840        fidl::encoding::DefaultFuchsiaResourceDialect,
6841    > {
6842        StorageAdminProxyInterface::r#open_storage(self, relative_moniker, object)
6843    }
6844
6845    /// Lists the descendant components under the specified realm that use the
6846    /// storage capability. The provided moniker is relative to the component
6847    /// that declares the storage capability.
6848    ///
6849    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
6850    /// if |relative_moniker| is malformed.
6851    pub fn r#list_storage_in_realm(
6852        &self,
6853        mut relative_moniker: &str,
6854        mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
6855    ) -> fidl::client::QueryResponseFut<
6856        StorageAdminListStorageInRealmResult,
6857        fidl::encoding::DefaultFuchsiaResourceDialect,
6858    > {
6859        StorageAdminProxyInterface::r#list_storage_in_realm(self, relative_moniker, iterator)
6860    }
6861
6862    /// Opens the isolated directory for the given storage ID. Creates the
6863    /// backing sub-directory for this storage if it hasn't yet been created.
6864    pub fn r#open_component_storage_by_id(
6865        &self,
6866        mut id: &str,
6867        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6868    ) -> fidl::client::QueryResponseFut<
6869        StorageAdminOpenComponentStorageByIdResult,
6870        fidl::encoding::DefaultFuchsiaResourceDialect,
6871    > {
6872        StorageAdminProxyInterface::r#open_component_storage_by_id(self, id, object)
6873    }
6874
6875    /// Deletes the contents of the storage for this component. Preserves the
6876    /// component's subdirectory itself within the storage backing directory.
6877    /// The provided moniker is relative to the component that declares the
6878    /// storage capability.
6879    pub fn r#delete_component_storage(
6880        &self,
6881        mut relative_moniker: &str,
6882    ) -> fidl::client::QueryResponseFut<
6883        StorageAdminDeleteComponentStorageResult,
6884        fidl::encoding::DefaultFuchsiaResourceDialect,
6885    > {
6886        StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
6887    }
6888
6889    /// Get the current status of the storage.
6890    pub fn r#get_status(
6891        &self,
6892    ) -> fidl::client::QueryResponseFut<
6893        StorageAdminGetStatusResult,
6894        fidl::encoding::DefaultFuchsiaResourceDialect,
6895    > {
6896        StorageAdminProxyInterface::r#get_status(self)
6897    }
6898
6899    /// Deletes the contents of all the storage. Storage directories are
6900    /// retained so any components using storage will be able to continue using
6901    /// it to create new files and directories.
6902    ///
6903    /// Returns Error::INTERNAL only if no storage at all could be cleared.
6904    /// Returns successfully even if some errors happen during the deletion
6905    /// progress.
6906    pub fn r#delete_all_storage_contents(
6907        &self,
6908    ) -> fidl::client::QueryResponseFut<
6909        StorageAdminDeleteAllStorageContentsResult,
6910        fidl::encoding::DefaultFuchsiaResourceDialect,
6911    > {
6912        StorageAdminProxyInterface::r#delete_all_storage_contents(self)
6913    }
6914}
6915
6916impl StorageAdminProxyInterface for StorageAdminProxy {
6917    type OpenStorageResponseFut = fidl::client::QueryResponseFut<
6918        StorageAdminOpenStorageResult,
6919        fidl::encoding::DefaultFuchsiaResourceDialect,
6920    >;
6921    fn r#open_storage(
6922        &self,
6923        mut relative_moniker: &str,
6924        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6925    ) -> Self::OpenStorageResponseFut {
6926        fn _decode(
6927            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6928        ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
6929            let _response = fidl::client::decode_transaction_body::<
6930                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6931                fidl::encoding::DefaultFuchsiaResourceDialect,
6932                0x6ceaa5904cfe4377,
6933            >(_buf?)?;
6934            Ok(_response.map(|x| x))
6935        }
6936        self.client
6937            .send_query_and_decode::<StorageAdminOpenStorageRequest, StorageAdminOpenStorageResult>(
6938                (relative_moniker, object),
6939                0x6ceaa5904cfe4377,
6940                fidl::encoding::DynamicFlags::empty(),
6941                _decode,
6942            )
6943    }
6944
6945    type ListStorageInRealmResponseFut = fidl::client::QueryResponseFut<
6946        StorageAdminListStorageInRealmResult,
6947        fidl::encoding::DefaultFuchsiaResourceDialect,
6948    >;
6949    fn r#list_storage_in_realm(
6950        &self,
6951        mut relative_moniker: &str,
6952        mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
6953    ) -> Self::ListStorageInRealmResponseFut {
6954        fn _decode(
6955            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6956        ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
6957            let _response = fidl::client::decode_transaction_body::<
6958                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6959                fidl::encoding::DefaultFuchsiaResourceDialect,
6960                0x764f6d1f083e8bfb,
6961            >(_buf?)?;
6962            Ok(_response.map(|x| x))
6963        }
6964        self.client.send_query_and_decode::<
6965            StorageAdminListStorageInRealmRequest,
6966            StorageAdminListStorageInRealmResult,
6967        >(
6968            (relative_moniker, iterator,),
6969            0x764f6d1f083e8bfb,
6970            fidl::encoding::DynamicFlags::empty(),
6971            _decode,
6972        )
6973    }
6974
6975    type OpenComponentStorageByIdResponseFut = fidl::client::QueryResponseFut<
6976        StorageAdminOpenComponentStorageByIdResult,
6977        fidl::encoding::DefaultFuchsiaResourceDialect,
6978    >;
6979    fn r#open_component_storage_by_id(
6980        &self,
6981        mut id: &str,
6982        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6983    ) -> Self::OpenComponentStorageByIdResponseFut {
6984        fn _decode(
6985            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6986        ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
6987            let _response = fidl::client::decode_transaction_body::<
6988                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6989                fidl::encoding::DefaultFuchsiaResourceDialect,
6990                0x4802102cc55d5df1,
6991            >(_buf?)?;
6992            Ok(_response.map(|x| x))
6993        }
6994        self.client.send_query_and_decode::<
6995            StorageAdminOpenComponentStorageByIdRequest,
6996            StorageAdminOpenComponentStorageByIdResult,
6997        >(
6998            (id, object,),
6999            0x4802102cc55d5df1,
7000            fidl::encoding::DynamicFlags::empty(),
7001            _decode,
7002        )
7003    }
7004
7005    type DeleteComponentStorageResponseFut = fidl::client::QueryResponseFut<
7006        StorageAdminDeleteComponentStorageResult,
7007        fidl::encoding::DefaultFuchsiaResourceDialect,
7008    >;
7009    fn r#delete_component_storage(
7010        &self,
7011        mut relative_moniker: &str,
7012    ) -> Self::DeleteComponentStorageResponseFut {
7013        fn _decode(
7014            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7015        ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
7016            let _response = fidl::client::decode_transaction_body::<
7017                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
7018                fidl::encoding::DefaultFuchsiaResourceDialect,
7019                0x1677c1cdfcdbf45a,
7020            >(_buf?)?;
7021            Ok(_response.map(|x| x))
7022        }
7023        self.client.send_query_and_decode::<
7024            StorageAdminDeleteComponentStorageRequest,
7025            StorageAdminDeleteComponentStorageResult,
7026        >(
7027            (relative_moniker,),
7028            0x1677c1cdfcdbf45a,
7029            fidl::encoding::DynamicFlags::empty(),
7030            _decode,
7031        )
7032    }
7033
7034    type GetStatusResponseFut = fidl::client::QueryResponseFut<
7035        StorageAdminGetStatusResult,
7036        fidl::encoding::DefaultFuchsiaResourceDialect,
7037    >;
7038    fn r#get_status(&self) -> Self::GetStatusResponseFut {
7039        fn _decode(
7040            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7041        ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
7042            let _response = fidl::client::decode_transaction_body::<
7043                fidl::encoding::ResultType<StorageStatus, StatusError>,
7044                fidl::encoding::DefaultFuchsiaResourceDialect,
7045                0x7729e325a6c526c8,
7046            >(_buf?)?;
7047            Ok(_response.map(|x| x))
7048        }
7049        self.client
7050            .send_query_and_decode::<fidl::encoding::EmptyPayload, StorageAdminGetStatusResult>(
7051                (),
7052                0x7729e325a6c526c8,
7053                fidl::encoding::DynamicFlags::empty(),
7054                _decode,
7055            )
7056    }
7057
7058    type DeleteAllStorageContentsResponseFut = fidl::client::QueryResponseFut<
7059        StorageAdminDeleteAllStorageContentsResult,
7060        fidl::encoding::DefaultFuchsiaResourceDialect,
7061    >;
7062    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
7063        fn _decode(
7064            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7065        ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
7066            let _response = fidl::client::decode_transaction_body::<
7067                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
7068                fidl::encoding::DefaultFuchsiaResourceDialect,
7069                0x2ee980b4b2d24adb,
7070            >(_buf?)?;
7071            Ok(_response.map(|x| x))
7072        }
7073        self.client.send_query_and_decode::<
7074            fidl::encoding::EmptyPayload,
7075            StorageAdminDeleteAllStorageContentsResult,
7076        >(
7077            (),
7078            0x2ee980b4b2d24adb,
7079            fidl::encoding::DynamicFlags::empty(),
7080            _decode,
7081        )
7082    }
7083}
7084
7085pub struct StorageAdminEventStream {
7086    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7087}
7088
7089impl std::marker::Unpin for StorageAdminEventStream {}
7090
7091impl futures::stream::FusedStream for StorageAdminEventStream {
7092    fn is_terminated(&self) -> bool {
7093        self.event_receiver.is_terminated()
7094    }
7095}
7096
7097impl futures::Stream for StorageAdminEventStream {
7098    type Item = Result<StorageAdminEvent, fidl::Error>;
7099
7100    fn poll_next(
7101        mut self: std::pin::Pin<&mut Self>,
7102        cx: &mut std::task::Context<'_>,
7103    ) -> std::task::Poll<Option<Self::Item>> {
7104        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7105            &mut self.event_receiver,
7106            cx
7107        )?) {
7108            Some(buf) => std::task::Poll::Ready(Some(StorageAdminEvent::decode(buf))),
7109            None => std::task::Poll::Ready(None),
7110        }
7111    }
7112}
7113
7114#[derive(Debug)]
7115pub enum StorageAdminEvent {}
7116
7117impl StorageAdminEvent {
7118    /// Decodes a message buffer as a [`StorageAdminEvent`].
7119    fn decode(
7120        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7121    ) -> Result<StorageAdminEvent, fidl::Error> {
7122        let (bytes, _handles) = buf.split_mut();
7123        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7124        debug_assert_eq!(tx_header.tx_id, 0);
7125        match tx_header.ordinal {
7126            _ => Err(fidl::Error::UnknownOrdinal {
7127                ordinal: tx_header.ordinal,
7128                protocol_name: <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7129            }),
7130        }
7131    }
7132}
7133
7134/// A Stream of incoming requests for fuchsia.component/StorageAdmin.
7135pub struct StorageAdminRequestStream {
7136    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7137    is_terminated: bool,
7138}
7139
7140impl std::marker::Unpin for StorageAdminRequestStream {}
7141
7142impl futures::stream::FusedStream for StorageAdminRequestStream {
7143    fn is_terminated(&self) -> bool {
7144        self.is_terminated
7145    }
7146}
7147
7148impl fidl::endpoints::RequestStream for StorageAdminRequestStream {
7149    type Protocol = StorageAdminMarker;
7150    type ControlHandle = StorageAdminControlHandle;
7151
7152    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7153        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7154    }
7155
7156    fn control_handle(&self) -> Self::ControlHandle {
7157        StorageAdminControlHandle { inner: self.inner.clone() }
7158    }
7159
7160    fn into_inner(
7161        self,
7162    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7163    {
7164        (self.inner, self.is_terminated)
7165    }
7166
7167    fn from_inner(
7168        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7169        is_terminated: bool,
7170    ) -> Self {
7171        Self { inner, is_terminated }
7172    }
7173}
7174
7175impl futures::Stream for StorageAdminRequestStream {
7176    type Item = Result<StorageAdminRequest, fidl::Error>;
7177
7178    fn poll_next(
7179        mut self: std::pin::Pin<&mut Self>,
7180        cx: &mut std::task::Context<'_>,
7181    ) -> std::task::Poll<Option<Self::Item>> {
7182        let this = &mut *self;
7183        if this.inner.check_shutdown(cx) {
7184            this.is_terminated = true;
7185            return std::task::Poll::Ready(None);
7186        }
7187        if this.is_terminated {
7188            panic!("polled StorageAdminRequestStream after completion");
7189        }
7190        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7191            |bytes, handles| {
7192                match this.inner.channel().read_etc(cx, bytes, handles) {
7193                    std::task::Poll::Ready(Ok(())) => {}
7194                    std::task::Poll::Pending => return std::task::Poll::Pending,
7195                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7196                        this.is_terminated = true;
7197                        return std::task::Poll::Ready(None);
7198                    }
7199                    std::task::Poll::Ready(Err(e)) => {
7200                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7201                            e.into(),
7202                        ))));
7203                    }
7204                }
7205
7206                // A message has been received from the channel
7207                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7208
7209                std::task::Poll::Ready(Some(match header.ordinal {
7210                    0x6ceaa5904cfe4377 => {
7211                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7212                        let mut req = fidl::new_empty!(
7213                            StorageAdminOpenStorageRequest,
7214                            fidl::encoding::DefaultFuchsiaResourceDialect
7215                        );
7216                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminOpenStorageRequest>(&header, _body_bytes, handles, &mut req)?;
7217                        let control_handle =
7218                            StorageAdminControlHandle { inner: this.inner.clone() };
7219                        Ok(StorageAdminRequest::OpenStorage {
7220                            relative_moniker: req.relative_moniker,
7221                            object: req.object,
7222
7223                            responder: StorageAdminOpenStorageResponder {
7224                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7225                                tx_id: header.tx_id,
7226                            },
7227                        })
7228                    }
7229                    0x764f6d1f083e8bfb => {
7230                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7231                        let mut req = fidl::new_empty!(
7232                            StorageAdminListStorageInRealmRequest,
7233                            fidl::encoding::DefaultFuchsiaResourceDialect
7234                        );
7235                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminListStorageInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
7236                        let control_handle =
7237                            StorageAdminControlHandle { inner: this.inner.clone() };
7238                        Ok(StorageAdminRequest::ListStorageInRealm {
7239                            relative_moniker: req.relative_moniker,
7240                            iterator: req.iterator,
7241
7242                            responder: StorageAdminListStorageInRealmResponder {
7243                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7244                                tx_id: header.tx_id,
7245                            },
7246                        })
7247                    }
7248                    0x4802102cc55d5df1 => {
7249                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7250                        let mut req = fidl::new_empty!(
7251                            StorageAdminOpenComponentStorageByIdRequest,
7252                            fidl::encoding::DefaultFuchsiaResourceDialect
7253                        );
7254                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminOpenComponentStorageByIdRequest>(&header, _body_bytes, handles, &mut req)?;
7255                        let control_handle =
7256                            StorageAdminControlHandle { inner: this.inner.clone() };
7257                        Ok(StorageAdminRequest::OpenComponentStorageById {
7258                            id: req.id,
7259                            object: req.object,
7260
7261                            responder: StorageAdminOpenComponentStorageByIdResponder {
7262                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7263                                tx_id: header.tx_id,
7264                            },
7265                        })
7266                    }
7267                    0x1677c1cdfcdbf45a => {
7268                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7269                        let mut req = fidl::new_empty!(
7270                            StorageAdminDeleteComponentStorageRequest,
7271                            fidl::encoding::DefaultFuchsiaResourceDialect
7272                        );
7273                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminDeleteComponentStorageRequest>(&header, _body_bytes, handles, &mut req)?;
7274                        let control_handle =
7275                            StorageAdminControlHandle { inner: this.inner.clone() };
7276                        Ok(StorageAdminRequest::DeleteComponentStorage {
7277                            relative_moniker: req.relative_moniker,
7278
7279                            responder: StorageAdminDeleteComponentStorageResponder {
7280                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7281                                tx_id: header.tx_id,
7282                            },
7283                        })
7284                    }
7285                    0x7729e325a6c526c8 => {
7286                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7287                        let mut req = fidl::new_empty!(
7288                            fidl::encoding::EmptyPayload,
7289                            fidl::encoding::DefaultFuchsiaResourceDialect
7290                        );
7291                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7292                        let control_handle =
7293                            StorageAdminControlHandle { inner: this.inner.clone() };
7294                        Ok(StorageAdminRequest::GetStatus {
7295                            responder: StorageAdminGetStatusResponder {
7296                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7297                                tx_id: header.tx_id,
7298                            },
7299                        })
7300                    }
7301                    0x2ee980b4b2d24adb => {
7302                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7303                        let mut req = fidl::new_empty!(
7304                            fidl::encoding::EmptyPayload,
7305                            fidl::encoding::DefaultFuchsiaResourceDialect
7306                        );
7307                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7308                        let control_handle =
7309                            StorageAdminControlHandle { inner: this.inner.clone() };
7310                        Ok(StorageAdminRequest::DeleteAllStorageContents {
7311                            responder: StorageAdminDeleteAllStorageContentsResponder {
7312                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7313                                tx_id: header.tx_id,
7314                            },
7315                        })
7316                    }
7317                    _ => Err(fidl::Error::UnknownOrdinal {
7318                        ordinal: header.ordinal,
7319                        protocol_name:
7320                            <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7321                    }),
7322                }))
7323            },
7324        )
7325    }
7326}
7327
7328#[derive(Debug)]
7329pub enum StorageAdminRequest {
7330    /// Opens the isolated directory for the given component. The provided
7331    /// moniker is relative to the component that declares the storage
7332    /// capability. Creates the backing sub-directory for this storage if it
7333    /// hasn't yet been created.
7334    OpenStorage {
7335        relative_moniker: String,
7336        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7337        responder: StorageAdminOpenStorageResponder,
7338    },
7339    /// Lists the descendant components under the specified realm that use the
7340    /// storage capability. The provided moniker is relative to the component
7341    /// that declares the storage capability.
7342    ///
7343    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
7344    /// if |relative_moniker| is malformed.
7345    ListStorageInRealm {
7346        relative_moniker: String,
7347        iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7348        responder: StorageAdminListStorageInRealmResponder,
7349    },
7350    /// Opens the isolated directory for the given storage ID. Creates the
7351    /// backing sub-directory for this storage if it hasn't yet been created.
7352    OpenComponentStorageById {
7353        id: String,
7354        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7355        responder: StorageAdminOpenComponentStorageByIdResponder,
7356    },
7357    /// Deletes the contents of the storage for this component. Preserves the
7358    /// component's subdirectory itself within the storage backing directory.
7359    /// The provided moniker is relative to the component that declares the
7360    /// storage capability.
7361    DeleteComponentStorage {
7362        relative_moniker: String,
7363        responder: StorageAdminDeleteComponentStorageResponder,
7364    },
7365    /// Get the current status of the storage.
7366    GetStatus { responder: StorageAdminGetStatusResponder },
7367    /// Deletes the contents of all the storage. Storage directories are
7368    /// retained so any components using storage will be able to continue using
7369    /// it to create new files and directories.
7370    ///
7371    /// Returns Error::INTERNAL only if no storage at all could be cleared.
7372    /// Returns successfully even if some errors happen during the deletion
7373    /// progress.
7374    DeleteAllStorageContents { responder: StorageAdminDeleteAllStorageContentsResponder },
7375}
7376
7377impl StorageAdminRequest {
7378    #[allow(irrefutable_let_patterns)]
7379    pub fn into_open_storage(
7380        self,
7381    ) -> Option<(
7382        String,
7383        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7384        StorageAdminOpenStorageResponder,
7385    )> {
7386        if let StorageAdminRequest::OpenStorage { relative_moniker, object, responder } = self {
7387            Some((relative_moniker, object, responder))
7388        } else {
7389            None
7390        }
7391    }
7392
7393    #[allow(irrefutable_let_patterns)]
7394    pub fn into_list_storage_in_realm(
7395        self,
7396    ) -> Option<(
7397        String,
7398        fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7399        StorageAdminListStorageInRealmResponder,
7400    )> {
7401        if let StorageAdminRequest::ListStorageInRealm { relative_moniker, iterator, responder } =
7402            self
7403        {
7404            Some((relative_moniker, iterator, responder))
7405        } else {
7406            None
7407        }
7408    }
7409
7410    #[allow(irrefutable_let_patterns)]
7411    pub fn into_open_component_storage_by_id(
7412        self,
7413    ) -> Option<(
7414        String,
7415        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7416        StorageAdminOpenComponentStorageByIdResponder,
7417    )> {
7418        if let StorageAdminRequest::OpenComponentStorageById { id, object, responder } = self {
7419            Some((id, object, responder))
7420        } else {
7421            None
7422        }
7423    }
7424
7425    #[allow(irrefutable_let_patterns)]
7426    pub fn into_delete_component_storage(
7427        self,
7428    ) -> Option<(String, StorageAdminDeleteComponentStorageResponder)> {
7429        if let StorageAdminRequest::DeleteComponentStorage { relative_moniker, responder } = self {
7430            Some((relative_moniker, responder))
7431        } else {
7432            None
7433        }
7434    }
7435
7436    #[allow(irrefutable_let_patterns)]
7437    pub fn into_get_status(self) -> Option<(StorageAdminGetStatusResponder)> {
7438        if let StorageAdminRequest::GetStatus { responder } = self {
7439            Some((responder))
7440        } else {
7441            None
7442        }
7443    }
7444
7445    #[allow(irrefutable_let_patterns)]
7446    pub fn into_delete_all_storage_contents(
7447        self,
7448    ) -> Option<(StorageAdminDeleteAllStorageContentsResponder)> {
7449        if let StorageAdminRequest::DeleteAllStorageContents { responder } = self {
7450            Some((responder))
7451        } else {
7452            None
7453        }
7454    }
7455
7456    /// Name of the method defined in FIDL
7457    pub fn method_name(&self) -> &'static str {
7458        match *self {
7459            StorageAdminRequest::OpenStorage { .. } => "open_storage",
7460            StorageAdminRequest::ListStorageInRealm { .. } => "list_storage_in_realm",
7461            StorageAdminRequest::OpenComponentStorageById { .. } => "open_component_storage_by_id",
7462            StorageAdminRequest::DeleteComponentStorage { .. } => "delete_component_storage",
7463            StorageAdminRequest::GetStatus { .. } => "get_status",
7464            StorageAdminRequest::DeleteAllStorageContents { .. } => "delete_all_storage_contents",
7465        }
7466    }
7467}
7468
7469#[derive(Debug, Clone)]
7470pub struct StorageAdminControlHandle {
7471    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7472}
7473
7474impl fidl::endpoints::ControlHandle for StorageAdminControlHandle {
7475    fn shutdown(&self) {
7476        self.inner.shutdown()
7477    }
7478
7479    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7480        self.inner.shutdown_with_epitaph(status)
7481    }
7482
7483    fn is_closed(&self) -> bool {
7484        self.inner.channel().is_closed()
7485    }
7486    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7487        self.inner.channel().on_closed()
7488    }
7489
7490    #[cfg(target_os = "fuchsia")]
7491    fn signal_peer(
7492        &self,
7493        clear_mask: zx::Signals,
7494        set_mask: zx::Signals,
7495    ) -> Result<(), zx_status::Status> {
7496        use fidl::Peered;
7497        self.inner.channel().signal_peer(clear_mask, set_mask)
7498    }
7499}
7500
7501impl StorageAdminControlHandle {}
7502
7503#[must_use = "FIDL methods require a response to be sent"]
7504#[derive(Debug)]
7505pub struct StorageAdminOpenStorageResponder {
7506    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7507    tx_id: u32,
7508}
7509
7510/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7511/// if the responder is dropped without sending a response, so that the client
7512/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7513impl std::ops::Drop for StorageAdminOpenStorageResponder {
7514    fn drop(&mut self) {
7515        self.control_handle.shutdown();
7516        // Safety: drops once, never accessed again
7517        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7518    }
7519}
7520
7521impl fidl::endpoints::Responder for StorageAdminOpenStorageResponder {
7522    type ControlHandle = StorageAdminControlHandle;
7523
7524    fn control_handle(&self) -> &StorageAdminControlHandle {
7525        &self.control_handle
7526    }
7527
7528    fn drop_without_shutdown(mut self) {
7529        // Safety: drops once, never accessed again due to mem::forget
7530        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7531        // Prevent Drop from running (which would shut down the channel)
7532        std::mem::forget(self);
7533    }
7534}
7535
7536impl StorageAdminOpenStorageResponder {
7537    /// Sends a response to the FIDL transaction.
7538    ///
7539    /// Sets the channel to shutdown if an error occurs.
7540    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7541        let _result = self.send_raw(result);
7542        if _result.is_err() {
7543            self.control_handle.shutdown();
7544        }
7545        self.drop_without_shutdown();
7546        _result
7547    }
7548
7549    /// Similar to "send" but does not shutdown the channel if an error occurs.
7550    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7551        let _result = self.send_raw(result);
7552        self.drop_without_shutdown();
7553        _result
7554    }
7555
7556    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7557        self.control_handle
7558            .inner
7559            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
7560                result,
7561                self.tx_id,
7562                0x6ceaa5904cfe4377,
7563                fidl::encoding::DynamicFlags::empty(),
7564            )
7565    }
7566}
7567
7568#[must_use = "FIDL methods require a response to be sent"]
7569#[derive(Debug)]
7570pub struct StorageAdminListStorageInRealmResponder {
7571    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7572    tx_id: u32,
7573}
7574
7575/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7576/// if the responder is dropped without sending a response, so that the client
7577/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7578impl std::ops::Drop for StorageAdminListStorageInRealmResponder {
7579    fn drop(&mut self) {
7580        self.control_handle.shutdown();
7581        // Safety: drops once, never accessed again
7582        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7583    }
7584}
7585
7586impl fidl::endpoints::Responder for StorageAdminListStorageInRealmResponder {
7587    type ControlHandle = StorageAdminControlHandle;
7588
7589    fn control_handle(&self) -> &StorageAdminControlHandle {
7590        &self.control_handle
7591    }
7592
7593    fn drop_without_shutdown(mut self) {
7594        // Safety: drops once, never accessed again due to mem::forget
7595        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7596        // Prevent Drop from running (which would shut down the channel)
7597        std::mem::forget(self);
7598    }
7599}
7600
7601impl StorageAdminListStorageInRealmResponder {
7602    /// Sends a response to the FIDL transaction.
7603    ///
7604    /// Sets the channel to shutdown if an error occurs.
7605    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7606        let _result = self.send_raw(result);
7607        if _result.is_err() {
7608            self.control_handle.shutdown();
7609        }
7610        self.drop_without_shutdown();
7611        _result
7612    }
7613
7614    /// Similar to "send" but does not shutdown the channel if an error occurs.
7615    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7616        let _result = self.send_raw(result);
7617        self.drop_without_shutdown();
7618        _result
7619    }
7620
7621    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7622        self.control_handle
7623            .inner
7624            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
7625                result,
7626                self.tx_id,
7627                0x764f6d1f083e8bfb,
7628                fidl::encoding::DynamicFlags::empty(),
7629            )
7630    }
7631}
7632
7633#[must_use = "FIDL methods require a response to be sent"]
7634#[derive(Debug)]
7635pub struct StorageAdminOpenComponentStorageByIdResponder {
7636    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7637    tx_id: u32,
7638}
7639
7640/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7641/// if the responder is dropped without sending a response, so that the client
7642/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7643impl std::ops::Drop for StorageAdminOpenComponentStorageByIdResponder {
7644    fn drop(&mut self) {
7645        self.control_handle.shutdown();
7646        // Safety: drops once, never accessed again
7647        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7648    }
7649}
7650
7651impl fidl::endpoints::Responder for StorageAdminOpenComponentStorageByIdResponder {
7652    type ControlHandle = StorageAdminControlHandle;
7653
7654    fn control_handle(&self) -> &StorageAdminControlHandle {
7655        &self.control_handle
7656    }
7657
7658    fn drop_without_shutdown(mut self) {
7659        // Safety: drops once, never accessed again due to mem::forget
7660        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7661        // Prevent Drop from running (which would shut down the channel)
7662        std::mem::forget(self);
7663    }
7664}
7665
7666impl StorageAdminOpenComponentStorageByIdResponder {
7667    /// Sends a response to the FIDL transaction.
7668    ///
7669    /// Sets the channel to shutdown if an error occurs.
7670    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7671        let _result = self.send_raw(result);
7672        if _result.is_err() {
7673            self.control_handle.shutdown();
7674        }
7675        self.drop_without_shutdown();
7676        _result
7677    }
7678
7679    /// Similar to "send" but does not shutdown the channel if an error occurs.
7680    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7681        let _result = self.send_raw(result);
7682        self.drop_without_shutdown();
7683        _result
7684    }
7685
7686    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7687        self.control_handle
7688            .inner
7689            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
7690                result,
7691                self.tx_id,
7692                0x4802102cc55d5df1,
7693                fidl::encoding::DynamicFlags::empty(),
7694            )
7695    }
7696}
7697
7698#[must_use = "FIDL methods require a response to be sent"]
7699#[derive(Debug)]
7700pub struct StorageAdminDeleteComponentStorageResponder {
7701    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7702    tx_id: u32,
7703}
7704
7705/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7706/// if the responder is dropped without sending a response, so that the client
7707/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7708impl std::ops::Drop for StorageAdminDeleteComponentStorageResponder {
7709    fn drop(&mut self) {
7710        self.control_handle.shutdown();
7711        // Safety: drops once, never accessed again
7712        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7713    }
7714}
7715
7716impl fidl::endpoints::Responder for StorageAdminDeleteComponentStorageResponder {
7717    type ControlHandle = StorageAdminControlHandle;
7718
7719    fn control_handle(&self) -> &StorageAdminControlHandle {
7720        &self.control_handle
7721    }
7722
7723    fn drop_without_shutdown(mut self) {
7724        // Safety: drops once, never accessed again due to mem::forget
7725        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7726        // Prevent Drop from running (which would shut down the channel)
7727        std::mem::forget(self);
7728    }
7729}
7730
7731impl StorageAdminDeleteComponentStorageResponder {
7732    /// Sends a response to the FIDL transaction.
7733    ///
7734    /// Sets the channel to shutdown if an error occurs.
7735    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7736        let _result = self.send_raw(result);
7737        if _result.is_err() {
7738            self.control_handle.shutdown();
7739        }
7740        self.drop_without_shutdown();
7741        _result
7742    }
7743
7744    /// Similar to "send" but does not shutdown the channel if an error occurs.
7745    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7746        let _result = self.send_raw(result);
7747        self.drop_without_shutdown();
7748        _result
7749    }
7750
7751    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7752        self.control_handle
7753            .inner
7754            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
7755                result,
7756                self.tx_id,
7757                0x1677c1cdfcdbf45a,
7758                fidl::encoding::DynamicFlags::empty(),
7759            )
7760    }
7761}
7762
7763#[must_use = "FIDL methods require a response to be sent"]
7764#[derive(Debug)]
7765pub struct StorageAdminGetStatusResponder {
7766    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7767    tx_id: u32,
7768}
7769
7770/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7771/// if the responder is dropped without sending a response, so that the client
7772/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7773impl std::ops::Drop for StorageAdminGetStatusResponder {
7774    fn drop(&mut self) {
7775        self.control_handle.shutdown();
7776        // Safety: drops once, never accessed again
7777        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7778    }
7779}
7780
7781impl fidl::endpoints::Responder for StorageAdminGetStatusResponder {
7782    type ControlHandle = StorageAdminControlHandle;
7783
7784    fn control_handle(&self) -> &StorageAdminControlHandle {
7785        &self.control_handle
7786    }
7787
7788    fn drop_without_shutdown(mut self) {
7789        // Safety: drops once, never accessed again due to mem::forget
7790        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7791        // Prevent Drop from running (which would shut down the channel)
7792        std::mem::forget(self);
7793    }
7794}
7795
7796impl StorageAdminGetStatusResponder {
7797    /// Sends a response to the FIDL transaction.
7798    ///
7799    /// Sets the channel to shutdown if an error occurs.
7800    pub fn send(self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
7801        let _result = self.send_raw(result);
7802        if _result.is_err() {
7803            self.control_handle.shutdown();
7804        }
7805        self.drop_without_shutdown();
7806        _result
7807    }
7808
7809    /// Similar to "send" but does not shutdown the channel if an error occurs.
7810    pub fn send_no_shutdown_on_err(
7811        self,
7812        mut result: Result<&StorageStatus, StatusError>,
7813    ) -> Result<(), fidl::Error> {
7814        let _result = self.send_raw(result);
7815        self.drop_without_shutdown();
7816        _result
7817    }
7818
7819    fn send_raw(&self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
7820        self.control_handle.inner.send::<fidl::encoding::ResultType<StorageStatus, StatusError>>(
7821            result,
7822            self.tx_id,
7823            0x7729e325a6c526c8,
7824            fidl::encoding::DynamicFlags::empty(),
7825        )
7826    }
7827}
7828
7829#[must_use = "FIDL methods require a response to be sent"]
7830#[derive(Debug)]
7831pub struct StorageAdminDeleteAllStorageContentsResponder {
7832    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7833    tx_id: u32,
7834}
7835
7836/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7837/// if the responder is dropped without sending a response, so that the client
7838/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7839impl std::ops::Drop for StorageAdminDeleteAllStorageContentsResponder {
7840    fn drop(&mut self) {
7841        self.control_handle.shutdown();
7842        // Safety: drops once, never accessed again
7843        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7844    }
7845}
7846
7847impl fidl::endpoints::Responder for StorageAdminDeleteAllStorageContentsResponder {
7848    type ControlHandle = StorageAdminControlHandle;
7849
7850    fn control_handle(&self) -> &StorageAdminControlHandle {
7851        &self.control_handle
7852    }
7853
7854    fn drop_without_shutdown(mut self) {
7855        // Safety: drops once, never accessed again due to mem::forget
7856        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7857        // Prevent Drop from running (which would shut down the channel)
7858        std::mem::forget(self);
7859    }
7860}
7861
7862impl StorageAdminDeleteAllStorageContentsResponder {
7863    /// Sends a response to the FIDL transaction.
7864    ///
7865    /// Sets the channel to shutdown if an error occurs.
7866    pub fn send(self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
7867        let _result = self.send_raw(result);
7868        if _result.is_err() {
7869            self.control_handle.shutdown();
7870        }
7871        self.drop_without_shutdown();
7872        _result
7873    }
7874
7875    /// Similar to "send" but does not shutdown the channel if an error occurs.
7876    pub fn send_no_shutdown_on_err(
7877        self,
7878        mut result: Result<(), DeletionError>,
7879    ) -> Result<(), fidl::Error> {
7880        let _result = self.send_raw(result);
7881        self.drop_without_shutdown();
7882        _result
7883    }
7884
7885    fn send_raw(&self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
7886        self.control_handle.inner.send::<fidl::encoding::ResultType<
7887            fidl::encoding::EmptyStruct,
7888            DeletionError,
7889        >>(
7890            result,
7891            self.tx_id,
7892            0x2ee980b4b2d24adb,
7893            fidl::encoding::DynamicFlags::empty(),
7894        )
7895    }
7896}
7897
7898#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
7899pub struct StorageIteratorMarker;
7900
7901impl fidl::endpoints::ProtocolMarker for StorageIteratorMarker {
7902    type Proxy = StorageIteratorProxy;
7903    type RequestStream = StorageIteratorRequestStream;
7904    #[cfg(target_os = "fuchsia")]
7905    type SynchronousProxy = StorageIteratorSynchronousProxy;
7906
7907    const DEBUG_NAME: &'static str = "(anonymous) StorageIterator";
7908}
7909
7910pub trait StorageIteratorProxyInterface: Send + Sync {
7911    type NextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
7912    fn r#next(&self) -> Self::NextResponseFut;
7913}
7914#[derive(Debug)]
7915#[cfg(target_os = "fuchsia")]
7916pub struct StorageIteratorSynchronousProxy {
7917    client: fidl::client::sync::Client,
7918}
7919
7920#[cfg(target_os = "fuchsia")]
7921impl fidl::endpoints::SynchronousProxy for StorageIteratorSynchronousProxy {
7922    type Proxy = StorageIteratorProxy;
7923    type Protocol = StorageIteratorMarker;
7924
7925    fn from_channel(inner: fidl::Channel) -> Self {
7926        Self::new(inner)
7927    }
7928
7929    fn into_channel(self) -> fidl::Channel {
7930        self.client.into_channel()
7931    }
7932
7933    fn as_channel(&self) -> &fidl::Channel {
7934        self.client.as_channel()
7935    }
7936}
7937
7938#[cfg(target_os = "fuchsia")]
7939impl StorageIteratorSynchronousProxy {
7940    pub fn new(channel: fidl::Channel) -> Self {
7941        let protocol_name = <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7942        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
7943    }
7944
7945    pub fn into_channel(self) -> fidl::Channel {
7946        self.client.into_channel()
7947    }
7948
7949    /// Waits until an event arrives and returns it. It is safe for other
7950    /// threads to make concurrent requests while waiting for an event.
7951    pub fn wait_for_event(
7952        &self,
7953        deadline: zx::MonotonicInstant,
7954    ) -> Result<StorageIteratorEvent, fidl::Error> {
7955        StorageIteratorEvent::decode(self.client.wait_for_event(deadline)?)
7956    }
7957
7958    /// Retrieve the next set of components using the storage capability. The
7959    /// returned monikers are relative to the component that declares the
7960    /// storage capability. Returns an empty vector after all components have
7961    /// been returned.
7962    pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<String>, fidl::Error> {
7963        let _response =
7964            self.client.send_query::<fidl::encoding::EmptyPayload, StorageIteratorNextResponse>(
7965                (),
7966                0x7a6b21f15fd01b72,
7967                fidl::encoding::DynamicFlags::empty(),
7968                ___deadline,
7969            )?;
7970        Ok(_response.relative_monikers)
7971    }
7972}
7973
7974#[cfg(target_os = "fuchsia")]
7975impl From<StorageIteratorSynchronousProxy> for zx::NullableHandle {
7976    fn from(value: StorageIteratorSynchronousProxy) -> Self {
7977        value.into_channel().into()
7978    }
7979}
7980
7981#[cfg(target_os = "fuchsia")]
7982impl From<fidl::Channel> for StorageIteratorSynchronousProxy {
7983    fn from(value: fidl::Channel) -> Self {
7984        Self::new(value)
7985    }
7986}
7987
7988#[cfg(target_os = "fuchsia")]
7989impl fidl::endpoints::FromClient for StorageIteratorSynchronousProxy {
7990    type Protocol = StorageIteratorMarker;
7991
7992    fn from_client(value: fidl::endpoints::ClientEnd<StorageIteratorMarker>) -> Self {
7993        Self::new(value.into_channel())
7994    }
7995}
7996
7997#[derive(Debug, Clone)]
7998pub struct StorageIteratorProxy {
7999    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8000}
8001
8002impl fidl::endpoints::Proxy for StorageIteratorProxy {
8003    type Protocol = StorageIteratorMarker;
8004
8005    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8006        Self::new(inner)
8007    }
8008
8009    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8010        self.client.into_channel().map_err(|client| Self { client })
8011    }
8012
8013    fn as_channel(&self) -> &::fidl::AsyncChannel {
8014        self.client.as_channel()
8015    }
8016}
8017
8018impl StorageIteratorProxy {
8019    /// Create a new Proxy for fuchsia.component/StorageIterator.
8020    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8021        let protocol_name = <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8022        Self { client: fidl::client::Client::new(channel, protocol_name) }
8023    }
8024
8025    /// Get a Stream of events from the remote end of the protocol.
8026    ///
8027    /// # Panics
8028    ///
8029    /// Panics if the event stream was already taken.
8030    pub fn take_event_stream(&self) -> StorageIteratorEventStream {
8031        StorageIteratorEventStream { event_receiver: self.client.take_event_receiver() }
8032    }
8033
8034    /// Retrieve the next set of components using the storage capability. The
8035    /// returned monikers are relative to the component that declares the
8036    /// storage capability. Returns an empty vector after all components have
8037    /// been returned.
8038    pub fn r#next(
8039        &self,
8040    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
8041    {
8042        StorageIteratorProxyInterface::r#next(self)
8043    }
8044}
8045
8046impl StorageIteratorProxyInterface for StorageIteratorProxy {
8047    type NextResponseFut =
8048        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8049    fn r#next(&self) -> Self::NextResponseFut {
8050        fn _decode(
8051            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8052        ) -> Result<Vec<String>, fidl::Error> {
8053            let _response = fidl::client::decode_transaction_body::<
8054                StorageIteratorNextResponse,
8055                fidl::encoding::DefaultFuchsiaResourceDialect,
8056                0x7a6b21f15fd01b72,
8057            >(_buf?)?;
8058            Ok(_response.relative_monikers)
8059        }
8060        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
8061            (),
8062            0x7a6b21f15fd01b72,
8063            fidl::encoding::DynamicFlags::empty(),
8064            _decode,
8065        )
8066    }
8067}
8068
8069pub struct StorageIteratorEventStream {
8070    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8071}
8072
8073impl std::marker::Unpin for StorageIteratorEventStream {}
8074
8075impl futures::stream::FusedStream for StorageIteratorEventStream {
8076    fn is_terminated(&self) -> bool {
8077        self.event_receiver.is_terminated()
8078    }
8079}
8080
8081impl futures::Stream for StorageIteratorEventStream {
8082    type Item = Result<StorageIteratorEvent, fidl::Error>;
8083
8084    fn poll_next(
8085        mut self: std::pin::Pin<&mut Self>,
8086        cx: &mut std::task::Context<'_>,
8087    ) -> std::task::Poll<Option<Self::Item>> {
8088        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8089            &mut self.event_receiver,
8090            cx
8091        )?) {
8092            Some(buf) => std::task::Poll::Ready(Some(StorageIteratorEvent::decode(buf))),
8093            None => std::task::Poll::Ready(None),
8094        }
8095    }
8096}
8097
8098#[derive(Debug)]
8099pub enum StorageIteratorEvent {}
8100
8101impl StorageIteratorEvent {
8102    /// Decodes a message buffer as a [`StorageIteratorEvent`].
8103    fn decode(
8104        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8105    ) -> Result<StorageIteratorEvent, fidl::Error> {
8106        let (bytes, _handles) = buf.split_mut();
8107        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8108        debug_assert_eq!(tx_header.tx_id, 0);
8109        match tx_header.ordinal {
8110            _ => Err(fidl::Error::UnknownOrdinal {
8111                ordinal: tx_header.ordinal,
8112                protocol_name:
8113                    <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8114            }),
8115        }
8116    }
8117}
8118
8119/// A Stream of incoming requests for fuchsia.component/StorageIterator.
8120pub struct StorageIteratorRequestStream {
8121    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8122    is_terminated: bool,
8123}
8124
8125impl std::marker::Unpin for StorageIteratorRequestStream {}
8126
8127impl futures::stream::FusedStream for StorageIteratorRequestStream {
8128    fn is_terminated(&self) -> bool {
8129        self.is_terminated
8130    }
8131}
8132
8133impl fidl::endpoints::RequestStream for StorageIteratorRequestStream {
8134    type Protocol = StorageIteratorMarker;
8135    type ControlHandle = StorageIteratorControlHandle;
8136
8137    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8138        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8139    }
8140
8141    fn control_handle(&self) -> Self::ControlHandle {
8142        StorageIteratorControlHandle { inner: self.inner.clone() }
8143    }
8144
8145    fn into_inner(
8146        self,
8147    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8148    {
8149        (self.inner, self.is_terminated)
8150    }
8151
8152    fn from_inner(
8153        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8154        is_terminated: bool,
8155    ) -> Self {
8156        Self { inner, is_terminated }
8157    }
8158}
8159
8160impl futures::Stream for StorageIteratorRequestStream {
8161    type Item = Result<StorageIteratorRequest, fidl::Error>;
8162
8163    fn poll_next(
8164        mut self: std::pin::Pin<&mut Self>,
8165        cx: &mut std::task::Context<'_>,
8166    ) -> std::task::Poll<Option<Self::Item>> {
8167        let this = &mut *self;
8168        if this.inner.check_shutdown(cx) {
8169            this.is_terminated = true;
8170            return std::task::Poll::Ready(None);
8171        }
8172        if this.is_terminated {
8173            panic!("polled StorageIteratorRequestStream after completion");
8174        }
8175        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8176            |bytes, handles| {
8177                match this.inner.channel().read_etc(cx, bytes, handles) {
8178                    std::task::Poll::Ready(Ok(())) => {}
8179                    std::task::Poll::Pending => return std::task::Poll::Pending,
8180                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8181                        this.is_terminated = true;
8182                        return std::task::Poll::Ready(None);
8183                    }
8184                    std::task::Poll::Ready(Err(e)) => {
8185                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8186                            e.into(),
8187                        ))));
8188                    }
8189                }
8190
8191                // A message has been received from the channel
8192                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8193
8194                std::task::Poll::Ready(Some(match header.ordinal {
8195                    0x7a6b21f15fd01b72 => {
8196                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8197                        let mut req = fidl::new_empty!(
8198                            fidl::encoding::EmptyPayload,
8199                            fidl::encoding::DefaultFuchsiaResourceDialect
8200                        );
8201                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8202                        let control_handle =
8203                            StorageIteratorControlHandle { inner: this.inner.clone() };
8204                        Ok(StorageIteratorRequest::Next {
8205                            responder: StorageIteratorNextResponder {
8206                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8207                                tx_id: header.tx_id,
8208                            },
8209                        })
8210                    }
8211                    _ => Err(fidl::Error::UnknownOrdinal {
8212                        ordinal: header.ordinal,
8213                        protocol_name:
8214                            <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8215                    }),
8216                }))
8217            },
8218        )
8219    }
8220}
8221
8222/// An iterator protocol for returning a set of components using a storage
8223/// capability. See |StorageAdmin.ListStorageInRealm| for more information.
8224#[derive(Debug)]
8225pub enum StorageIteratorRequest {
8226    /// Retrieve the next set of components using the storage capability. The
8227    /// returned monikers are relative to the component that declares the
8228    /// storage capability. Returns an empty vector after all components have
8229    /// been returned.
8230    Next { responder: StorageIteratorNextResponder },
8231}
8232
8233impl StorageIteratorRequest {
8234    #[allow(irrefutable_let_patterns)]
8235    pub fn into_next(self) -> Option<(StorageIteratorNextResponder)> {
8236        if let StorageIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
8237    }
8238
8239    /// Name of the method defined in FIDL
8240    pub fn method_name(&self) -> &'static str {
8241        match *self {
8242            StorageIteratorRequest::Next { .. } => "next",
8243        }
8244    }
8245}
8246
8247#[derive(Debug, Clone)]
8248pub struct StorageIteratorControlHandle {
8249    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8250}
8251
8252impl fidl::endpoints::ControlHandle for StorageIteratorControlHandle {
8253    fn shutdown(&self) {
8254        self.inner.shutdown()
8255    }
8256
8257    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8258        self.inner.shutdown_with_epitaph(status)
8259    }
8260
8261    fn is_closed(&self) -> bool {
8262        self.inner.channel().is_closed()
8263    }
8264    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8265        self.inner.channel().on_closed()
8266    }
8267
8268    #[cfg(target_os = "fuchsia")]
8269    fn signal_peer(
8270        &self,
8271        clear_mask: zx::Signals,
8272        set_mask: zx::Signals,
8273    ) -> Result<(), zx_status::Status> {
8274        use fidl::Peered;
8275        self.inner.channel().signal_peer(clear_mask, set_mask)
8276    }
8277}
8278
8279impl StorageIteratorControlHandle {}
8280
8281#[must_use = "FIDL methods require a response to be sent"]
8282#[derive(Debug)]
8283pub struct StorageIteratorNextResponder {
8284    control_handle: std::mem::ManuallyDrop<StorageIteratorControlHandle>,
8285    tx_id: u32,
8286}
8287
8288/// Set the the channel to be shutdown (see [`StorageIteratorControlHandle::shutdown`])
8289/// if the responder is dropped without sending a response, so that the client
8290/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8291impl std::ops::Drop for StorageIteratorNextResponder {
8292    fn drop(&mut self) {
8293        self.control_handle.shutdown();
8294        // Safety: drops once, never accessed again
8295        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8296    }
8297}
8298
8299impl fidl::endpoints::Responder for StorageIteratorNextResponder {
8300    type ControlHandle = StorageIteratorControlHandle;
8301
8302    fn control_handle(&self) -> &StorageIteratorControlHandle {
8303        &self.control_handle
8304    }
8305
8306    fn drop_without_shutdown(mut self) {
8307        // Safety: drops once, never accessed again due to mem::forget
8308        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8309        // Prevent Drop from running (which would shut down the channel)
8310        std::mem::forget(self);
8311    }
8312}
8313
8314impl StorageIteratorNextResponder {
8315    /// Sends a response to the FIDL transaction.
8316    ///
8317    /// Sets the channel to shutdown if an error occurs.
8318    pub fn send(self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
8319        let _result = self.send_raw(relative_monikers);
8320        if _result.is_err() {
8321            self.control_handle.shutdown();
8322        }
8323        self.drop_without_shutdown();
8324        _result
8325    }
8326
8327    /// Similar to "send" but does not shutdown the channel if an error occurs.
8328    pub fn send_no_shutdown_on_err(
8329        self,
8330        mut relative_monikers: &[String],
8331    ) -> Result<(), fidl::Error> {
8332        let _result = self.send_raw(relative_monikers);
8333        self.drop_without_shutdown();
8334        _result
8335    }
8336
8337    fn send_raw(&self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
8338        self.control_handle.inner.send::<StorageIteratorNextResponse>(
8339            (relative_monikers,),
8340            self.tx_id,
8341            0x7a6b21f15fd01b72,
8342            fidl::encoding::DynamicFlags::empty(),
8343        )
8344    }
8345}
8346
8347mod internal {
8348    use super::*;
8349
8350    impl fidl::encoding::ResourceTypeMarker for ControllerOpenExposedDirRequest {
8351        type Borrowed<'a> = &'a mut Self;
8352        fn take_or_borrow<'a>(
8353            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8354        ) -> Self::Borrowed<'a> {
8355            value
8356        }
8357    }
8358
8359    unsafe impl fidl::encoding::TypeMarker for ControllerOpenExposedDirRequest {
8360        type Owned = Self;
8361
8362        #[inline(always)]
8363        fn inline_align(_context: fidl::encoding::Context) -> usize {
8364            4
8365        }
8366
8367        #[inline(always)]
8368        fn inline_size(_context: fidl::encoding::Context) -> usize {
8369            4
8370        }
8371    }
8372
8373    unsafe impl
8374        fidl::encoding::Encode<
8375            ControllerOpenExposedDirRequest,
8376            fidl::encoding::DefaultFuchsiaResourceDialect,
8377        > for &mut ControllerOpenExposedDirRequest
8378    {
8379        #[inline]
8380        unsafe fn encode(
8381            self,
8382            encoder: &mut fidl::encoding::Encoder<
8383                '_,
8384                fidl::encoding::DefaultFuchsiaResourceDialect,
8385            >,
8386            offset: usize,
8387            _depth: fidl::encoding::Depth,
8388        ) -> fidl::Result<()> {
8389            encoder.debug_check_bounds::<ControllerOpenExposedDirRequest>(offset);
8390            // Delegate to tuple encoding.
8391            fidl::encoding::Encode::<
8392                ControllerOpenExposedDirRequest,
8393                fidl::encoding::DefaultFuchsiaResourceDialect,
8394            >::encode(
8395                (<fidl::encoding::Endpoint<
8396                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8397                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8398                    &mut self.exposed_dir
8399                ),),
8400                encoder,
8401                offset,
8402                _depth,
8403            )
8404        }
8405    }
8406    unsafe impl<
8407        T0: fidl::encoding::Encode<
8408                fidl::encoding::Endpoint<
8409                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8410                >,
8411                fidl::encoding::DefaultFuchsiaResourceDialect,
8412            >,
8413    >
8414        fidl::encoding::Encode<
8415            ControllerOpenExposedDirRequest,
8416            fidl::encoding::DefaultFuchsiaResourceDialect,
8417        > for (T0,)
8418    {
8419        #[inline]
8420        unsafe fn encode(
8421            self,
8422            encoder: &mut fidl::encoding::Encoder<
8423                '_,
8424                fidl::encoding::DefaultFuchsiaResourceDialect,
8425            >,
8426            offset: usize,
8427            depth: fidl::encoding::Depth,
8428        ) -> fidl::Result<()> {
8429            encoder.debug_check_bounds::<ControllerOpenExposedDirRequest>(offset);
8430            // Zero out padding regions. There's no need to apply masks
8431            // because the unmasked parts will be overwritten by fields.
8432            // Write the fields.
8433            self.0.encode(encoder, offset + 0, depth)?;
8434            Ok(())
8435        }
8436    }
8437
8438    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8439        for ControllerOpenExposedDirRequest
8440    {
8441        #[inline(always)]
8442        fn new_empty() -> Self {
8443            Self {
8444                exposed_dir: fidl::new_empty!(
8445                    fidl::encoding::Endpoint<
8446                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8447                    >,
8448                    fidl::encoding::DefaultFuchsiaResourceDialect
8449                ),
8450            }
8451        }
8452
8453        #[inline]
8454        unsafe fn decode(
8455            &mut self,
8456            decoder: &mut fidl::encoding::Decoder<
8457                '_,
8458                fidl::encoding::DefaultFuchsiaResourceDialect,
8459            >,
8460            offset: usize,
8461            _depth: fidl::encoding::Depth,
8462        ) -> fidl::Result<()> {
8463            decoder.debug_check_bounds::<Self>(offset);
8464            // Verify that padding bytes are zero.
8465            fidl::decode!(
8466                fidl::encoding::Endpoint<
8467                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8468                >,
8469                fidl::encoding::DefaultFuchsiaResourceDialect,
8470                &mut self.exposed_dir,
8471                decoder,
8472                offset + 0,
8473                _depth
8474            )?;
8475            Ok(())
8476        }
8477    }
8478
8479    impl fidl::encoding::ResourceTypeMarker for ControllerStartRequest {
8480        type Borrowed<'a> = &'a mut Self;
8481        fn take_or_borrow<'a>(
8482            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8483        ) -> Self::Borrowed<'a> {
8484            value
8485        }
8486    }
8487
8488    unsafe impl fidl::encoding::TypeMarker for ControllerStartRequest {
8489        type Owned = Self;
8490
8491        #[inline(always)]
8492        fn inline_align(_context: fidl::encoding::Context) -> usize {
8493            8
8494        }
8495
8496        #[inline(always)]
8497        fn inline_size(_context: fidl::encoding::Context) -> usize {
8498            24
8499        }
8500    }
8501
8502    unsafe impl
8503        fidl::encoding::Encode<
8504            ControllerStartRequest,
8505            fidl::encoding::DefaultFuchsiaResourceDialect,
8506        > for &mut ControllerStartRequest
8507    {
8508        #[inline]
8509        unsafe fn encode(
8510            self,
8511            encoder: &mut fidl::encoding::Encoder<
8512                '_,
8513                fidl::encoding::DefaultFuchsiaResourceDialect,
8514            >,
8515            offset: usize,
8516            _depth: fidl::encoding::Depth,
8517        ) -> fidl::Result<()> {
8518            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
8519            // Delegate to tuple encoding.
8520            fidl::encoding::Encode::<ControllerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8521                (
8522                    <StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
8523                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.execution_controller),
8524                ),
8525                encoder, offset, _depth
8526            )
8527        }
8528    }
8529    unsafe impl<
8530        T0: fidl::encoding::Encode<StartChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
8531        T1: fidl::encoding::Encode<
8532                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
8533                fidl::encoding::DefaultFuchsiaResourceDialect,
8534            >,
8535    >
8536        fidl::encoding::Encode<
8537            ControllerStartRequest,
8538            fidl::encoding::DefaultFuchsiaResourceDialect,
8539        > for (T0, T1)
8540    {
8541        #[inline]
8542        unsafe fn encode(
8543            self,
8544            encoder: &mut fidl::encoding::Encoder<
8545                '_,
8546                fidl::encoding::DefaultFuchsiaResourceDialect,
8547            >,
8548            offset: usize,
8549            depth: fidl::encoding::Depth,
8550        ) -> fidl::Result<()> {
8551            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
8552            // Zero out padding regions. There's no need to apply masks
8553            // because the unmasked parts will be overwritten by fields.
8554            unsafe {
8555                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8556                (ptr as *mut u64).write_unaligned(0);
8557            }
8558            // Write the fields.
8559            self.0.encode(encoder, offset + 0, depth)?;
8560            self.1.encode(encoder, offset + 16, depth)?;
8561            Ok(())
8562        }
8563    }
8564
8565    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8566        for ControllerStartRequest
8567    {
8568        #[inline(always)]
8569        fn new_empty() -> Self {
8570            Self {
8571                args: fidl::new_empty!(
8572                    StartChildArgs,
8573                    fidl::encoding::DefaultFuchsiaResourceDialect
8574                ),
8575                execution_controller: fidl::new_empty!(
8576                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
8577                    fidl::encoding::DefaultFuchsiaResourceDialect
8578                ),
8579            }
8580        }
8581
8582        #[inline]
8583        unsafe fn decode(
8584            &mut self,
8585            decoder: &mut fidl::encoding::Decoder<
8586                '_,
8587                fidl::encoding::DefaultFuchsiaResourceDialect,
8588            >,
8589            offset: usize,
8590            _depth: fidl::encoding::Depth,
8591        ) -> fidl::Result<()> {
8592            decoder.debug_check_bounds::<Self>(offset);
8593            // Verify that padding bytes are zero.
8594            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8595            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8596            let mask = 0xffffffff00000000u64;
8597            let maskedval = padval & mask;
8598            if maskedval != 0 {
8599                return Err(fidl::Error::NonZeroPadding {
8600                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8601                });
8602            }
8603            fidl::decode!(
8604                StartChildArgs,
8605                fidl::encoding::DefaultFuchsiaResourceDialect,
8606                &mut self.args,
8607                decoder,
8608                offset + 0,
8609                _depth
8610            )?;
8611            fidl::decode!(
8612                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
8613                fidl::encoding::DefaultFuchsiaResourceDialect,
8614                &mut self.execution_controller,
8615                decoder,
8616                offset + 16,
8617                _depth
8618            )?;
8619            Ok(())
8620        }
8621    }
8622
8623    impl fidl::encoding::ResourceTypeMarker for ControllerGetExposedDictionaryResponse {
8624        type Borrowed<'a> = &'a mut Self;
8625        fn take_or_borrow<'a>(
8626            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8627        ) -> Self::Borrowed<'a> {
8628            value
8629        }
8630    }
8631
8632    unsafe impl fidl::encoding::TypeMarker for ControllerGetExposedDictionaryResponse {
8633        type Owned = Self;
8634
8635        #[inline(always)]
8636        fn inline_align(_context: fidl::encoding::Context) -> usize {
8637            4
8638        }
8639
8640        #[inline(always)]
8641        fn inline_size(_context: fidl::encoding::Context) -> usize {
8642            4
8643        }
8644    }
8645
8646    unsafe impl
8647        fidl::encoding::Encode<
8648            ControllerGetExposedDictionaryResponse,
8649            fidl::encoding::DefaultFuchsiaResourceDialect,
8650        > for &mut ControllerGetExposedDictionaryResponse
8651    {
8652        #[inline]
8653        unsafe fn encode(
8654            self,
8655            encoder: &mut fidl::encoding::Encoder<
8656                '_,
8657                fidl::encoding::DefaultFuchsiaResourceDialect,
8658            >,
8659            offset: usize,
8660            _depth: fidl::encoding::Depth,
8661        ) -> fidl::Result<()> {
8662            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
8663            // Delegate to tuple encoding.
8664            fidl::encoding::Encode::<ControllerGetExposedDictionaryResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8665                (
8666                    <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
8667                ),
8668                encoder, offset, _depth
8669            )
8670        }
8671    }
8672    unsafe impl<
8673        T0: fidl::encoding::Encode<
8674                fidl_fuchsia_component_sandbox::DictionaryRef,
8675                fidl::encoding::DefaultFuchsiaResourceDialect,
8676            >,
8677    >
8678        fidl::encoding::Encode<
8679            ControllerGetExposedDictionaryResponse,
8680            fidl::encoding::DefaultFuchsiaResourceDialect,
8681        > for (T0,)
8682    {
8683        #[inline]
8684        unsafe fn encode(
8685            self,
8686            encoder: &mut fidl::encoding::Encoder<
8687                '_,
8688                fidl::encoding::DefaultFuchsiaResourceDialect,
8689            >,
8690            offset: usize,
8691            depth: fidl::encoding::Depth,
8692        ) -> fidl::Result<()> {
8693            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
8694            // Zero out padding regions. There's no need to apply masks
8695            // because the unmasked parts will be overwritten by fields.
8696            // Write the fields.
8697            self.0.encode(encoder, offset + 0, depth)?;
8698            Ok(())
8699        }
8700    }
8701
8702    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8703        for ControllerGetExposedDictionaryResponse
8704    {
8705        #[inline(always)]
8706        fn new_empty() -> Self {
8707            Self {
8708                dictionary: fidl::new_empty!(
8709                    fidl_fuchsia_component_sandbox::DictionaryRef,
8710                    fidl::encoding::DefaultFuchsiaResourceDialect
8711                ),
8712            }
8713        }
8714
8715        #[inline]
8716        unsafe fn decode(
8717            &mut self,
8718            decoder: &mut fidl::encoding::Decoder<
8719                '_,
8720                fidl::encoding::DefaultFuchsiaResourceDialect,
8721            >,
8722            offset: usize,
8723            _depth: fidl::encoding::Depth,
8724        ) -> fidl::Result<()> {
8725            decoder.debug_check_bounds::<Self>(offset);
8726            // Verify that padding bytes are zero.
8727            fidl::decode!(
8728                fidl_fuchsia_component_sandbox::DictionaryRef,
8729                fidl::encoding::DefaultFuchsiaResourceDialect,
8730                &mut self.dictionary,
8731                decoder,
8732                offset + 0,
8733                _depth
8734            )?;
8735            Ok(())
8736        }
8737    }
8738
8739    impl fidl::encoding::ResourceTypeMarker for ControllerGetOutputDictionaryResponse {
8740        type Borrowed<'a> = &'a mut Self;
8741        fn take_or_borrow<'a>(
8742            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8743        ) -> Self::Borrowed<'a> {
8744            value
8745        }
8746    }
8747
8748    unsafe impl fidl::encoding::TypeMarker for ControllerGetOutputDictionaryResponse {
8749        type Owned = Self;
8750
8751        #[inline(always)]
8752        fn inline_align(_context: fidl::encoding::Context) -> usize {
8753            4
8754        }
8755
8756        #[inline(always)]
8757        fn inline_size(_context: fidl::encoding::Context) -> usize {
8758            4
8759        }
8760    }
8761
8762    unsafe impl
8763        fidl::encoding::Encode<
8764            ControllerGetOutputDictionaryResponse,
8765            fidl::encoding::DefaultFuchsiaResourceDialect,
8766        > for &mut ControllerGetOutputDictionaryResponse
8767    {
8768        #[inline]
8769        unsafe fn encode(
8770            self,
8771            encoder: &mut fidl::encoding::Encoder<
8772                '_,
8773                fidl::encoding::DefaultFuchsiaResourceDialect,
8774            >,
8775            offset: usize,
8776            _depth: fidl::encoding::Depth,
8777        ) -> fidl::Result<()> {
8778            encoder.debug_check_bounds::<ControllerGetOutputDictionaryResponse>(offset);
8779            // Delegate to tuple encoding.
8780            fidl::encoding::Encode::<
8781                ControllerGetOutputDictionaryResponse,
8782                fidl::encoding::DefaultFuchsiaResourceDialect,
8783            >::encode(
8784                (<fidl::encoding::HandleType<
8785                    fidl::EventPair,
8786                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8787                    2147483648,
8788                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8789                    &mut self.dictionary
8790                ),),
8791                encoder,
8792                offset,
8793                _depth,
8794            )
8795        }
8796    }
8797    unsafe impl<
8798        T0: fidl::encoding::Encode<
8799                fidl::encoding::HandleType<
8800                    fidl::EventPair,
8801                    { fidl::ObjectType::EVENTPAIR.into_raw() },
8802                    2147483648,
8803                >,
8804                fidl::encoding::DefaultFuchsiaResourceDialect,
8805            >,
8806    >
8807        fidl::encoding::Encode<
8808            ControllerGetOutputDictionaryResponse,
8809            fidl::encoding::DefaultFuchsiaResourceDialect,
8810        > for (T0,)
8811    {
8812        #[inline]
8813        unsafe fn encode(
8814            self,
8815            encoder: &mut fidl::encoding::Encoder<
8816                '_,
8817                fidl::encoding::DefaultFuchsiaResourceDialect,
8818            >,
8819            offset: usize,
8820            depth: fidl::encoding::Depth,
8821        ) -> fidl::Result<()> {
8822            encoder.debug_check_bounds::<ControllerGetOutputDictionaryResponse>(offset);
8823            // Zero out padding regions. There's no need to apply masks
8824            // because the unmasked parts will be overwritten by fields.
8825            // Write the fields.
8826            self.0.encode(encoder, offset + 0, depth)?;
8827            Ok(())
8828        }
8829    }
8830
8831    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8832        for ControllerGetOutputDictionaryResponse
8833    {
8834        #[inline(always)]
8835        fn new_empty() -> Self {
8836            Self {
8837                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
8838            }
8839        }
8840
8841        #[inline]
8842        unsafe fn decode(
8843            &mut self,
8844            decoder: &mut fidl::encoding::Decoder<
8845                '_,
8846                fidl::encoding::DefaultFuchsiaResourceDialect,
8847            >,
8848            offset: usize,
8849            _depth: fidl::encoding::Depth,
8850        ) -> fidl::Result<()> {
8851            decoder.debug_check_bounds::<Self>(offset);
8852            // Verify that padding bytes are zero.
8853            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
8854            Ok(())
8855        }
8856    }
8857
8858    impl fidl::encoding::ResourceTypeMarker for ControllerIsStartedResponse {
8859        type Borrowed<'a> = &'a mut Self;
8860        fn take_or_borrow<'a>(
8861            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8862        ) -> Self::Borrowed<'a> {
8863            value
8864        }
8865    }
8866
8867    unsafe impl fidl::encoding::TypeMarker for ControllerIsStartedResponse {
8868        type Owned = Self;
8869
8870        #[inline(always)]
8871        fn inline_align(_context: fidl::encoding::Context) -> usize {
8872            1
8873        }
8874
8875        #[inline(always)]
8876        fn inline_size(_context: fidl::encoding::Context) -> usize {
8877            1
8878        }
8879    }
8880
8881    unsafe impl
8882        fidl::encoding::Encode<
8883            ControllerIsStartedResponse,
8884            fidl::encoding::DefaultFuchsiaResourceDialect,
8885        > for &mut ControllerIsStartedResponse
8886    {
8887        #[inline]
8888        unsafe fn encode(
8889            self,
8890            encoder: &mut fidl::encoding::Encoder<
8891                '_,
8892                fidl::encoding::DefaultFuchsiaResourceDialect,
8893            >,
8894            offset: usize,
8895            _depth: fidl::encoding::Depth,
8896        ) -> fidl::Result<()> {
8897            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
8898            // Delegate to tuple encoding.
8899            fidl::encoding::Encode::<
8900                ControllerIsStartedResponse,
8901                fidl::encoding::DefaultFuchsiaResourceDialect,
8902            >::encode(
8903                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_started),),
8904                encoder,
8905                offset,
8906                _depth,
8907            )
8908        }
8909    }
8910    unsafe impl<T0: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>>
8911        fidl::encoding::Encode<
8912            ControllerIsStartedResponse,
8913            fidl::encoding::DefaultFuchsiaResourceDialect,
8914        > for (T0,)
8915    {
8916        #[inline]
8917        unsafe fn encode(
8918            self,
8919            encoder: &mut fidl::encoding::Encoder<
8920                '_,
8921                fidl::encoding::DefaultFuchsiaResourceDialect,
8922            >,
8923            offset: usize,
8924            depth: fidl::encoding::Depth,
8925        ) -> fidl::Result<()> {
8926            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
8927            // Zero out padding regions. There's no need to apply masks
8928            // because the unmasked parts will be overwritten by fields.
8929            // Write the fields.
8930            self.0.encode(encoder, offset + 0, depth)?;
8931            Ok(())
8932        }
8933    }
8934
8935    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8936        for ControllerIsStartedResponse
8937    {
8938        #[inline(always)]
8939        fn new_empty() -> Self {
8940            Self {
8941                is_started: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
8942            }
8943        }
8944
8945        #[inline]
8946        unsafe fn decode(
8947            &mut self,
8948            decoder: &mut fidl::encoding::Decoder<
8949                '_,
8950                fidl::encoding::DefaultFuchsiaResourceDialect,
8951            >,
8952            offset: usize,
8953            _depth: fidl::encoding::Depth,
8954        ) -> fidl::Result<()> {
8955            decoder.debug_check_bounds::<Self>(offset);
8956            // Verify that padding bytes are zero.
8957            fidl::decode!(
8958                bool,
8959                fidl::encoding::DefaultFuchsiaResourceDialect,
8960                &mut self.is_started,
8961                decoder,
8962                offset + 0,
8963                _depth
8964            )?;
8965            Ok(())
8966        }
8967    }
8968
8969    impl fidl::encoding::ResourceTypeMarker for EventStreamGetNextResponse {
8970        type Borrowed<'a> = &'a mut Self;
8971        fn take_or_borrow<'a>(
8972            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8973        ) -> Self::Borrowed<'a> {
8974            value
8975        }
8976    }
8977
8978    unsafe impl fidl::encoding::TypeMarker for EventStreamGetNextResponse {
8979        type Owned = Self;
8980
8981        #[inline(always)]
8982        fn inline_align(_context: fidl::encoding::Context) -> usize {
8983            8
8984        }
8985
8986        #[inline(always)]
8987        fn inline_size(_context: fidl::encoding::Context) -> usize {
8988            16
8989        }
8990    }
8991
8992    unsafe impl
8993        fidl::encoding::Encode<
8994            EventStreamGetNextResponse,
8995            fidl::encoding::DefaultFuchsiaResourceDialect,
8996        > for &mut EventStreamGetNextResponse
8997    {
8998        #[inline]
8999        unsafe fn encode(
9000            self,
9001            encoder: &mut fidl::encoding::Encoder<
9002                '_,
9003                fidl::encoding::DefaultFuchsiaResourceDialect,
9004            >,
9005            offset: usize,
9006            _depth: fidl::encoding::Depth,
9007        ) -> fidl::Result<()> {
9008            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
9009            // Delegate to tuple encoding.
9010            fidl::encoding::Encode::<EventStreamGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9011                (
9012                    <fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
9013                ),
9014                encoder, offset, _depth
9015            )
9016        }
9017    }
9018    unsafe impl<
9019        T0: fidl::encoding::Encode<
9020                fidl::encoding::UnboundedVector<Event>,
9021                fidl::encoding::DefaultFuchsiaResourceDialect,
9022            >,
9023    >
9024        fidl::encoding::Encode<
9025            EventStreamGetNextResponse,
9026            fidl::encoding::DefaultFuchsiaResourceDialect,
9027        > for (T0,)
9028    {
9029        #[inline]
9030        unsafe fn encode(
9031            self,
9032            encoder: &mut fidl::encoding::Encoder<
9033                '_,
9034                fidl::encoding::DefaultFuchsiaResourceDialect,
9035            >,
9036            offset: usize,
9037            depth: fidl::encoding::Depth,
9038        ) -> fidl::Result<()> {
9039            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
9040            // Zero out padding regions. There's no need to apply masks
9041            // because the unmasked parts will be overwritten by fields.
9042            // Write the fields.
9043            self.0.encode(encoder, offset + 0, depth)?;
9044            Ok(())
9045        }
9046    }
9047
9048    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9049        for EventStreamGetNextResponse
9050    {
9051        #[inline(always)]
9052        fn new_empty() -> Self {
9053            Self {
9054                events: fidl::new_empty!(
9055                    fidl::encoding::UnboundedVector<Event>,
9056                    fidl::encoding::DefaultFuchsiaResourceDialect
9057                ),
9058            }
9059        }
9060
9061        #[inline]
9062        unsafe fn decode(
9063            &mut self,
9064            decoder: &mut fidl::encoding::Decoder<
9065                '_,
9066                fidl::encoding::DefaultFuchsiaResourceDialect,
9067            >,
9068            offset: usize,
9069            _depth: fidl::encoding::Depth,
9070        ) -> fidl::Result<()> {
9071            decoder.debug_check_bounds::<Self>(offset);
9072            // Verify that padding bytes are zero.
9073            fidl::decode!(
9074                fidl::encoding::UnboundedVector<Event>,
9075                fidl::encoding::DefaultFuchsiaResourceDialect,
9076                &mut self.events,
9077                decoder,
9078                offset + 0,
9079                _depth
9080            )?;
9081            Ok(())
9082        }
9083    }
9084
9085    impl fidl::encoding::ResourceTypeMarker for IntrospectorGetMonikerRequest {
9086        type Borrowed<'a> = &'a mut Self;
9087        fn take_or_borrow<'a>(
9088            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9089        ) -> Self::Borrowed<'a> {
9090            value
9091        }
9092    }
9093
9094    unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerRequest {
9095        type Owned = Self;
9096
9097        #[inline(always)]
9098        fn inline_align(_context: fidl::encoding::Context) -> usize {
9099            4
9100        }
9101
9102        #[inline(always)]
9103        fn inline_size(_context: fidl::encoding::Context) -> usize {
9104            4
9105        }
9106    }
9107
9108    unsafe impl
9109        fidl::encoding::Encode<
9110            IntrospectorGetMonikerRequest,
9111            fidl::encoding::DefaultFuchsiaResourceDialect,
9112        > for &mut IntrospectorGetMonikerRequest
9113    {
9114        #[inline]
9115        unsafe fn encode(
9116            self,
9117            encoder: &mut fidl::encoding::Encoder<
9118                '_,
9119                fidl::encoding::DefaultFuchsiaResourceDialect,
9120            >,
9121            offset: usize,
9122            _depth: fidl::encoding::Depth,
9123        ) -> fidl::Result<()> {
9124            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
9125            // Delegate to tuple encoding.
9126            fidl::encoding::Encode::<
9127                IntrospectorGetMonikerRequest,
9128                fidl::encoding::DefaultFuchsiaResourceDialect,
9129            >::encode(
9130                (<fidl::encoding::HandleType<
9131                    fidl::Event,
9132                    { fidl::ObjectType::EVENT.into_raw() },
9133                    2147483648,
9134                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9135                    &mut self.component_instance,
9136                ),),
9137                encoder,
9138                offset,
9139                _depth,
9140            )
9141        }
9142    }
9143    unsafe impl<
9144        T0: fidl::encoding::Encode<
9145                fidl::encoding::HandleType<
9146                    fidl::Event,
9147                    { fidl::ObjectType::EVENT.into_raw() },
9148                    2147483648,
9149                >,
9150                fidl::encoding::DefaultFuchsiaResourceDialect,
9151            >,
9152    >
9153        fidl::encoding::Encode<
9154            IntrospectorGetMonikerRequest,
9155            fidl::encoding::DefaultFuchsiaResourceDialect,
9156        > for (T0,)
9157    {
9158        #[inline]
9159        unsafe fn encode(
9160            self,
9161            encoder: &mut fidl::encoding::Encoder<
9162                '_,
9163                fidl::encoding::DefaultFuchsiaResourceDialect,
9164            >,
9165            offset: usize,
9166            depth: fidl::encoding::Depth,
9167        ) -> fidl::Result<()> {
9168            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
9169            // Zero out padding regions. There's no need to apply masks
9170            // because the unmasked parts will be overwritten by fields.
9171            // Write the fields.
9172            self.0.encode(encoder, offset + 0, depth)?;
9173            Ok(())
9174        }
9175    }
9176
9177    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9178        for IntrospectorGetMonikerRequest
9179    {
9180        #[inline(always)]
9181        fn new_empty() -> Self {
9182            Self {
9183                component_instance: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9184            }
9185        }
9186
9187        #[inline]
9188        unsafe fn decode(
9189            &mut self,
9190            decoder: &mut fidl::encoding::Decoder<
9191                '_,
9192                fidl::encoding::DefaultFuchsiaResourceDialect,
9193            >,
9194            offset: usize,
9195            _depth: fidl::encoding::Depth,
9196        ) -> fidl::Result<()> {
9197            decoder.debug_check_bounds::<Self>(offset);
9198            // Verify that padding bytes are zero.
9199            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.component_instance, decoder, offset + 0, _depth)?;
9200            Ok(())
9201        }
9202    }
9203
9204    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateRequest {
9205        type Borrowed<'a> = &'a mut Self;
9206        fn take_or_borrow<'a>(
9207            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9208        ) -> Self::Borrowed<'a> {
9209            value
9210        }
9211    }
9212
9213    unsafe impl fidl::encoding::TypeMarker for NamespaceCreateRequest {
9214        type Owned = Self;
9215
9216        #[inline(always)]
9217        fn inline_align(_context: fidl::encoding::Context) -> usize {
9218            8
9219        }
9220
9221        #[inline(always)]
9222        fn inline_size(_context: fidl::encoding::Context) -> usize {
9223            16
9224        }
9225    }
9226
9227    unsafe impl
9228        fidl::encoding::Encode<
9229            NamespaceCreateRequest,
9230            fidl::encoding::DefaultFuchsiaResourceDialect,
9231        > for &mut NamespaceCreateRequest
9232    {
9233        #[inline]
9234        unsafe fn encode(
9235            self,
9236            encoder: &mut fidl::encoding::Encoder<
9237                '_,
9238                fidl::encoding::DefaultFuchsiaResourceDialect,
9239            >,
9240            offset: usize,
9241            _depth: fidl::encoding::Depth,
9242        ) -> fidl::Result<()> {
9243            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
9244            // Delegate to tuple encoding.
9245            fidl::encoding::Encode::<NamespaceCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9246                (
9247                    <fidl::encoding::UnboundedVector<NamespaceInputEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
9248                ),
9249                encoder, offset, _depth
9250            )
9251        }
9252    }
9253    unsafe impl<
9254        T0: fidl::encoding::Encode<
9255                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
9256                fidl::encoding::DefaultFuchsiaResourceDialect,
9257            >,
9258    >
9259        fidl::encoding::Encode<
9260            NamespaceCreateRequest,
9261            fidl::encoding::DefaultFuchsiaResourceDialect,
9262        > for (T0,)
9263    {
9264        #[inline]
9265        unsafe fn encode(
9266            self,
9267            encoder: &mut fidl::encoding::Encoder<
9268                '_,
9269                fidl::encoding::DefaultFuchsiaResourceDialect,
9270            >,
9271            offset: usize,
9272            depth: fidl::encoding::Depth,
9273        ) -> fidl::Result<()> {
9274            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
9275            // Zero out padding regions. There's no need to apply masks
9276            // because the unmasked parts will be overwritten by fields.
9277            // Write the fields.
9278            self.0.encode(encoder, offset + 0, depth)?;
9279            Ok(())
9280        }
9281    }
9282
9283    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9284        for NamespaceCreateRequest
9285    {
9286        #[inline(always)]
9287        fn new_empty() -> Self {
9288            Self {
9289                entries: fidl::new_empty!(
9290                    fidl::encoding::UnboundedVector<NamespaceInputEntry>,
9291                    fidl::encoding::DefaultFuchsiaResourceDialect
9292                ),
9293            }
9294        }
9295
9296        #[inline]
9297        unsafe fn decode(
9298            &mut self,
9299            decoder: &mut fidl::encoding::Decoder<
9300                '_,
9301                fidl::encoding::DefaultFuchsiaResourceDialect,
9302            >,
9303            offset: usize,
9304            _depth: fidl::encoding::Depth,
9305        ) -> fidl::Result<()> {
9306            decoder.debug_check_bounds::<Self>(offset);
9307            // Verify that padding bytes are zero.
9308            fidl::decode!(
9309                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
9310                fidl::encoding::DefaultFuchsiaResourceDialect,
9311                &mut self.entries,
9312                decoder,
9313                offset + 0,
9314                _depth
9315            )?;
9316            Ok(())
9317        }
9318    }
9319
9320    impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry {
9321        type Borrowed<'a> = &'a mut Self;
9322        fn take_or_borrow<'a>(
9323            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9324        ) -> Self::Borrowed<'a> {
9325            value
9326        }
9327    }
9328
9329    unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry {
9330        type Owned = Self;
9331
9332        #[inline(always)]
9333        fn inline_align(_context: fidl::encoding::Context) -> usize {
9334            8
9335        }
9336
9337        #[inline(always)]
9338        fn inline_size(_context: fidl::encoding::Context) -> usize {
9339            24
9340        }
9341    }
9342
9343    unsafe impl
9344        fidl::encoding::Encode<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
9345        for &mut NamespaceInputEntry
9346    {
9347        #[inline]
9348        unsafe fn encode(
9349            self,
9350            encoder: &mut fidl::encoding::Encoder<
9351                '_,
9352                fidl::encoding::DefaultFuchsiaResourceDialect,
9353            >,
9354            offset: usize,
9355            _depth: fidl::encoding::Depth,
9356        ) -> fidl::Result<()> {
9357            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
9358            // Delegate to tuple encoding.
9359            fidl::encoding::Encode::<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9360                (
9361                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
9362                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
9363                ),
9364                encoder, offset, _depth
9365            )
9366        }
9367    }
9368    unsafe impl<
9369        T0: fidl::encoding::Encode<
9370                fidl::encoding::BoundedString<4095>,
9371                fidl::encoding::DefaultFuchsiaResourceDialect,
9372            >,
9373        T1: fidl::encoding::Encode<
9374                fidl::encoding::Endpoint<
9375                    fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
9376                >,
9377                fidl::encoding::DefaultFuchsiaResourceDialect,
9378            >,
9379    > fidl::encoding::Encode<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
9380        for (T0, T1)
9381    {
9382        #[inline]
9383        unsafe fn encode(
9384            self,
9385            encoder: &mut fidl::encoding::Encoder<
9386                '_,
9387                fidl::encoding::DefaultFuchsiaResourceDialect,
9388            >,
9389            offset: usize,
9390            depth: fidl::encoding::Depth,
9391        ) -> fidl::Result<()> {
9392            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
9393            // Zero out padding regions. There's no need to apply masks
9394            // because the unmasked parts will be overwritten by fields.
9395            unsafe {
9396                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9397                (ptr as *mut u64).write_unaligned(0);
9398            }
9399            // Write the fields.
9400            self.0.encode(encoder, offset + 0, depth)?;
9401            self.1.encode(encoder, offset + 16, depth)?;
9402            Ok(())
9403        }
9404    }
9405
9406    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9407        for NamespaceInputEntry
9408    {
9409        #[inline(always)]
9410        fn new_empty() -> Self {
9411            Self {
9412                path: fidl::new_empty!(
9413                    fidl::encoding::BoundedString<4095>,
9414                    fidl::encoding::DefaultFuchsiaResourceDialect
9415                ),
9416                dictionary: fidl::new_empty!(
9417                    fidl::encoding::Endpoint<
9418                        fidl::endpoints::ClientEnd<
9419                            fidl_fuchsia_component_sandbox::DictionaryMarker,
9420                        >,
9421                    >,
9422                    fidl::encoding::DefaultFuchsiaResourceDialect
9423                ),
9424            }
9425        }
9426
9427        #[inline]
9428        unsafe fn decode(
9429            &mut self,
9430            decoder: &mut fidl::encoding::Decoder<
9431                '_,
9432                fidl::encoding::DefaultFuchsiaResourceDialect,
9433            >,
9434            offset: usize,
9435            _depth: fidl::encoding::Depth,
9436        ) -> fidl::Result<()> {
9437            decoder.debug_check_bounds::<Self>(offset);
9438            // Verify that padding bytes are zero.
9439            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9440            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9441            let mask = 0xffffffff00000000u64;
9442            let maskedval = padval & mask;
9443            if maskedval != 0 {
9444                return Err(fidl::Error::NonZeroPadding {
9445                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9446                });
9447            }
9448            fidl::decode!(
9449                fidl::encoding::BoundedString<4095>,
9450                fidl::encoding::DefaultFuchsiaResourceDialect,
9451                &mut self.path,
9452                decoder,
9453                offset + 0,
9454                _depth
9455            )?;
9456            fidl::decode!(
9457                fidl::encoding::Endpoint<
9458                    fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
9459                >,
9460                fidl::encoding::DefaultFuchsiaResourceDialect,
9461                &mut self.dictionary,
9462                decoder,
9463                offset + 16,
9464                _depth
9465            )?;
9466            Ok(())
9467        }
9468    }
9469
9470    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateResponse {
9471        type Borrowed<'a> = &'a mut Self;
9472        fn take_or_borrow<'a>(
9473            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9474        ) -> Self::Borrowed<'a> {
9475            value
9476        }
9477    }
9478
9479    unsafe impl fidl::encoding::TypeMarker for NamespaceCreateResponse {
9480        type Owned = Self;
9481
9482        #[inline(always)]
9483        fn inline_align(_context: fidl::encoding::Context) -> usize {
9484            8
9485        }
9486
9487        #[inline(always)]
9488        fn inline_size(_context: fidl::encoding::Context) -> usize {
9489            16
9490        }
9491    }
9492
9493    unsafe impl
9494        fidl::encoding::Encode<
9495            NamespaceCreateResponse,
9496            fidl::encoding::DefaultFuchsiaResourceDialect,
9497        > for &mut NamespaceCreateResponse
9498    {
9499        #[inline]
9500        unsafe fn encode(
9501            self,
9502            encoder: &mut fidl::encoding::Encoder<
9503                '_,
9504                fidl::encoding::DefaultFuchsiaResourceDialect,
9505            >,
9506            offset: usize,
9507            _depth: fidl::encoding::Depth,
9508        ) -> fidl::Result<()> {
9509            encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
9510            // Delegate to tuple encoding.
9511            fidl::encoding::Encode::<NamespaceCreateResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9512                (
9513                    <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
9514                ),
9515                encoder, offset, _depth
9516            )
9517        }
9518    }
9519    unsafe impl<
9520        T0: fidl::encoding::Encode<
9521                fidl::encoding::UnboundedVector<NamespaceEntry>,
9522                fidl::encoding::DefaultFuchsiaResourceDialect,
9523            >,
9524    >
9525        fidl::encoding::Encode<
9526            NamespaceCreateResponse,
9527            fidl::encoding::DefaultFuchsiaResourceDialect,
9528        > for (T0,)
9529    {
9530        #[inline]
9531        unsafe fn encode(
9532            self,
9533            encoder: &mut fidl::encoding::Encoder<
9534                '_,
9535                fidl::encoding::DefaultFuchsiaResourceDialect,
9536            >,
9537            offset: usize,
9538            depth: fidl::encoding::Depth,
9539        ) -> fidl::Result<()> {
9540            encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
9541            // Zero out padding regions. There's no need to apply masks
9542            // because the unmasked parts will be overwritten by fields.
9543            // Write the fields.
9544            self.0.encode(encoder, offset + 0, depth)?;
9545            Ok(())
9546        }
9547    }
9548
9549    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9550        for NamespaceCreateResponse
9551    {
9552        #[inline(always)]
9553        fn new_empty() -> Self {
9554            Self {
9555                entries: fidl::new_empty!(
9556                    fidl::encoding::UnboundedVector<NamespaceEntry>,
9557                    fidl::encoding::DefaultFuchsiaResourceDialect
9558                ),
9559            }
9560        }
9561
9562        #[inline]
9563        unsafe fn decode(
9564            &mut self,
9565            decoder: &mut fidl::encoding::Decoder<
9566                '_,
9567                fidl::encoding::DefaultFuchsiaResourceDialect,
9568            >,
9569            offset: usize,
9570            _depth: fidl::encoding::Depth,
9571        ) -> fidl::Result<()> {
9572            decoder.debug_check_bounds::<Self>(offset);
9573            // Verify that padding bytes are zero.
9574            fidl::decode!(
9575                fidl::encoding::UnboundedVector<NamespaceEntry>,
9576                fidl::encoding::DefaultFuchsiaResourceDialect,
9577                &mut self.entries,
9578                decoder,
9579                offset + 0,
9580                _depth
9581            )?;
9582            Ok(())
9583        }
9584    }
9585
9586    impl fidl::encoding::ResourceTypeMarker for RealmCreateChildRequest {
9587        type Borrowed<'a> = &'a mut Self;
9588        fn take_or_borrow<'a>(
9589            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9590        ) -> Self::Borrowed<'a> {
9591            value
9592        }
9593    }
9594
9595    unsafe impl fidl::encoding::TypeMarker for RealmCreateChildRequest {
9596        type Owned = Self;
9597
9598        #[inline(always)]
9599        fn inline_align(_context: fidl::encoding::Context) -> usize {
9600            8
9601        }
9602
9603        #[inline(always)]
9604        fn inline_size(_context: fidl::encoding::Context) -> usize {
9605            48
9606        }
9607    }
9608
9609    unsafe impl
9610        fidl::encoding::Encode<
9611            RealmCreateChildRequest,
9612            fidl::encoding::DefaultFuchsiaResourceDialect,
9613        > for &mut RealmCreateChildRequest
9614    {
9615        #[inline]
9616        unsafe fn encode(
9617            self,
9618            encoder: &mut fidl::encoding::Encoder<
9619                '_,
9620                fidl::encoding::DefaultFuchsiaResourceDialect,
9621            >,
9622            offset: usize,
9623            _depth: fidl::encoding::Depth,
9624        ) -> fidl::Result<()> {
9625            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
9626            // Delegate to tuple encoding.
9627            fidl::encoding::Encode::<RealmCreateChildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9628                (
9629                    <fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
9630                    <fidl_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
9631                    <CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
9632                ),
9633                encoder, offset, _depth
9634            )
9635        }
9636    }
9637    unsafe impl<
9638        T0: fidl::encoding::Encode<
9639                fidl_fuchsia_component_decl::CollectionRef,
9640                fidl::encoding::DefaultFuchsiaResourceDialect,
9641            >,
9642        T1: fidl::encoding::Encode<
9643                fidl_fuchsia_component_decl::Child,
9644                fidl::encoding::DefaultFuchsiaResourceDialect,
9645            >,
9646        T2: fidl::encoding::Encode<CreateChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
9647    >
9648        fidl::encoding::Encode<
9649            RealmCreateChildRequest,
9650            fidl::encoding::DefaultFuchsiaResourceDialect,
9651        > for (T0, T1, T2)
9652    {
9653        #[inline]
9654        unsafe fn encode(
9655            self,
9656            encoder: &mut fidl::encoding::Encoder<
9657                '_,
9658                fidl::encoding::DefaultFuchsiaResourceDialect,
9659            >,
9660            offset: usize,
9661            depth: fidl::encoding::Depth,
9662        ) -> fidl::Result<()> {
9663            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
9664            // Zero out padding regions. There's no need to apply masks
9665            // because the unmasked parts will be overwritten by fields.
9666            // Write the fields.
9667            self.0.encode(encoder, offset + 0, depth)?;
9668            self.1.encode(encoder, offset + 16, depth)?;
9669            self.2.encode(encoder, offset + 32, depth)?;
9670            Ok(())
9671        }
9672    }
9673
9674    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9675        for RealmCreateChildRequest
9676    {
9677        #[inline(always)]
9678        fn new_empty() -> Self {
9679            Self {
9680                collection: fidl::new_empty!(
9681                    fidl_fuchsia_component_decl::CollectionRef,
9682                    fidl::encoding::DefaultFuchsiaResourceDialect
9683                ),
9684                decl: fidl::new_empty!(
9685                    fidl_fuchsia_component_decl::Child,
9686                    fidl::encoding::DefaultFuchsiaResourceDialect
9687                ),
9688                args: fidl::new_empty!(
9689                    CreateChildArgs,
9690                    fidl::encoding::DefaultFuchsiaResourceDialect
9691                ),
9692            }
9693        }
9694
9695        #[inline]
9696        unsafe fn decode(
9697            &mut self,
9698            decoder: &mut fidl::encoding::Decoder<
9699                '_,
9700                fidl::encoding::DefaultFuchsiaResourceDialect,
9701            >,
9702            offset: usize,
9703            _depth: fidl::encoding::Depth,
9704        ) -> fidl::Result<()> {
9705            decoder.debug_check_bounds::<Self>(offset);
9706            // Verify that padding bytes are zero.
9707            fidl::decode!(
9708                fidl_fuchsia_component_decl::CollectionRef,
9709                fidl::encoding::DefaultFuchsiaResourceDialect,
9710                &mut self.collection,
9711                decoder,
9712                offset + 0,
9713                _depth
9714            )?;
9715            fidl::decode!(
9716                fidl_fuchsia_component_decl::Child,
9717                fidl::encoding::DefaultFuchsiaResourceDialect,
9718                &mut self.decl,
9719                decoder,
9720                offset + 16,
9721                _depth
9722            )?;
9723            fidl::decode!(
9724                CreateChildArgs,
9725                fidl::encoding::DefaultFuchsiaResourceDialect,
9726                &mut self.args,
9727                decoder,
9728                offset + 32,
9729                _depth
9730            )?;
9731            Ok(())
9732        }
9733    }
9734
9735    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryDeprecatedRequest {
9736        type Borrowed<'a> = &'a mut Self;
9737        fn take_or_borrow<'a>(
9738            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9739        ) -> Self::Borrowed<'a> {
9740            value
9741        }
9742    }
9743
9744    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryDeprecatedRequest {
9745        type Owned = Self;
9746
9747        #[inline(always)]
9748        fn inline_align(_context: fidl::encoding::Context) -> usize {
9749            8
9750        }
9751
9752        #[inline(always)]
9753        fn inline_size(_context: fidl::encoding::Context) -> usize {
9754            32
9755        }
9756    }
9757
9758    unsafe impl
9759        fidl::encoding::Encode<
9760            RealmGetChildOutputDictionaryDeprecatedRequest,
9761            fidl::encoding::DefaultFuchsiaResourceDialect,
9762        > for &mut RealmGetChildOutputDictionaryDeprecatedRequest
9763    {
9764        #[inline]
9765        unsafe fn encode(
9766            self,
9767            encoder: &mut fidl::encoding::Encoder<
9768                '_,
9769                fidl::encoding::DefaultFuchsiaResourceDialect,
9770            >,
9771            offset: usize,
9772            _depth: fidl::encoding::Depth,
9773        ) -> fidl::Result<()> {
9774            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedRequest>(offset);
9775            // Delegate to tuple encoding.
9776            fidl::encoding::Encode::<RealmGetChildOutputDictionaryDeprecatedRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9777                (
9778                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
9779                ),
9780                encoder, offset, _depth
9781            )
9782        }
9783    }
9784    unsafe impl<
9785        T0: fidl::encoding::Encode<
9786                fidl_fuchsia_component_decl::ChildRef,
9787                fidl::encoding::DefaultFuchsiaResourceDialect,
9788            >,
9789    >
9790        fidl::encoding::Encode<
9791            RealmGetChildOutputDictionaryDeprecatedRequest,
9792            fidl::encoding::DefaultFuchsiaResourceDialect,
9793        > for (T0,)
9794    {
9795        #[inline]
9796        unsafe fn encode(
9797            self,
9798            encoder: &mut fidl::encoding::Encoder<
9799                '_,
9800                fidl::encoding::DefaultFuchsiaResourceDialect,
9801            >,
9802            offset: usize,
9803            depth: fidl::encoding::Depth,
9804        ) -> fidl::Result<()> {
9805            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedRequest>(offset);
9806            // Zero out padding regions. There's no need to apply masks
9807            // because the unmasked parts will be overwritten by fields.
9808            // Write the fields.
9809            self.0.encode(encoder, offset + 0, depth)?;
9810            Ok(())
9811        }
9812    }
9813
9814    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9815        for RealmGetChildOutputDictionaryDeprecatedRequest
9816    {
9817        #[inline(always)]
9818        fn new_empty() -> Self {
9819            Self {
9820                child: fidl::new_empty!(
9821                    fidl_fuchsia_component_decl::ChildRef,
9822                    fidl::encoding::DefaultFuchsiaResourceDialect
9823                ),
9824            }
9825        }
9826
9827        #[inline]
9828        unsafe fn decode(
9829            &mut self,
9830            decoder: &mut fidl::encoding::Decoder<
9831                '_,
9832                fidl::encoding::DefaultFuchsiaResourceDialect,
9833            >,
9834            offset: usize,
9835            _depth: fidl::encoding::Depth,
9836        ) -> fidl::Result<()> {
9837            decoder.debug_check_bounds::<Self>(offset);
9838            // Verify that padding bytes are zero.
9839            fidl::decode!(
9840                fidl_fuchsia_component_decl::ChildRef,
9841                fidl::encoding::DefaultFuchsiaResourceDialect,
9842                &mut self.child,
9843                decoder,
9844                offset + 0,
9845                _depth
9846            )?;
9847            Ok(())
9848        }
9849    }
9850
9851    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryRequest {
9852        type Borrowed<'a> = &'a mut Self;
9853        fn take_or_borrow<'a>(
9854            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9855        ) -> Self::Borrowed<'a> {
9856            value
9857        }
9858    }
9859
9860    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryRequest {
9861        type Owned = Self;
9862
9863        #[inline(always)]
9864        fn inline_align(_context: fidl::encoding::Context) -> usize {
9865            8
9866        }
9867
9868        #[inline(always)]
9869        fn inline_size(_context: fidl::encoding::Context) -> usize {
9870            32
9871        }
9872    }
9873
9874    unsafe impl
9875        fidl::encoding::Encode<
9876            RealmGetChildOutputDictionaryRequest,
9877            fidl::encoding::DefaultFuchsiaResourceDialect,
9878        > for &mut RealmGetChildOutputDictionaryRequest
9879    {
9880        #[inline]
9881        unsafe fn encode(
9882            self,
9883            encoder: &mut fidl::encoding::Encoder<
9884                '_,
9885                fidl::encoding::DefaultFuchsiaResourceDialect,
9886            >,
9887            offset: usize,
9888            _depth: fidl::encoding::Depth,
9889        ) -> fidl::Result<()> {
9890            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
9891            // Delegate to tuple encoding.
9892            fidl::encoding::Encode::<RealmGetChildOutputDictionaryRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9893                (
9894                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
9895                ),
9896                encoder, offset, _depth
9897            )
9898        }
9899    }
9900    unsafe impl<
9901        T0: fidl::encoding::Encode<
9902                fidl_fuchsia_component_decl::ChildRef,
9903                fidl::encoding::DefaultFuchsiaResourceDialect,
9904            >,
9905    >
9906        fidl::encoding::Encode<
9907            RealmGetChildOutputDictionaryRequest,
9908            fidl::encoding::DefaultFuchsiaResourceDialect,
9909        > for (T0,)
9910    {
9911        #[inline]
9912        unsafe fn encode(
9913            self,
9914            encoder: &mut fidl::encoding::Encoder<
9915                '_,
9916                fidl::encoding::DefaultFuchsiaResourceDialect,
9917            >,
9918            offset: usize,
9919            depth: fidl::encoding::Depth,
9920        ) -> fidl::Result<()> {
9921            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
9922            // Zero out padding regions. There's no need to apply masks
9923            // because the unmasked parts will be overwritten by fields.
9924            // Write the fields.
9925            self.0.encode(encoder, offset + 0, depth)?;
9926            Ok(())
9927        }
9928    }
9929
9930    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9931        for RealmGetChildOutputDictionaryRequest
9932    {
9933        #[inline(always)]
9934        fn new_empty() -> Self {
9935            Self {
9936                child: fidl::new_empty!(
9937                    fidl_fuchsia_component_decl::ChildRef,
9938                    fidl::encoding::DefaultFuchsiaResourceDialect
9939                ),
9940            }
9941        }
9942
9943        #[inline]
9944        unsafe fn decode(
9945            &mut self,
9946            decoder: &mut fidl::encoding::Decoder<
9947                '_,
9948                fidl::encoding::DefaultFuchsiaResourceDialect,
9949            >,
9950            offset: usize,
9951            _depth: fidl::encoding::Depth,
9952        ) -> fidl::Result<()> {
9953            decoder.debug_check_bounds::<Self>(offset);
9954            // Verify that padding bytes are zero.
9955            fidl::decode!(
9956                fidl_fuchsia_component_decl::ChildRef,
9957                fidl::encoding::DefaultFuchsiaResourceDialect,
9958                &mut self.child,
9959                decoder,
9960                offset + 0,
9961                _depth
9962            )?;
9963            Ok(())
9964        }
9965    }
9966
9967    impl fidl::encoding::ResourceTypeMarker for RealmListChildrenRequest {
9968        type Borrowed<'a> = &'a mut Self;
9969        fn take_or_borrow<'a>(
9970            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9971        ) -> Self::Borrowed<'a> {
9972            value
9973        }
9974    }
9975
9976    unsafe impl fidl::encoding::TypeMarker for RealmListChildrenRequest {
9977        type Owned = Self;
9978
9979        #[inline(always)]
9980        fn inline_align(_context: fidl::encoding::Context) -> usize {
9981            8
9982        }
9983
9984        #[inline(always)]
9985        fn inline_size(_context: fidl::encoding::Context) -> usize {
9986            24
9987        }
9988    }
9989
9990    unsafe impl
9991        fidl::encoding::Encode<
9992            RealmListChildrenRequest,
9993            fidl::encoding::DefaultFuchsiaResourceDialect,
9994        > for &mut RealmListChildrenRequest
9995    {
9996        #[inline]
9997        unsafe fn encode(
9998            self,
9999            encoder: &mut fidl::encoding::Encoder<
10000                '_,
10001                fidl::encoding::DefaultFuchsiaResourceDialect,
10002            >,
10003            offset: usize,
10004            _depth: fidl::encoding::Depth,
10005        ) -> fidl::Result<()> {
10006            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
10007            // Delegate to tuple encoding.
10008            fidl::encoding::Encode::<RealmListChildrenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10009                (
10010                    <fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
10011                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iter),
10012                ),
10013                encoder, offset, _depth
10014            )
10015        }
10016    }
10017    unsafe impl<
10018        T0: fidl::encoding::Encode<
10019                fidl_fuchsia_component_decl::CollectionRef,
10020                fidl::encoding::DefaultFuchsiaResourceDialect,
10021            >,
10022        T1: fidl::encoding::Encode<
10023                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
10024                fidl::encoding::DefaultFuchsiaResourceDialect,
10025            >,
10026    >
10027        fidl::encoding::Encode<
10028            RealmListChildrenRequest,
10029            fidl::encoding::DefaultFuchsiaResourceDialect,
10030        > for (T0, T1)
10031    {
10032        #[inline]
10033        unsafe fn encode(
10034            self,
10035            encoder: &mut fidl::encoding::Encoder<
10036                '_,
10037                fidl::encoding::DefaultFuchsiaResourceDialect,
10038            >,
10039            offset: usize,
10040            depth: fidl::encoding::Depth,
10041        ) -> fidl::Result<()> {
10042            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
10043            // Zero out padding regions. There's no need to apply masks
10044            // because the unmasked parts will be overwritten by fields.
10045            unsafe {
10046                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10047                (ptr as *mut u64).write_unaligned(0);
10048            }
10049            // Write the fields.
10050            self.0.encode(encoder, offset + 0, depth)?;
10051            self.1.encode(encoder, offset + 16, depth)?;
10052            Ok(())
10053        }
10054    }
10055
10056    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10057        for RealmListChildrenRequest
10058    {
10059        #[inline(always)]
10060        fn new_empty() -> Self {
10061            Self {
10062                collection: fidl::new_empty!(
10063                    fidl_fuchsia_component_decl::CollectionRef,
10064                    fidl::encoding::DefaultFuchsiaResourceDialect
10065                ),
10066                iter: fidl::new_empty!(
10067                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
10068                    fidl::encoding::DefaultFuchsiaResourceDialect
10069                ),
10070            }
10071        }
10072
10073        #[inline]
10074        unsafe fn decode(
10075            &mut self,
10076            decoder: &mut fidl::encoding::Decoder<
10077                '_,
10078                fidl::encoding::DefaultFuchsiaResourceDialect,
10079            >,
10080            offset: usize,
10081            _depth: fidl::encoding::Depth,
10082        ) -> fidl::Result<()> {
10083            decoder.debug_check_bounds::<Self>(offset);
10084            // Verify that padding bytes are zero.
10085            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10086            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10087            let mask = 0xffffffff00000000u64;
10088            let maskedval = padval & mask;
10089            if maskedval != 0 {
10090                return Err(fidl::Error::NonZeroPadding {
10091                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10092                });
10093            }
10094            fidl::decode!(
10095                fidl_fuchsia_component_decl::CollectionRef,
10096                fidl::encoding::DefaultFuchsiaResourceDialect,
10097                &mut self.collection,
10098                decoder,
10099                offset + 0,
10100                _depth
10101            )?;
10102            fidl::decode!(
10103                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
10104                fidl::encoding::DefaultFuchsiaResourceDialect,
10105                &mut self.iter,
10106                decoder,
10107                offset + 16,
10108                _depth
10109            )?;
10110            Ok(())
10111        }
10112    }
10113
10114    impl fidl::encoding::ResourceTypeMarker for RealmOpenControllerRequest {
10115        type Borrowed<'a> = &'a mut Self;
10116        fn take_or_borrow<'a>(
10117            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10118        ) -> Self::Borrowed<'a> {
10119            value
10120        }
10121    }
10122
10123    unsafe impl fidl::encoding::TypeMarker for RealmOpenControllerRequest {
10124        type Owned = Self;
10125
10126        #[inline(always)]
10127        fn inline_align(_context: fidl::encoding::Context) -> usize {
10128            8
10129        }
10130
10131        #[inline(always)]
10132        fn inline_size(_context: fidl::encoding::Context) -> usize {
10133            40
10134        }
10135    }
10136
10137    unsafe impl
10138        fidl::encoding::Encode<
10139            RealmOpenControllerRequest,
10140            fidl::encoding::DefaultFuchsiaResourceDialect,
10141        > for &mut RealmOpenControllerRequest
10142    {
10143        #[inline]
10144        unsafe fn encode(
10145            self,
10146            encoder: &mut fidl::encoding::Encoder<
10147                '_,
10148                fidl::encoding::DefaultFuchsiaResourceDialect,
10149            >,
10150            offset: usize,
10151            _depth: fidl::encoding::Depth,
10152        ) -> fidl::Result<()> {
10153            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
10154            // Delegate to tuple encoding.
10155            fidl::encoding::Encode::<RealmOpenControllerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10156                (
10157                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
10158                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
10159                ),
10160                encoder, offset, _depth
10161            )
10162        }
10163    }
10164    unsafe impl<
10165        T0: fidl::encoding::Encode<
10166                fidl_fuchsia_component_decl::ChildRef,
10167                fidl::encoding::DefaultFuchsiaResourceDialect,
10168            >,
10169        T1: fidl::encoding::Encode<
10170                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10171                fidl::encoding::DefaultFuchsiaResourceDialect,
10172            >,
10173    >
10174        fidl::encoding::Encode<
10175            RealmOpenControllerRequest,
10176            fidl::encoding::DefaultFuchsiaResourceDialect,
10177        > for (T0, T1)
10178    {
10179        #[inline]
10180        unsafe fn encode(
10181            self,
10182            encoder: &mut fidl::encoding::Encoder<
10183                '_,
10184                fidl::encoding::DefaultFuchsiaResourceDialect,
10185            >,
10186            offset: usize,
10187            depth: fidl::encoding::Depth,
10188        ) -> fidl::Result<()> {
10189            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
10190            // Zero out padding regions. There's no need to apply masks
10191            // because the unmasked parts will be overwritten by fields.
10192            unsafe {
10193                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10194                (ptr as *mut u64).write_unaligned(0);
10195            }
10196            // Write the fields.
10197            self.0.encode(encoder, offset + 0, depth)?;
10198            self.1.encode(encoder, offset + 32, depth)?;
10199            Ok(())
10200        }
10201    }
10202
10203    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10204        for RealmOpenControllerRequest
10205    {
10206        #[inline(always)]
10207        fn new_empty() -> Self {
10208            Self {
10209                child: fidl::new_empty!(
10210                    fidl_fuchsia_component_decl::ChildRef,
10211                    fidl::encoding::DefaultFuchsiaResourceDialect
10212                ),
10213                controller: fidl::new_empty!(
10214                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10215                    fidl::encoding::DefaultFuchsiaResourceDialect
10216                ),
10217            }
10218        }
10219
10220        #[inline]
10221        unsafe fn decode(
10222            &mut self,
10223            decoder: &mut fidl::encoding::Decoder<
10224                '_,
10225                fidl::encoding::DefaultFuchsiaResourceDialect,
10226            >,
10227            offset: usize,
10228            _depth: fidl::encoding::Depth,
10229        ) -> fidl::Result<()> {
10230            decoder.debug_check_bounds::<Self>(offset);
10231            // Verify that padding bytes are zero.
10232            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
10233            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10234            let mask = 0xffffffff00000000u64;
10235            let maskedval = padval & mask;
10236            if maskedval != 0 {
10237                return Err(fidl::Error::NonZeroPadding {
10238                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
10239                });
10240            }
10241            fidl::decode!(
10242                fidl_fuchsia_component_decl::ChildRef,
10243                fidl::encoding::DefaultFuchsiaResourceDialect,
10244                &mut self.child,
10245                decoder,
10246                offset + 0,
10247                _depth
10248            )?;
10249            fidl::decode!(
10250                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10251                fidl::encoding::DefaultFuchsiaResourceDialect,
10252                &mut self.controller,
10253                decoder,
10254                offset + 32,
10255                _depth
10256            )?;
10257            Ok(())
10258        }
10259    }
10260
10261    impl fidl::encoding::ResourceTypeMarker for RealmOpenExposedDirRequest {
10262        type Borrowed<'a> = &'a mut Self;
10263        fn take_or_borrow<'a>(
10264            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10265        ) -> Self::Borrowed<'a> {
10266            value
10267        }
10268    }
10269
10270    unsafe impl fidl::encoding::TypeMarker for RealmOpenExposedDirRequest {
10271        type Owned = Self;
10272
10273        #[inline(always)]
10274        fn inline_align(_context: fidl::encoding::Context) -> usize {
10275            8
10276        }
10277
10278        #[inline(always)]
10279        fn inline_size(_context: fidl::encoding::Context) -> usize {
10280            40
10281        }
10282    }
10283
10284    unsafe impl
10285        fidl::encoding::Encode<
10286            RealmOpenExposedDirRequest,
10287            fidl::encoding::DefaultFuchsiaResourceDialect,
10288        > for &mut RealmOpenExposedDirRequest
10289    {
10290        #[inline]
10291        unsafe fn encode(
10292            self,
10293            encoder: &mut fidl::encoding::Encoder<
10294                '_,
10295                fidl::encoding::DefaultFuchsiaResourceDialect,
10296            >,
10297            offset: usize,
10298            _depth: fidl::encoding::Depth,
10299        ) -> fidl::Result<()> {
10300            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
10301            // Delegate to tuple encoding.
10302            fidl::encoding::Encode::<RealmOpenExposedDirRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10303                (
10304                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
10305                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.exposed_dir),
10306                ),
10307                encoder, offset, _depth
10308            )
10309        }
10310    }
10311    unsafe impl<
10312        T0: fidl::encoding::Encode<
10313                fidl_fuchsia_component_decl::ChildRef,
10314                fidl::encoding::DefaultFuchsiaResourceDialect,
10315            >,
10316        T1: fidl::encoding::Encode<
10317                fidl::encoding::Endpoint<
10318                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
10319                >,
10320                fidl::encoding::DefaultFuchsiaResourceDialect,
10321            >,
10322    >
10323        fidl::encoding::Encode<
10324            RealmOpenExposedDirRequest,
10325            fidl::encoding::DefaultFuchsiaResourceDialect,
10326        > for (T0, T1)
10327    {
10328        #[inline]
10329        unsafe fn encode(
10330            self,
10331            encoder: &mut fidl::encoding::Encoder<
10332                '_,
10333                fidl::encoding::DefaultFuchsiaResourceDialect,
10334            >,
10335            offset: usize,
10336            depth: fidl::encoding::Depth,
10337        ) -> fidl::Result<()> {
10338            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
10339            // Zero out padding regions. There's no need to apply masks
10340            // because the unmasked parts will be overwritten by fields.
10341            unsafe {
10342                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10343                (ptr as *mut u64).write_unaligned(0);
10344            }
10345            // Write the fields.
10346            self.0.encode(encoder, offset + 0, depth)?;
10347            self.1.encode(encoder, offset + 32, depth)?;
10348            Ok(())
10349        }
10350    }
10351
10352    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10353        for RealmOpenExposedDirRequest
10354    {
10355        #[inline(always)]
10356        fn new_empty() -> Self {
10357            Self {
10358                child: fidl::new_empty!(
10359                    fidl_fuchsia_component_decl::ChildRef,
10360                    fidl::encoding::DefaultFuchsiaResourceDialect
10361                ),
10362                exposed_dir: fidl::new_empty!(
10363                    fidl::encoding::Endpoint<
10364                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
10365                    >,
10366                    fidl::encoding::DefaultFuchsiaResourceDialect
10367                ),
10368            }
10369        }
10370
10371        #[inline]
10372        unsafe fn decode(
10373            &mut self,
10374            decoder: &mut fidl::encoding::Decoder<
10375                '_,
10376                fidl::encoding::DefaultFuchsiaResourceDialect,
10377            >,
10378            offset: usize,
10379            _depth: fidl::encoding::Depth,
10380        ) -> fidl::Result<()> {
10381            decoder.debug_check_bounds::<Self>(offset);
10382            // Verify that padding bytes are zero.
10383            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
10384            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10385            let mask = 0xffffffff00000000u64;
10386            let maskedval = padval & mask;
10387            if maskedval != 0 {
10388                return Err(fidl::Error::NonZeroPadding {
10389                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
10390                });
10391            }
10392            fidl::decode!(
10393                fidl_fuchsia_component_decl::ChildRef,
10394                fidl::encoding::DefaultFuchsiaResourceDialect,
10395                &mut self.child,
10396                decoder,
10397                offset + 0,
10398                _depth
10399            )?;
10400            fidl::decode!(
10401                fidl::encoding::Endpoint<
10402                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
10403                >,
10404                fidl::encoding::DefaultFuchsiaResourceDialect,
10405                &mut self.exposed_dir,
10406                decoder,
10407                offset + 32,
10408                _depth
10409            )?;
10410            Ok(())
10411        }
10412    }
10413
10414    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryDeprecatedResponse {
10415        type Borrowed<'a> = &'a mut Self;
10416        fn take_or_borrow<'a>(
10417            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10418        ) -> Self::Borrowed<'a> {
10419            value
10420        }
10421    }
10422
10423    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryDeprecatedResponse {
10424        type Owned = Self;
10425
10426        #[inline(always)]
10427        fn inline_align(_context: fidl::encoding::Context) -> usize {
10428            4
10429        }
10430
10431        #[inline(always)]
10432        fn inline_size(_context: fidl::encoding::Context) -> usize {
10433            4
10434        }
10435    }
10436
10437    unsafe impl
10438        fidl::encoding::Encode<
10439            RealmGetChildOutputDictionaryDeprecatedResponse,
10440            fidl::encoding::DefaultFuchsiaResourceDialect,
10441        > for &mut RealmGetChildOutputDictionaryDeprecatedResponse
10442    {
10443        #[inline]
10444        unsafe fn encode(
10445            self,
10446            encoder: &mut fidl::encoding::Encoder<
10447                '_,
10448                fidl::encoding::DefaultFuchsiaResourceDialect,
10449            >,
10450            offset: usize,
10451            _depth: fidl::encoding::Depth,
10452        ) -> fidl::Result<()> {
10453            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedResponse>(offset);
10454            // Delegate to tuple encoding.
10455            fidl::encoding::Encode::<RealmGetChildOutputDictionaryDeprecatedResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10456                (
10457                    <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
10458                ),
10459                encoder, offset, _depth
10460            )
10461        }
10462    }
10463    unsafe impl<
10464        T0: fidl::encoding::Encode<
10465                fidl_fuchsia_component_sandbox::DictionaryRef,
10466                fidl::encoding::DefaultFuchsiaResourceDialect,
10467            >,
10468    >
10469        fidl::encoding::Encode<
10470            RealmGetChildOutputDictionaryDeprecatedResponse,
10471            fidl::encoding::DefaultFuchsiaResourceDialect,
10472        > for (T0,)
10473    {
10474        #[inline]
10475        unsafe fn encode(
10476            self,
10477            encoder: &mut fidl::encoding::Encoder<
10478                '_,
10479                fidl::encoding::DefaultFuchsiaResourceDialect,
10480            >,
10481            offset: usize,
10482            depth: fidl::encoding::Depth,
10483        ) -> fidl::Result<()> {
10484            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedResponse>(offset);
10485            // Zero out padding regions. There's no need to apply masks
10486            // because the unmasked parts will be overwritten by fields.
10487            // Write the fields.
10488            self.0.encode(encoder, offset + 0, depth)?;
10489            Ok(())
10490        }
10491    }
10492
10493    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10494        for RealmGetChildOutputDictionaryDeprecatedResponse
10495    {
10496        #[inline(always)]
10497        fn new_empty() -> Self {
10498            Self {
10499                dictionary: fidl::new_empty!(
10500                    fidl_fuchsia_component_sandbox::DictionaryRef,
10501                    fidl::encoding::DefaultFuchsiaResourceDialect
10502                ),
10503            }
10504        }
10505
10506        #[inline]
10507        unsafe fn decode(
10508            &mut self,
10509            decoder: &mut fidl::encoding::Decoder<
10510                '_,
10511                fidl::encoding::DefaultFuchsiaResourceDialect,
10512            >,
10513            offset: usize,
10514            _depth: fidl::encoding::Depth,
10515        ) -> fidl::Result<()> {
10516            decoder.debug_check_bounds::<Self>(offset);
10517            // Verify that padding bytes are zero.
10518            fidl::decode!(
10519                fidl_fuchsia_component_sandbox::DictionaryRef,
10520                fidl::encoding::DefaultFuchsiaResourceDialect,
10521                &mut self.dictionary,
10522                decoder,
10523                offset + 0,
10524                _depth
10525            )?;
10526            Ok(())
10527        }
10528    }
10529
10530    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryResponse {
10531        type Borrowed<'a> = &'a mut Self;
10532        fn take_or_borrow<'a>(
10533            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10534        ) -> Self::Borrowed<'a> {
10535            value
10536        }
10537    }
10538
10539    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryResponse {
10540        type Owned = Self;
10541
10542        #[inline(always)]
10543        fn inline_align(_context: fidl::encoding::Context) -> usize {
10544            4
10545        }
10546
10547        #[inline(always)]
10548        fn inline_size(_context: fidl::encoding::Context) -> usize {
10549            4
10550        }
10551    }
10552
10553    unsafe impl
10554        fidl::encoding::Encode<
10555            RealmGetChildOutputDictionaryResponse,
10556            fidl::encoding::DefaultFuchsiaResourceDialect,
10557        > for &mut RealmGetChildOutputDictionaryResponse
10558    {
10559        #[inline]
10560        unsafe fn encode(
10561            self,
10562            encoder: &mut fidl::encoding::Encoder<
10563                '_,
10564                fidl::encoding::DefaultFuchsiaResourceDialect,
10565            >,
10566            offset: usize,
10567            _depth: fidl::encoding::Depth,
10568        ) -> fidl::Result<()> {
10569            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
10570            // Delegate to tuple encoding.
10571            fidl::encoding::Encode::<
10572                RealmGetChildOutputDictionaryResponse,
10573                fidl::encoding::DefaultFuchsiaResourceDialect,
10574            >::encode(
10575                (<fidl::encoding::HandleType<
10576                    fidl::EventPair,
10577                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10578                    2147483648,
10579                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10580                    &mut self.dictionary
10581                ),),
10582                encoder,
10583                offset,
10584                _depth,
10585            )
10586        }
10587    }
10588    unsafe impl<
10589        T0: fidl::encoding::Encode<
10590                fidl::encoding::HandleType<
10591                    fidl::EventPair,
10592                    { fidl::ObjectType::EVENTPAIR.into_raw() },
10593                    2147483648,
10594                >,
10595                fidl::encoding::DefaultFuchsiaResourceDialect,
10596            >,
10597    >
10598        fidl::encoding::Encode<
10599            RealmGetChildOutputDictionaryResponse,
10600            fidl::encoding::DefaultFuchsiaResourceDialect,
10601        > for (T0,)
10602    {
10603        #[inline]
10604        unsafe fn encode(
10605            self,
10606            encoder: &mut fidl::encoding::Encoder<
10607                '_,
10608                fidl::encoding::DefaultFuchsiaResourceDialect,
10609            >,
10610            offset: usize,
10611            depth: fidl::encoding::Depth,
10612        ) -> fidl::Result<()> {
10613            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
10614            // Zero out padding regions. There's no need to apply masks
10615            // because the unmasked parts will be overwritten by fields.
10616            // Write the fields.
10617            self.0.encode(encoder, offset + 0, depth)?;
10618            Ok(())
10619        }
10620    }
10621
10622    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10623        for RealmGetChildOutputDictionaryResponse
10624    {
10625        #[inline(always)]
10626        fn new_empty() -> Self {
10627            Self {
10628                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
10629            }
10630        }
10631
10632        #[inline]
10633        unsafe fn decode(
10634            &mut self,
10635            decoder: &mut fidl::encoding::Decoder<
10636                '_,
10637                fidl::encoding::DefaultFuchsiaResourceDialect,
10638            >,
10639            offset: usize,
10640            _depth: fidl::encoding::Depth,
10641        ) -> fidl::Result<()> {
10642            decoder.debug_check_bounds::<Self>(offset);
10643            // Verify that padding bytes are zero.
10644            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
10645            Ok(())
10646        }
10647    }
10648
10649    impl fidl::encoding::ResourceTypeMarker for RealmGetResolvedInfoResponse {
10650        type Borrowed<'a> = &'a mut Self;
10651        fn take_or_borrow<'a>(
10652            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10653        ) -> Self::Borrowed<'a> {
10654            value
10655        }
10656    }
10657
10658    unsafe impl fidl::encoding::TypeMarker for RealmGetResolvedInfoResponse {
10659        type Owned = Self;
10660
10661        #[inline(always)]
10662        fn inline_align(_context: fidl::encoding::Context) -> usize {
10663            8
10664        }
10665
10666        #[inline(always)]
10667        fn inline_size(_context: fidl::encoding::Context) -> usize {
10668            16
10669        }
10670    }
10671
10672    unsafe impl
10673        fidl::encoding::Encode<
10674            RealmGetResolvedInfoResponse,
10675            fidl::encoding::DefaultFuchsiaResourceDialect,
10676        > for &mut RealmGetResolvedInfoResponse
10677    {
10678        #[inline]
10679        unsafe fn encode(
10680            self,
10681            encoder: &mut fidl::encoding::Encoder<
10682                '_,
10683                fidl::encoding::DefaultFuchsiaResourceDialect,
10684            >,
10685            offset: usize,
10686            _depth: fidl::encoding::Depth,
10687        ) -> fidl::Result<()> {
10688            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
10689            // Delegate to tuple encoding.
10690            fidl::encoding::Encode::<RealmGetResolvedInfoResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10691                (
10692                    <fidl_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resolved_info),
10693                ),
10694                encoder, offset, _depth
10695            )
10696        }
10697    }
10698    unsafe impl<
10699        T0: fidl::encoding::Encode<
10700                fidl_fuchsia_component_resolution::Component,
10701                fidl::encoding::DefaultFuchsiaResourceDialect,
10702            >,
10703    >
10704        fidl::encoding::Encode<
10705            RealmGetResolvedInfoResponse,
10706            fidl::encoding::DefaultFuchsiaResourceDialect,
10707        > for (T0,)
10708    {
10709        #[inline]
10710        unsafe fn encode(
10711            self,
10712            encoder: &mut fidl::encoding::Encoder<
10713                '_,
10714                fidl::encoding::DefaultFuchsiaResourceDialect,
10715            >,
10716            offset: usize,
10717            depth: fidl::encoding::Depth,
10718        ) -> fidl::Result<()> {
10719            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
10720            // Zero out padding regions. There's no need to apply masks
10721            // because the unmasked parts will be overwritten by fields.
10722            // Write the fields.
10723            self.0.encode(encoder, offset + 0, depth)?;
10724            Ok(())
10725        }
10726    }
10727
10728    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10729        for RealmGetResolvedInfoResponse
10730    {
10731        #[inline(always)]
10732        fn new_empty() -> Self {
10733            Self {
10734                resolved_info: fidl::new_empty!(
10735                    fidl_fuchsia_component_resolution::Component,
10736                    fidl::encoding::DefaultFuchsiaResourceDialect
10737                ),
10738            }
10739        }
10740
10741        #[inline]
10742        unsafe fn decode(
10743            &mut self,
10744            decoder: &mut fidl::encoding::Decoder<
10745                '_,
10746                fidl::encoding::DefaultFuchsiaResourceDialect,
10747            >,
10748            offset: usize,
10749            _depth: fidl::encoding::Depth,
10750        ) -> fidl::Result<()> {
10751            decoder.debug_check_bounds::<Self>(offset);
10752            // Verify that padding bytes are zero.
10753            fidl::decode!(
10754                fidl_fuchsia_component_resolution::Component,
10755                fidl::encoding::DefaultFuchsiaResourceDialect,
10756                &mut self.resolved_info,
10757                decoder,
10758                offset + 0,
10759                _depth
10760            )?;
10761            Ok(())
10762        }
10763    }
10764
10765    impl fidl::encoding::ResourceTypeMarker for StorageAdminListStorageInRealmRequest {
10766        type Borrowed<'a> = &'a mut Self;
10767        fn take_or_borrow<'a>(
10768            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10769        ) -> Self::Borrowed<'a> {
10770            value
10771        }
10772    }
10773
10774    unsafe impl fidl::encoding::TypeMarker for StorageAdminListStorageInRealmRequest {
10775        type Owned = Self;
10776
10777        #[inline(always)]
10778        fn inline_align(_context: fidl::encoding::Context) -> usize {
10779            8
10780        }
10781
10782        #[inline(always)]
10783        fn inline_size(_context: fidl::encoding::Context) -> usize {
10784            24
10785        }
10786    }
10787
10788    unsafe impl
10789        fidl::encoding::Encode<
10790            StorageAdminListStorageInRealmRequest,
10791            fidl::encoding::DefaultFuchsiaResourceDialect,
10792        > for &mut StorageAdminListStorageInRealmRequest
10793    {
10794        #[inline]
10795        unsafe fn encode(
10796            self,
10797            encoder: &mut fidl::encoding::Encoder<
10798                '_,
10799                fidl::encoding::DefaultFuchsiaResourceDialect,
10800            >,
10801            offset: usize,
10802            _depth: fidl::encoding::Depth,
10803        ) -> fidl::Result<()> {
10804            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
10805            // Delegate to tuple encoding.
10806            fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10807                (
10808                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
10809                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
10810                ),
10811                encoder, offset, _depth
10812            )
10813        }
10814    }
10815    unsafe impl<
10816        T0: fidl::encoding::Encode<
10817                fidl::encoding::BoundedString<4096>,
10818                fidl::encoding::DefaultFuchsiaResourceDialect,
10819            >,
10820        T1: fidl::encoding::Encode<
10821                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
10822                fidl::encoding::DefaultFuchsiaResourceDialect,
10823            >,
10824    >
10825        fidl::encoding::Encode<
10826            StorageAdminListStorageInRealmRequest,
10827            fidl::encoding::DefaultFuchsiaResourceDialect,
10828        > for (T0, T1)
10829    {
10830        #[inline]
10831        unsafe fn encode(
10832            self,
10833            encoder: &mut fidl::encoding::Encoder<
10834                '_,
10835                fidl::encoding::DefaultFuchsiaResourceDialect,
10836            >,
10837            offset: usize,
10838            depth: fidl::encoding::Depth,
10839        ) -> fidl::Result<()> {
10840            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
10841            // Zero out padding regions. There's no need to apply masks
10842            // because the unmasked parts will be overwritten by fields.
10843            unsafe {
10844                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10845                (ptr as *mut u64).write_unaligned(0);
10846            }
10847            // Write the fields.
10848            self.0.encode(encoder, offset + 0, depth)?;
10849            self.1.encode(encoder, offset + 16, depth)?;
10850            Ok(())
10851        }
10852    }
10853
10854    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10855        for StorageAdminListStorageInRealmRequest
10856    {
10857        #[inline(always)]
10858        fn new_empty() -> Self {
10859            Self {
10860                relative_moniker: fidl::new_empty!(
10861                    fidl::encoding::BoundedString<4096>,
10862                    fidl::encoding::DefaultFuchsiaResourceDialect
10863                ),
10864                iterator: fidl::new_empty!(
10865                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
10866                    fidl::encoding::DefaultFuchsiaResourceDialect
10867                ),
10868            }
10869        }
10870
10871        #[inline]
10872        unsafe fn decode(
10873            &mut self,
10874            decoder: &mut fidl::encoding::Decoder<
10875                '_,
10876                fidl::encoding::DefaultFuchsiaResourceDialect,
10877            >,
10878            offset: usize,
10879            _depth: fidl::encoding::Depth,
10880        ) -> fidl::Result<()> {
10881            decoder.debug_check_bounds::<Self>(offset);
10882            // Verify that padding bytes are zero.
10883            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10884            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10885            let mask = 0xffffffff00000000u64;
10886            let maskedval = padval & mask;
10887            if maskedval != 0 {
10888                return Err(fidl::Error::NonZeroPadding {
10889                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10890                });
10891            }
10892            fidl::decode!(
10893                fidl::encoding::BoundedString<4096>,
10894                fidl::encoding::DefaultFuchsiaResourceDialect,
10895                &mut self.relative_moniker,
10896                decoder,
10897                offset + 0,
10898                _depth
10899            )?;
10900            fidl::decode!(
10901                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
10902                fidl::encoding::DefaultFuchsiaResourceDialect,
10903                &mut self.iterator,
10904                decoder,
10905                offset + 16,
10906                _depth
10907            )?;
10908            Ok(())
10909        }
10910    }
10911
10912    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageByIdRequest {
10913        type Borrowed<'a> = &'a mut Self;
10914        fn take_or_borrow<'a>(
10915            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10916        ) -> Self::Borrowed<'a> {
10917            value
10918        }
10919    }
10920
10921    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageByIdRequest {
10922        type Owned = Self;
10923
10924        #[inline(always)]
10925        fn inline_align(_context: fidl::encoding::Context) -> usize {
10926            8
10927        }
10928
10929        #[inline(always)]
10930        fn inline_size(_context: fidl::encoding::Context) -> usize {
10931            24
10932        }
10933    }
10934
10935    unsafe impl
10936        fidl::encoding::Encode<
10937            StorageAdminOpenComponentStorageByIdRequest,
10938            fidl::encoding::DefaultFuchsiaResourceDialect,
10939        > for &mut StorageAdminOpenComponentStorageByIdRequest
10940    {
10941        #[inline]
10942        unsafe fn encode(
10943            self,
10944            encoder: &mut fidl::encoding::Encoder<
10945                '_,
10946                fidl::encoding::DefaultFuchsiaResourceDialect,
10947            >,
10948            offset: usize,
10949            _depth: fidl::encoding::Depth,
10950        ) -> fidl::Result<()> {
10951            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
10952            // Delegate to tuple encoding.
10953            fidl::encoding::Encode::<
10954                StorageAdminOpenComponentStorageByIdRequest,
10955                fidl::encoding::DefaultFuchsiaResourceDialect,
10956            >::encode(
10957                (
10958                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
10959                        &self.id,
10960                    ),
10961                    <fidl::encoding::Endpoint<
10962                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
10963                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
10964                        &mut self.object
10965                    ),
10966                ),
10967                encoder,
10968                offset,
10969                _depth,
10970            )
10971        }
10972    }
10973    unsafe impl<
10974        T0: fidl::encoding::Encode<
10975                fidl::encoding::BoundedString<64>,
10976                fidl::encoding::DefaultFuchsiaResourceDialect,
10977            >,
10978        T1: fidl::encoding::Encode<
10979                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
10980                fidl::encoding::DefaultFuchsiaResourceDialect,
10981            >,
10982    >
10983        fidl::encoding::Encode<
10984            StorageAdminOpenComponentStorageByIdRequest,
10985            fidl::encoding::DefaultFuchsiaResourceDialect,
10986        > for (T0, T1)
10987    {
10988        #[inline]
10989        unsafe fn encode(
10990            self,
10991            encoder: &mut fidl::encoding::Encoder<
10992                '_,
10993                fidl::encoding::DefaultFuchsiaResourceDialect,
10994            >,
10995            offset: usize,
10996            depth: fidl::encoding::Depth,
10997        ) -> fidl::Result<()> {
10998            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
10999            // Zero out padding regions. There's no need to apply masks
11000            // because the unmasked parts will be overwritten by fields.
11001            unsafe {
11002                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11003                (ptr as *mut u64).write_unaligned(0);
11004            }
11005            // Write the fields.
11006            self.0.encode(encoder, offset + 0, depth)?;
11007            self.1.encode(encoder, offset + 16, depth)?;
11008            Ok(())
11009        }
11010    }
11011
11012    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11013        for StorageAdminOpenComponentStorageByIdRequest
11014    {
11015        #[inline(always)]
11016        fn new_empty() -> Self {
11017            Self {
11018                id: fidl::new_empty!(
11019                    fidl::encoding::BoundedString<64>,
11020                    fidl::encoding::DefaultFuchsiaResourceDialect
11021                ),
11022                object: fidl::new_empty!(
11023                    fidl::encoding::Endpoint<
11024                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11025                    >,
11026                    fidl::encoding::DefaultFuchsiaResourceDialect
11027                ),
11028            }
11029        }
11030
11031        #[inline]
11032        unsafe fn decode(
11033            &mut self,
11034            decoder: &mut fidl::encoding::Decoder<
11035                '_,
11036                fidl::encoding::DefaultFuchsiaResourceDialect,
11037            >,
11038            offset: usize,
11039            _depth: fidl::encoding::Depth,
11040        ) -> fidl::Result<()> {
11041            decoder.debug_check_bounds::<Self>(offset);
11042            // Verify that padding bytes are zero.
11043            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11044            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11045            let mask = 0xffffffff00000000u64;
11046            let maskedval = padval & mask;
11047            if maskedval != 0 {
11048                return Err(fidl::Error::NonZeroPadding {
11049                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11050                });
11051            }
11052            fidl::decode!(
11053                fidl::encoding::BoundedString<64>,
11054                fidl::encoding::DefaultFuchsiaResourceDialect,
11055                &mut self.id,
11056                decoder,
11057                offset + 0,
11058                _depth
11059            )?;
11060            fidl::decode!(
11061                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11062                fidl::encoding::DefaultFuchsiaResourceDialect,
11063                &mut self.object,
11064                decoder,
11065                offset + 16,
11066                _depth
11067            )?;
11068            Ok(())
11069        }
11070    }
11071
11072    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenStorageRequest {
11073        type Borrowed<'a> = &'a mut Self;
11074        fn take_or_borrow<'a>(
11075            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11076        ) -> Self::Borrowed<'a> {
11077            value
11078        }
11079    }
11080
11081    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenStorageRequest {
11082        type Owned = Self;
11083
11084        #[inline(always)]
11085        fn inline_align(_context: fidl::encoding::Context) -> usize {
11086            8
11087        }
11088
11089        #[inline(always)]
11090        fn inline_size(_context: fidl::encoding::Context) -> usize {
11091            24
11092        }
11093    }
11094
11095    unsafe impl
11096        fidl::encoding::Encode<
11097            StorageAdminOpenStorageRequest,
11098            fidl::encoding::DefaultFuchsiaResourceDialect,
11099        > for &mut StorageAdminOpenStorageRequest
11100    {
11101        #[inline]
11102        unsafe fn encode(
11103            self,
11104            encoder: &mut fidl::encoding::Encoder<
11105                '_,
11106                fidl::encoding::DefaultFuchsiaResourceDialect,
11107            >,
11108            offset: usize,
11109            _depth: fidl::encoding::Depth,
11110        ) -> fidl::Result<()> {
11111            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
11112            // Delegate to tuple encoding.
11113            fidl::encoding::Encode::<StorageAdminOpenStorageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11114                (
11115                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
11116                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
11117                ),
11118                encoder, offset, _depth
11119            )
11120        }
11121    }
11122    unsafe impl<
11123        T0: fidl::encoding::Encode<
11124                fidl::encoding::BoundedString<4096>,
11125                fidl::encoding::DefaultFuchsiaResourceDialect,
11126            >,
11127        T1: fidl::encoding::Encode<
11128                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11129                fidl::encoding::DefaultFuchsiaResourceDialect,
11130            >,
11131    >
11132        fidl::encoding::Encode<
11133            StorageAdminOpenStorageRequest,
11134            fidl::encoding::DefaultFuchsiaResourceDialect,
11135        > for (T0, T1)
11136    {
11137        #[inline]
11138        unsafe fn encode(
11139            self,
11140            encoder: &mut fidl::encoding::Encoder<
11141                '_,
11142                fidl::encoding::DefaultFuchsiaResourceDialect,
11143            >,
11144            offset: usize,
11145            depth: fidl::encoding::Depth,
11146        ) -> fidl::Result<()> {
11147            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
11148            // Zero out padding regions. There's no need to apply masks
11149            // because the unmasked parts will be overwritten by fields.
11150            unsafe {
11151                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11152                (ptr as *mut u64).write_unaligned(0);
11153            }
11154            // Write the fields.
11155            self.0.encode(encoder, offset + 0, depth)?;
11156            self.1.encode(encoder, offset + 16, depth)?;
11157            Ok(())
11158        }
11159    }
11160
11161    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11162        for StorageAdminOpenStorageRequest
11163    {
11164        #[inline(always)]
11165        fn new_empty() -> Self {
11166            Self {
11167                relative_moniker: fidl::new_empty!(
11168                    fidl::encoding::BoundedString<4096>,
11169                    fidl::encoding::DefaultFuchsiaResourceDialect
11170                ),
11171                object: fidl::new_empty!(
11172                    fidl::encoding::Endpoint<
11173                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11174                    >,
11175                    fidl::encoding::DefaultFuchsiaResourceDialect
11176                ),
11177            }
11178        }
11179
11180        #[inline]
11181        unsafe fn decode(
11182            &mut self,
11183            decoder: &mut fidl::encoding::Decoder<
11184                '_,
11185                fidl::encoding::DefaultFuchsiaResourceDialect,
11186            >,
11187            offset: usize,
11188            _depth: fidl::encoding::Depth,
11189        ) -> fidl::Result<()> {
11190            decoder.debug_check_bounds::<Self>(offset);
11191            // Verify that padding bytes are zero.
11192            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11193            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11194            let mask = 0xffffffff00000000u64;
11195            let maskedval = padval & mask;
11196            if maskedval != 0 {
11197                return Err(fidl::Error::NonZeroPadding {
11198                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11199                });
11200            }
11201            fidl::decode!(
11202                fidl::encoding::BoundedString<4096>,
11203                fidl::encoding::DefaultFuchsiaResourceDialect,
11204                &mut self.relative_moniker,
11205                decoder,
11206                offset + 0,
11207                _depth
11208            )?;
11209            fidl::decode!(
11210                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11211                fidl::encoding::DefaultFuchsiaResourceDialect,
11212                &mut self.object,
11213                decoder,
11214                offset + 16,
11215                _depth
11216            )?;
11217            Ok(())
11218        }
11219    }
11220
11221    impl CapabilityRequestedPayload {
11222        #[inline(always)]
11223        fn max_ordinal_present(&self) -> u64 {
11224            if let Some(_) = self.capability {
11225                return 2;
11226            }
11227            if let Some(_) = self.name {
11228                return 1;
11229            }
11230            0
11231        }
11232    }
11233
11234    impl fidl::encoding::ResourceTypeMarker for CapabilityRequestedPayload {
11235        type Borrowed<'a> = &'a mut Self;
11236        fn take_or_borrow<'a>(
11237            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11238        ) -> Self::Borrowed<'a> {
11239            value
11240        }
11241    }
11242
11243    unsafe impl fidl::encoding::TypeMarker for CapabilityRequestedPayload {
11244        type Owned = Self;
11245
11246        #[inline(always)]
11247        fn inline_align(_context: fidl::encoding::Context) -> usize {
11248            8
11249        }
11250
11251        #[inline(always)]
11252        fn inline_size(_context: fidl::encoding::Context) -> usize {
11253            16
11254        }
11255    }
11256
11257    unsafe impl
11258        fidl::encoding::Encode<
11259            CapabilityRequestedPayload,
11260            fidl::encoding::DefaultFuchsiaResourceDialect,
11261        > for &mut CapabilityRequestedPayload
11262    {
11263        unsafe fn encode(
11264            self,
11265            encoder: &mut fidl::encoding::Encoder<
11266                '_,
11267                fidl::encoding::DefaultFuchsiaResourceDialect,
11268            >,
11269            offset: usize,
11270            mut depth: fidl::encoding::Depth,
11271        ) -> fidl::Result<()> {
11272            encoder.debug_check_bounds::<CapabilityRequestedPayload>(offset);
11273            // Vector header
11274            let max_ordinal: u64 = self.max_ordinal_present();
11275            encoder.write_num(max_ordinal, offset);
11276            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11277            // Calling encoder.out_of_line_offset(0) is not allowed.
11278            if max_ordinal == 0 {
11279                return Ok(());
11280            }
11281            depth.increment()?;
11282            let envelope_size = 8;
11283            let bytes_len = max_ordinal as usize * envelope_size;
11284            #[allow(unused_variables)]
11285            let offset = encoder.out_of_line_offset(bytes_len);
11286            let mut _prev_end_offset: usize = 0;
11287            if 1 > max_ordinal {
11288                return Ok(());
11289            }
11290
11291            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11292            // are envelope_size bytes.
11293            let cur_offset: usize = (1 - 1) * envelope_size;
11294
11295            // Zero reserved fields.
11296            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11297
11298            // Safety:
11299            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11300            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11301            //   envelope_size bytes, there is always sufficient room.
11302            fidl::encoding::encode_in_envelope_optional::<
11303                fidl::encoding::BoundedString<255>,
11304                fidl::encoding::DefaultFuchsiaResourceDialect,
11305            >(
11306                self.name.as_ref().map(
11307                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
11308                ),
11309                encoder,
11310                offset + cur_offset,
11311                depth,
11312            )?;
11313
11314            _prev_end_offset = cur_offset + envelope_size;
11315            if 2 > max_ordinal {
11316                return Ok(());
11317            }
11318
11319            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11320            // are envelope_size bytes.
11321            let cur_offset: usize = (2 - 1) * envelope_size;
11322
11323            // Zero reserved fields.
11324            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11325
11326            // Safety:
11327            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11328            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11329            //   envelope_size bytes, there is always sufficient room.
11330            fidl::encoding::encode_in_envelope_optional::<
11331                fidl::encoding::HandleType<
11332                    fidl::Channel,
11333                    { fidl::ObjectType::CHANNEL.into_raw() },
11334                    2147483648,
11335                >,
11336                fidl::encoding::DefaultFuchsiaResourceDialect,
11337            >(
11338                self.capability.as_mut().map(
11339                    <fidl::encoding::HandleType<
11340                        fidl::Channel,
11341                        { fidl::ObjectType::CHANNEL.into_raw() },
11342                        2147483648,
11343                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11344                ),
11345                encoder,
11346                offset + cur_offset,
11347                depth,
11348            )?;
11349
11350            _prev_end_offset = cur_offset + envelope_size;
11351
11352            Ok(())
11353        }
11354    }
11355
11356    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11357        for CapabilityRequestedPayload
11358    {
11359        #[inline(always)]
11360        fn new_empty() -> Self {
11361            Self::default()
11362        }
11363
11364        unsafe fn decode(
11365            &mut self,
11366            decoder: &mut fidl::encoding::Decoder<
11367                '_,
11368                fidl::encoding::DefaultFuchsiaResourceDialect,
11369            >,
11370            offset: usize,
11371            mut depth: fidl::encoding::Depth,
11372        ) -> fidl::Result<()> {
11373            decoder.debug_check_bounds::<Self>(offset);
11374            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11375                None => return Err(fidl::Error::NotNullable),
11376                Some(len) => len,
11377            };
11378            // Calling decoder.out_of_line_offset(0) is not allowed.
11379            if len == 0 {
11380                return Ok(());
11381            };
11382            depth.increment()?;
11383            let envelope_size = 8;
11384            let bytes_len = len * envelope_size;
11385            let offset = decoder.out_of_line_offset(bytes_len)?;
11386            // Decode the envelope for each type.
11387            let mut _next_ordinal_to_read = 0;
11388            let mut next_offset = offset;
11389            let end_offset = offset + bytes_len;
11390            _next_ordinal_to_read += 1;
11391            if next_offset >= end_offset {
11392                return Ok(());
11393            }
11394
11395            // Decode unknown envelopes for gaps in ordinals.
11396            while _next_ordinal_to_read < 1 {
11397                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11398                _next_ordinal_to_read += 1;
11399                next_offset += envelope_size;
11400            }
11401
11402            let next_out_of_line = decoder.next_out_of_line();
11403            let handles_before = decoder.remaining_handles();
11404            if let Some((inlined, num_bytes, num_handles)) =
11405                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11406            {
11407                let member_inline_size =
11408                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
11409                        decoder.context,
11410                    );
11411                if inlined != (member_inline_size <= 4) {
11412                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11413                }
11414                let inner_offset;
11415                let mut inner_depth = depth.clone();
11416                if inlined {
11417                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11418                    inner_offset = next_offset;
11419                } else {
11420                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11421                    inner_depth.increment()?;
11422                }
11423                let val_ref = self.name.get_or_insert_with(|| {
11424                    fidl::new_empty!(
11425                        fidl::encoding::BoundedString<255>,
11426                        fidl::encoding::DefaultFuchsiaResourceDialect
11427                    )
11428                });
11429                fidl::decode!(
11430                    fidl::encoding::BoundedString<255>,
11431                    fidl::encoding::DefaultFuchsiaResourceDialect,
11432                    val_ref,
11433                    decoder,
11434                    inner_offset,
11435                    inner_depth
11436                )?;
11437                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11438                {
11439                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11440                }
11441                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11442                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11443                }
11444            }
11445
11446            next_offset += envelope_size;
11447            _next_ordinal_to_read += 1;
11448            if next_offset >= end_offset {
11449                return Ok(());
11450            }
11451
11452            // Decode unknown envelopes for gaps in ordinals.
11453            while _next_ordinal_to_read < 2 {
11454                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11455                _next_ordinal_to_read += 1;
11456                next_offset += envelope_size;
11457            }
11458
11459            let next_out_of_line = decoder.next_out_of_line();
11460            let handles_before = decoder.remaining_handles();
11461            if let Some((inlined, num_bytes, num_handles)) =
11462                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11463            {
11464                let member_inline_size = <fidl::encoding::HandleType<
11465                    fidl::Channel,
11466                    { fidl::ObjectType::CHANNEL.into_raw() },
11467                    2147483648,
11468                > as fidl::encoding::TypeMarker>::inline_size(
11469                    decoder.context
11470                );
11471                if inlined != (member_inline_size <= 4) {
11472                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11473                }
11474                let inner_offset;
11475                let mut inner_depth = depth.clone();
11476                if inlined {
11477                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11478                    inner_offset = next_offset;
11479                } else {
11480                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11481                    inner_depth.increment()?;
11482                }
11483                let val_ref =
11484                self.capability.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
11485                fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11486                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11487                {
11488                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11489                }
11490                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11491                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11492                }
11493            }
11494
11495            next_offset += envelope_size;
11496
11497            // Decode the remaining unknown envelopes.
11498            while next_offset < end_offset {
11499                _next_ordinal_to_read += 1;
11500                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11501                next_offset += envelope_size;
11502            }
11503
11504            Ok(())
11505        }
11506    }
11507
11508    impl CreateChildArgs {
11509        #[inline(always)]
11510        fn max_ordinal_present(&self) -> u64 {
11511            if let Some(_) = self.additional_inputs {
11512                return 5;
11513            }
11514            if let Some(_) = self.dictionary {
11515                return 4;
11516            }
11517            if let Some(_) = self.controller {
11518                return 3;
11519            }
11520            if let Some(_) = self.dynamic_offers {
11521                return 2;
11522            }
11523            if let Some(_) = self.numbered_handles {
11524                return 1;
11525            }
11526            0
11527        }
11528    }
11529
11530    impl fidl::encoding::ResourceTypeMarker for CreateChildArgs {
11531        type Borrowed<'a> = &'a mut Self;
11532        fn take_or_borrow<'a>(
11533            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11534        ) -> Self::Borrowed<'a> {
11535            value
11536        }
11537    }
11538
11539    unsafe impl fidl::encoding::TypeMarker for CreateChildArgs {
11540        type Owned = Self;
11541
11542        #[inline(always)]
11543        fn inline_align(_context: fidl::encoding::Context) -> usize {
11544            8
11545        }
11546
11547        #[inline(always)]
11548        fn inline_size(_context: fidl::encoding::Context) -> usize {
11549            16
11550        }
11551    }
11552
11553    unsafe impl
11554        fidl::encoding::Encode<CreateChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
11555        for &mut CreateChildArgs
11556    {
11557        unsafe fn encode(
11558            self,
11559            encoder: &mut fidl::encoding::Encoder<
11560                '_,
11561                fidl::encoding::DefaultFuchsiaResourceDialect,
11562            >,
11563            offset: usize,
11564            mut depth: fidl::encoding::Depth,
11565        ) -> fidl::Result<()> {
11566            encoder.debug_check_bounds::<CreateChildArgs>(offset);
11567            // Vector header
11568            let max_ordinal: u64 = self.max_ordinal_present();
11569            encoder.write_num(max_ordinal, offset);
11570            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11571            // Calling encoder.out_of_line_offset(0) is not allowed.
11572            if max_ordinal == 0 {
11573                return Ok(());
11574            }
11575            depth.increment()?;
11576            let envelope_size = 8;
11577            let bytes_len = max_ordinal as usize * envelope_size;
11578            #[allow(unused_variables)]
11579            let offset = encoder.out_of_line_offset(bytes_len);
11580            let mut _prev_end_offset: usize = 0;
11581            if 1 > max_ordinal {
11582                return Ok(());
11583            }
11584
11585            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11586            // are envelope_size bytes.
11587            let cur_offset: usize = (1 - 1) * envelope_size;
11588
11589            // Zero reserved fields.
11590            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11591
11592            // Safety:
11593            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11594            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11595            //   envelope_size bytes, there is always sufficient room.
11596            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11597            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11598            encoder, offset + cur_offset, depth
11599        )?;
11600
11601            _prev_end_offset = cur_offset + envelope_size;
11602            if 2 > max_ordinal {
11603                return Ok(());
11604            }
11605
11606            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11607            // are envelope_size bytes.
11608            let cur_offset: usize = (2 - 1) * envelope_size;
11609
11610            // Zero reserved fields.
11611            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11612
11613            // Safety:
11614            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11615            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11616            //   envelope_size bytes, there is always sufficient room.
11617            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11618            self.dynamic_offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow),
11619            encoder, offset + cur_offset, depth
11620        )?;
11621
11622            _prev_end_offset = cur_offset + envelope_size;
11623            if 3 > max_ordinal {
11624                return Ok(());
11625            }
11626
11627            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11628            // are envelope_size bytes.
11629            let cur_offset: usize = (3 - 1) * envelope_size;
11630
11631            // Zero reserved fields.
11632            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11633
11634            // Safety:
11635            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11636            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11637            //   envelope_size bytes, there is always sufficient room.
11638            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
11639            self.controller.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11640            encoder, offset + cur_offset, depth
11641        )?;
11642
11643            _prev_end_offset = cur_offset + envelope_size;
11644            if 4 > max_ordinal {
11645                return Ok(());
11646            }
11647
11648            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11649            // are envelope_size bytes.
11650            let cur_offset: usize = (4 - 1) * envelope_size;
11651
11652            // Zero reserved fields.
11653            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11654
11655            // Safety:
11656            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11657            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11658            //   envelope_size bytes, there is always sufficient room.
11659            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
11660            self.dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
11661            encoder, offset + cur_offset, depth
11662        )?;
11663
11664            _prev_end_offset = cur_offset + envelope_size;
11665            if 5 > max_ordinal {
11666                return Ok(());
11667            }
11668
11669            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11670            // are envelope_size bytes.
11671            let cur_offset: usize = (5 - 1) * envelope_size;
11672
11673            // Zero reserved fields.
11674            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11675
11676            // Safety:
11677            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11678            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11679            //   envelope_size bytes, there is always sufficient room.
11680            fidl::encoding::encode_in_envelope_optional::<
11681                fidl::encoding::HandleType<
11682                    fidl::EventPair,
11683                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11684                    2147483648,
11685                >,
11686                fidl::encoding::DefaultFuchsiaResourceDialect,
11687            >(
11688                self.additional_inputs.as_mut().map(
11689                    <fidl::encoding::HandleType<
11690                        fidl::EventPair,
11691                        { fidl::ObjectType::EVENTPAIR.into_raw() },
11692                        2147483648,
11693                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11694                ),
11695                encoder,
11696                offset + cur_offset,
11697                depth,
11698            )?;
11699
11700            _prev_end_offset = cur_offset + envelope_size;
11701
11702            Ok(())
11703        }
11704    }
11705
11706    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11707        for CreateChildArgs
11708    {
11709        #[inline(always)]
11710        fn new_empty() -> Self {
11711            Self::default()
11712        }
11713
11714        unsafe fn decode(
11715            &mut self,
11716            decoder: &mut fidl::encoding::Decoder<
11717                '_,
11718                fidl::encoding::DefaultFuchsiaResourceDialect,
11719            >,
11720            offset: usize,
11721            mut depth: fidl::encoding::Depth,
11722        ) -> fidl::Result<()> {
11723            decoder.debug_check_bounds::<Self>(offset);
11724            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11725                None => return Err(fidl::Error::NotNullable),
11726                Some(len) => len,
11727            };
11728            // Calling decoder.out_of_line_offset(0) is not allowed.
11729            if len == 0 {
11730                return Ok(());
11731            };
11732            depth.increment()?;
11733            let envelope_size = 8;
11734            let bytes_len = len * envelope_size;
11735            let offset = decoder.out_of_line_offset(bytes_len)?;
11736            // Decode the envelope for each type.
11737            let mut _next_ordinal_to_read = 0;
11738            let mut next_offset = offset;
11739            let end_offset = offset + bytes_len;
11740            _next_ordinal_to_read += 1;
11741            if next_offset >= end_offset {
11742                return Ok(());
11743            }
11744
11745            // Decode unknown envelopes for gaps in ordinals.
11746            while _next_ordinal_to_read < 1 {
11747                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11748                _next_ordinal_to_read += 1;
11749                next_offset += envelope_size;
11750            }
11751
11752            let next_out_of_line = decoder.next_out_of_line();
11753            let handles_before = decoder.remaining_handles();
11754            if let Some((inlined, num_bytes, num_handles)) =
11755                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11756            {
11757                let member_inline_size = <fidl::encoding::Vector<
11758                    fidl_fuchsia_process::HandleInfo,
11759                    128,
11760                > as fidl::encoding::TypeMarker>::inline_size(
11761                    decoder.context
11762                );
11763                if inlined != (member_inline_size <= 4) {
11764                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11765                }
11766                let inner_offset;
11767                let mut inner_depth = depth.clone();
11768                if inlined {
11769                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11770                    inner_offset = next_offset;
11771                } else {
11772                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11773                    inner_depth.increment()?;
11774                }
11775                let val_ref =
11776                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
11777                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11778                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11779                {
11780                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11781                }
11782                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11783                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11784                }
11785            }
11786
11787            next_offset += envelope_size;
11788            _next_ordinal_to_read += 1;
11789            if next_offset >= end_offset {
11790                return Ok(());
11791            }
11792
11793            // Decode unknown envelopes for gaps in ordinals.
11794            while _next_ordinal_to_read < 2 {
11795                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11796                _next_ordinal_to_read += 1;
11797                next_offset += envelope_size;
11798            }
11799
11800            let next_out_of_line = decoder.next_out_of_line();
11801            let handles_before = decoder.remaining_handles();
11802            if let Some((inlined, num_bytes, num_handles)) =
11803                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11804            {
11805                let member_inline_size = <fidl::encoding::Vector<
11806                    fidl_fuchsia_component_decl::Offer,
11807                    128,
11808                > as fidl::encoding::TypeMarker>::inline_size(
11809                    decoder.context
11810                );
11811                if inlined != (member_inline_size <= 4) {
11812                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11813                }
11814                let inner_offset;
11815                let mut inner_depth = depth.clone();
11816                if inlined {
11817                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11818                    inner_offset = next_offset;
11819                } else {
11820                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11821                    inner_depth.increment()?;
11822                }
11823                let val_ref =
11824                self.dynamic_offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
11825                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11826                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11827                {
11828                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11829                }
11830                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11831                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11832                }
11833            }
11834
11835            next_offset += envelope_size;
11836            _next_ordinal_to_read += 1;
11837            if next_offset >= end_offset {
11838                return Ok(());
11839            }
11840
11841            // Decode unknown envelopes for gaps in ordinals.
11842            while _next_ordinal_to_read < 3 {
11843                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11844                _next_ordinal_to_read += 1;
11845                next_offset += envelope_size;
11846            }
11847
11848            let next_out_of_line = decoder.next_out_of_line();
11849            let handles_before = decoder.remaining_handles();
11850            if let Some((inlined, num_bytes, num_handles)) =
11851                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11852            {
11853                let member_inline_size = <fidl::encoding::Endpoint<
11854                    fidl::endpoints::ServerEnd<ControllerMarker>,
11855                > as fidl::encoding::TypeMarker>::inline_size(
11856                    decoder.context
11857                );
11858                if inlined != (member_inline_size <= 4) {
11859                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11860                }
11861                let inner_offset;
11862                let mut inner_depth = depth.clone();
11863                if inlined {
11864                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11865                    inner_offset = next_offset;
11866                } else {
11867                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11868                    inner_depth.increment()?;
11869                }
11870                let val_ref = self.controller.get_or_insert_with(|| {
11871                    fidl::new_empty!(
11872                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
11873                        fidl::encoding::DefaultFuchsiaResourceDialect
11874                    )
11875                });
11876                fidl::decode!(
11877                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
11878                    fidl::encoding::DefaultFuchsiaResourceDialect,
11879                    val_ref,
11880                    decoder,
11881                    inner_offset,
11882                    inner_depth
11883                )?;
11884                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11885                {
11886                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11887                }
11888                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11889                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11890                }
11891            }
11892
11893            next_offset += envelope_size;
11894            _next_ordinal_to_read += 1;
11895            if next_offset >= end_offset {
11896                return Ok(());
11897            }
11898
11899            // Decode unknown envelopes for gaps in ordinals.
11900            while _next_ordinal_to_read < 4 {
11901                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11902                _next_ordinal_to_read += 1;
11903                next_offset += envelope_size;
11904            }
11905
11906            let next_out_of_line = decoder.next_out_of_line();
11907            let handles_before = decoder.remaining_handles();
11908            if let Some((inlined, num_bytes, num_handles)) =
11909                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11910            {
11911                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11912                if inlined != (member_inline_size <= 4) {
11913                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11914                }
11915                let inner_offset;
11916                let mut inner_depth = depth.clone();
11917                if inlined {
11918                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11919                    inner_offset = next_offset;
11920                } else {
11921                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11922                    inner_depth.increment()?;
11923                }
11924                let val_ref = self.dictionary.get_or_insert_with(|| {
11925                    fidl::new_empty!(
11926                        fidl_fuchsia_component_sandbox::DictionaryRef,
11927                        fidl::encoding::DefaultFuchsiaResourceDialect
11928                    )
11929                });
11930                fidl::decode!(
11931                    fidl_fuchsia_component_sandbox::DictionaryRef,
11932                    fidl::encoding::DefaultFuchsiaResourceDialect,
11933                    val_ref,
11934                    decoder,
11935                    inner_offset,
11936                    inner_depth
11937                )?;
11938                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11939                {
11940                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11941                }
11942                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11943                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11944                }
11945            }
11946
11947            next_offset += envelope_size;
11948            _next_ordinal_to_read += 1;
11949            if next_offset >= end_offset {
11950                return Ok(());
11951            }
11952
11953            // Decode unknown envelopes for gaps in ordinals.
11954            while _next_ordinal_to_read < 5 {
11955                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11956                _next_ordinal_to_read += 1;
11957                next_offset += envelope_size;
11958            }
11959
11960            let next_out_of_line = decoder.next_out_of_line();
11961            let handles_before = decoder.remaining_handles();
11962            if let Some((inlined, num_bytes, num_handles)) =
11963                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11964            {
11965                let member_inline_size = <fidl::encoding::HandleType<
11966                    fidl::EventPair,
11967                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11968                    2147483648,
11969                > as fidl::encoding::TypeMarker>::inline_size(
11970                    decoder.context
11971                );
11972                if inlined != (member_inline_size <= 4) {
11973                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11974                }
11975                let inner_offset;
11976                let mut inner_depth = depth.clone();
11977                if inlined {
11978                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11979                    inner_offset = next_offset;
11980                } else {
11981                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11982                    inner_depth.increment()?;
11983                }
11984                let val_ref =
11985                self.additional_inputs.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
11986                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
11987                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11988                {
11989                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11990                }
11991                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11992                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11993                }
11994            }
11995
11996            next_offset += envelope_size;
11997
11998            // Decode the remaining unknown envelopes.
11999            while next_offset < end_offset {
12000                _next_ordinal_to_read += 1;
12001                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12002                next_offset += envelope_size;
12003            }
12004
12005            Ok(())
12006        }
12007    }
12008
12009    impl DebugStartedPayload {
12010        #[inline(always)]
12011        fn max_ordinal_present(&self) -> u64 {
12012            if let Some(_) = self.break_on_start {
12013                return 2;
12014            }
12015            if let Some(_) = self.runtime_dir {
12016                return 1;
12017            }
12018            0
12019        }
12020    }
12021
12022    impl fidl::encoding::ResourceTypeMarker for DebugStartedPayload {
12023        type Borrowed<'a> = &'a mut Self;
12024        fn take_or_borrow<'a>(
12025            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12026        ) -> Self::Borrowed<'a> {
12027            value
12028        }
12029    }
12030
12031    unsafe impl fidl::encoding::TypeMarker for DebugStartedPayload {
12032        type Owned = Self;
12033
12034        #[inline(always)]
12035        fn inline_align(_context: fidl::encoding::Context) -> usize {
12036            8
12037        }
12038
12039        #[inline(always)]
12040        fn inline_size(_context: fidl::encoding::Context) -> usize {
12041            16
12042        }
12043    }
12044
12045    unsafe impl
12046        fidl::encoding::Encode<DebugStartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
12047        for &mut DebugStartedPayload
12048    {
12049        unsafe fn encode(
12050            self,
12051            encoder: &mut fidl::encoding::Encoder<
12052                '_,
12053                fidl::encoding::DefaultFuchsiaResourceDialect,
12054            >,
12055            offset: usize,
12056            mut depth: fidl::encoding::Depth,
12057        ) -> fidl::Result<()> {
12058            encoder.debug_check_bounds::<DebugStartedPayload>(offset);
12059            // Vector header
12060            let max_ordinal: u64 = self.max_ordinal_present();
12061            encoder.write_num(max_ordinal, offset);
12062            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12063            // Calling encoder.out_of_line_offset(0) is not allowed.
12064            if max_ordinal == 0 {
12065                return Ok(());
12066            }
12067            depth.increment()?;
12068            let envelope_size = 8;
12069            let bytes_len = max_ordinal as usize * envelope_size;
12070            #[allow(unused_variables)]
12071            let offset = encoder.out_of_line_offset(bytes_len);
12072            let mut _prev_end_offset: usize = 0;
12073            if 1 > max_ordinal {
12074                return Ok(());
12075            }
12076
12077            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12078            // are envelope_size bytes.
12079            let cur_offset: usize = (1 - 1) * envelope_size;
12080
12081            // Zero reserved fields.
12082            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12083
12084            // Safety:
12085            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12086            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12087            //   envelope_size bytes, there is always sufficient room.
12088            fidl::encoding::encode_in_envelope_optional::<
12089                fidl::encoding::Endpoint<
12090                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12091                >,
12092                fidl::encoding::DefaultFuchsiaResourceDialect,
12093            >(
12094                self.runtime_dir.as_mut().map(
12095                    <fidl::encoding::Endpoint<
12096                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12097                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12098                ),
12099                encoder,
12100                offset + cur_offset,
12101                depth,
12102            )?;
12103
12104            _prev_end_offset = cur_offset + envelope_size;
12105            if 2 > max_ordinal {
12106                return Ok(());
12107            }
12108
12109            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12110            // are envelope_size bytes.
12111            let cur_offset: usize = (2 - 1) * envelope_size;
12112
12113            // Zero reserved fields.
12114            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12115
12116            // Safety:
12117            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12118            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12119            //   envelope_size bytes, there is always sufficient room.
12120            fidl::encoding::encode_in_envelope_optional::<
12121                fidl::encoding::HandleType<
12122                    fidl::EventPair,
12123                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12124                    2147483648,
12125                >,
12126                fidl::encoding::DefaultFuchsiaResourceDialect,
12127            >(
12128                self.break_on_start.as_mut().map(
12129                    <fidl::encoding::HandleType<
12130                        fidl::EventPair,
12131                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12132                        2147483648,
12133                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12134                ),
12135                encoder,
12136                offset + cur_offset,
12137                depth,
12138            )?;
12139
12140            _prev_end_offset = cur_offset + envelope_size;
12141
12142            Ok(())
12143        }
12144    }
12145
12146    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12147        for DebugStartedPayload
12148    {
12149        #[inline(always)]
12150        fn new_empty() -> Self {
12151            Self::default()
12152        }
12153
12154        unsafe fn decode(
12155            &mut self,
12156            decoder: &mut fidl::encoding::Decoder<
12157                '_,
12158                fidl::encoding::DefaultFuchsiaResourceDialect,
12159            >,
12160            offset: usize,
12161            mut depth: fidl::encoding::Depth,
12162        ) -> fidl::Result<()> {
12163            decoder.debug_check_bounds::<Self>(offset);
12164            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12165                None => return Err(fidl::Error::NotNullable),
12166                Some(len) => len,
12167            };
12168            // Calling decoder.out_of_line_offset(0) is not allowed.
12169            if len == 0 {
12170                return Ok(());
12171            };
12172            depth.increment()?;
12173            let envelope_size = 8;
12174            let bytes_len = len * envelope_size;
12175            let offset = decoder.out_of_line_offset(bytes_len)?;
12176            // Decode the envelope for each type.
12177            let mut _next_ordinal_to_read = 0;
12178            let mut next_offset = offset;
12179            let end_offset = offset + bytes_len;
12180            _next_ordinal_to_read += 1;
12181            if next_offset >= end_offset {
12182                return Ok(());
12183            }
12184
12185            // Decode unknown envelopes for gaps in ordinals.
12186            while _next_ordinal_to_read < 1 {
12187                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12188                _next_ordinal_to_read += 1;
12189                next_offset += envelope_size;
12190            }
12191
12192            let next_out_of_line = decoder.next_out_of_line();
12193            let handles_before = decoder.remaining_handles();
12194            if let Some((inlined, num_bytes, num_handles)) =
12195                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12196            {
12197                let member_inline_size = <fidl::encoding::Endpoint<
12198                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12199                > as fidl::encoding::TypeMarker>::inline_size(
12200                    decoder.context
12201                );
12202                if inlined != (member_inline_size <= 4) {
12203                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12204                }
12205                let inner_offset;
12206                let mut inner_depth = depth.clone();
12207                if inlined {
12208                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12209                    inner_offset = next_offset;
12210                } else {
12211                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12212                    inner_depth.increment()?;
12213                }
12214                let val_ref = self.runtime_dir.get_or_insert_with(|| {
12215                    fidl::new_empty!(
12216                        fidl::encoding::Endpoint<
12217                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12218                        >,
12219                        fidl::encoding::DefaultFuchsiaResourceDialect
12220                    )
12221                });
12222                fidl::decode!(
12223                    fidl::encoding::Endpoint<
12224                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12225                    >,
12226                    fidl::encoding::DefaultFuchsiaResourceDialect,
12227                    val_ref,
12228                    decoder,
12229                    inner_offset,
12230                    inner_depth
12231                )?;
12232                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12233                {
12234                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12235                }
12236                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12237                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12238                }
12239            }
12240
12241            next_offset += envelope_size;
12242            _next_ordinal_to_read += 1;
12243            if next_offset >= end_offset {
12244                return Ok(());
12245            }
12246
12247            // Decode unknown envelopes for gaps in ordinals.
12248            while _next_ordinal_to_read < 2 {
12249                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12250                _next_ordinal_to_read += 1;
12251                next_offset += envelope_size;
12252            }
12253
12254            let next_out_of_line = decoder.next_out_of_line();
12255            let handles_before = decoder.remaining_handles();
12256            if let Some((inlined, num_bytes, num_handles)) =
12257                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12258            {
12259                let member_inline_size = <fidl::encoding::HandleType<
12260                    fidl::EventPair,
12261                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12262                    2147483648,
12263                > as fidl::encoding::TypeMarker>::inline_size(
12264                    decoder.context
12265                );
12266                if inlined != (member_inline_size <= 4) {
12267                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12268                }
12269                let inner_offset;
12270                let mut inner_depth = depth.clone();
12271                if inlined {
12272                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12273                    inner_offset = next_offset;
12274                } else {
12275                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12276                    inner_depth.increment()?;
12277                }
12278                let val_ref =
12279                self.break_on_start.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12280                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12281                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12282                {
12283                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12284                }
12285                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12286                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12287                }
12288            }
12289
12290            next_offset += envelope_size;
12291
12292            // Decode the remaining unknown envelopes.
12293            while next_offset < end_offset {
12294                _next_ordinal_to_read += 1;
12295                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12296                next_offset += envelope_size;
12297            }
12298
12299            Ok(())
12300        }
12301    }
12302
12303    impl Event {
12304        #[inline(always)]
12305        fn max_ordinal_present(&self) -> u64 {
12306            if let Some(_) = self.payload {
12307                return 2;
12308            }
12309            if let Some(_) = self.header {
12310                return 1;
12311            }
12312            0
12313        }
12314    }
12315
12316    impl fidl::encoding::ResourceTypeMarker for Event {
12317        type Borrowed<'a> = &'a mut Self;
12318        fn take_or_borrow<'a>(
12319            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12320        ) -> Self::Borrowed<'a> {
12321            value
12322        }
12323    }
12324
12325    unsafe impl fidl::encoding::TypeMarker for Event {
12326        type Owned = Self;
12327
12328        #[inline(always)]
12329        fn inline_align(_context: fidl::encoding::Context) -> usize {
12330            8
12331        }
12332
12333        #[inline(always)]
12334        fn inline_size(_context: fidl::encoding::Context) -> usize {
12335            16
12336        }
12337    }
12338
12339    unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
12340        for &mut Event
12341    {
12342        unsafe fn encode(
12343            self,
12344            encoder: &mut fidl::encoding::Encoder<
12345                '_,
12346                fidl::encoding::DefaultFuchsiaResourceDialect,
12347            >,
12348            offset: usize,
12349            mut depth: fidl::encoding::Depth,
12350        ) -> fidl::Result<()> {
12351            encoder.debug_check_bounds::<Event>(offset);
12352            // Vector header
12353            let max_ordinal: u64 = self.max_ordinal_present();
12354            encoder.write_num(max_ordinal, offset);
12355            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12356            // Calling encoder.out_of_line_offset(0) is not allowed.
12357            if max_ordinal == 0 {
12358                return Ok(());
12359            }
12360            depth.increment()?;
12361            let envelope_size = 8;
12362            let bytes_len = max_ordinal as usize * envelope_size;
12363            #[allow(unused_variables)]
12364            let offset = encoder.out_of_line_offset(bytes_len);
12365            let mut _prev_end_offset: usize = 0;
12366            if 1 > max_ordinal {
12367                return Ok(());
12368            }
12369
12370            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12371            // are envelope_size bytes.
12372            let cur_offset: usize = (1 - 1) * envelope_size;
12373
12374            // Zero reserved fields.
12375            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12376
12377            // Safety:
12378            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12379            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12380            //   envelope_size bytes, there is always sufficient room.
12381            fidl::encoding::encode_in_envelope_optional::<
12382                EventHeader,
12383                fidl::encoding::DefaultFuchsiaResourceDialect,
12384            >(
12385                self.header.as_ref().map(<EventHeader as fidl::encoding::ValueTypeMarker>::borrow),
12386                encoder,
12387                offset + cur_offset,
12388                depth,
12389            )?;
12390
12391            _prev_end_offset = cur_offset + envelope_size;
12392            if 2 > max_ordinal {
12393                return Ok(());
12394            }
12395
12396            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12397            // are envelope_size bytes.
12398            let cur_offset: usize = (2 - 1) * envelope_size;
12399
12400            // Zero reserved fields.
12401            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12402
12403            // Safety:
12404            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12405            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12406            //   envelope_size bytes, there is always sufficient room.
12407            fidl::encoding::encode_in_envelope_optional::<
12408                EventPayload,
12409                fidl::encoding::DefaultFuchsiaResourceDialect,
12410            >(
12411                self.payload
12412                    .as_mut()
12413                    .map(<EventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12414                encoder,
12415                offset + cur_offset,
12416                depth,
12417            )?;
12418
12419            _prev_end_offset = cur_offset + envelope_size;
12420
12421            Ok(())
12422        }
12423    }
12424
12425    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
12426        #[inline(always)]
12427        fn new_empty() -> Self {
12428            Self::default()
12429        }
12430
12431        unsafe fn decode(
12432            &mut self,
12433            decoder: &mut fidl::encoding::Decoder<
12434                '_,
12435                fidl::encoding::DefaultFuchsiaResourceDialect,
12436            >,
12437            offset: usize,
12438            mut depth: fidl::encoding::Depth,
12439        ) -> fidl::Result<()> {
12440            decoder.debug_check_bounds::<Self>(offset);
12441            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12442                None => return Err(fidl::Error::NotNullable),
12443                Some(len) => len,
12444            };
12445            // Calling decoder.out_of_line_offset(0) is not allowed.
12446            if len == 0 {
12447                return Ok(());
12448            };
12449            depth.increment()?;
12450            let envelope_size = 8;
12451            let bytes_len = len * envelope_size;
12452            let offset = decoder.out_of_line_offset(bytes_len)?;
12453            // Decode the envelope for each type.
12454            let mut _next_ordinal_to_read = 0;
12455            let mut next_offset = offset;
12456            let end_offset = offset + bytes_len;
12457            _next_ordinal_to_read += 1;
12458            if next_offset >= end_offset {
12459                return Ok(());
12460            }
12461
12462            // Decode unknown envelopes for gaps in ordinals.
12463            while _next_ordinal_to_read < 1 {
12464                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12465                _next_ordinal_to_read += 1;
12466                next_offset += envelope_size;
12467            }
12468
12469            let next_out_of_line = decoder.next_out_of_line();
12470            let handles_before = decoder.remaining_handles();
12471            if let Some((inlined, num_bytes, num_handles)) =
12472                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12473            {
12474                let member_inline_size =
12475                    <EventHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12476                if inlined != (member_inline_size <= 4) {
12477                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12478                }
12479                let inner_offset;
12480                let mut inner_depth = depth.clone();
12481                if inlined {
12482                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12483                    inner_offset = next_offset;
12484                } else {
12485                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12486                    inner_depth.increment()?;
12487                }
12488                let val_ref = self.header.get_or_insert_with(|| {
12489                    fidl::new_empty!(EventHeader, fidl::encoding::DefaultFuchsiaResourceDialect)
12490                });
12491                fidl::decode!(
12492                    EventHeader,
12493                    fidl::encoding::DefaultFuchsiaResourceDialect,
12494                    val_ref,
12495                    decoder,
12496                    inner_offset,
12497                    inner_depth
12498                )?;
12499                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12500                {
12501                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12502                }
12503                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12504                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12505                }
12506            }
12507
12508            next_offset += envelope_size;
12509            _next_ordinal_to_read += 1;
12510            if next_offset >= end_offset {
12511                return Ok(());
12512            }
12513
12514            // Decode unknown envelopes for gaps in ordinals.
12515            while _next_ordinal_to_read < 2 {
12516                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12517                _next_ordinal_to_read += 1;
12518                next_offset += envelope_size;
12519            }
12520
12521            let next_out_of_line = decoder.next_out_of_line();
12522            let handles_before = decoder.remaining_handles();
12523            if let Some((inlined, num_bytes, num_handles)) =
12524                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12525            {
12526                let member_inline_size =
12527                    <EventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12528                if inlined != (member_inline_size <= 4) {
12529                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12530                }
12531                let inner_offset;
12532                let mut inner_depth = depth.clone();
12533                if inlined {
12534                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12535                    inner_offset = next_offset;
12536                } else {
12537                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12538                    inner_depth.increment()?;
12539                }
12540                let val_ref = self.payload.get_or_insert_with(|| {
12541                    fidl::new_empty!(EventPayload, fidl::encoding::DefaultFuchsiaResourceDialect)
12542                });
12543                fidl::decode!(
12544                    EventPayload,
12545                    fidl::encoding::DefaultFuchsiaResourceDialect,
12546                    val_ref,
12547                    decoder,
12548                    inner_offset,
12549                    inner_depth
12550                )?;
12551                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12552                {
12553                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12554                }
12555                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12556                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12557                }
12558            }
12559
12560            next_offset += envelope_size;
12561
12562            // Decode the remaining unknown envelopes.
12563            while next_offset < end_offset {
12564                _next_ordinal_to_read += 1;
12565                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12566                next_offset += envelope_size;
12567            }
12568
12569            Ok(())
12570        }
12571    }
12572
12573    impl NamespaceEntry {
12574        #[inline(always)]
12575        fn max_ordinal_present(&self) -> u64 {
12576            if let Some(_) = self.directory {
12577                return 2;
12578            }
12579            if let Some(_) = self.path {
12580                return 1;
12581            }
12582            0
12583        }
12584    }
12585
12586    impl fidl::encoding::ResourceTypeMarker for NamespaceEntry {
12587        type Borrowed<'a> = &'a mut Self;
12588        fn take_or_borrow<'a>(
12589            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12590        ) -> Self::Borrowed<'a> {
12591            value
12592        }
12593    }
12594
12595    unsafe impl fidl::encoding::TypeMarker for NamespaceEntry {
12596        type Owned = Self;
12597
12598        #[inline(always)]
12599        fn inline_align(_context: fidl::encoding::Context) -> usize {
12600            8
12601        }
12602
12603        #[inline(always)]
12604        fn inline_size(_context: fidl::encoding::Context) -> usize {
12605            16
12606        }
12607    }
12608
12609    unsafe impl
12610        fidl::encoding::Encode<NamespaceEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
12611        for &mut NamespaceEntry
12612    {
12613        unsafe fn encode(
12614            self,
12615            encoder: &mut fidl::encoding::Encoder<
12616                '_,
12617                fidl::encoding::DefaultFuchsiaResourceDialect,
12618            >,
12619            offset: usize,
12620            mut depth: fidl::encoding::Depth,
12621        ) -> fidl::Result<()> {
12622            encoder.debug_check_bounds::<NamespaceEntry>(offset);
12623            // Vector header
12624            let max_ordinal: u64 = self.max_ordinal_present();
12625            encoder.write_num(max_ordinal, offset);
12626            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12627            // Calling encoder.out_of_line_offset(0) is not allowed.
12628            if max_ordinal == 0 {
12629                return Ok(());
12630            }
12631            depth.increment()?;
12632            let envelope_size = 8;
12633            let bytes_len = max_ordinal as usize * envelope_size;
12634            #[allow(unused_variables)]
12635            let offset = encoder.out_of_line_offset(bytes_len);
12636            let mut _prev_end_offset: usize = 0;
12637            if 1 > max_ordinal {
12638                return Ok(());
12639            }
12640
12641            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12642            // are envelope_size bytes.
12643            let cur_offset: usize = (1 - 1) * envelope_size;
12644
12645            // Zero reserved fields.
12646            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12647
12648            // Safety:
12649            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12650            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12651            //   envelope_size bytes, there is always sufficient room.
12652            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12653            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
12654            encoder, offset + cur_offset, depth
12655        )?;
12656
12657            _prev_end_offset = cur_offset + envelope_size;
12658            if 2 > max_ordinal {
12659                return Ok(());
12660            }
12661
12662            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12663            // are envelope_size bytes.
12664            let cur_offset: usize = (2 - 1) * envelope_size;
12665
12666            // Zero reserved fields.
12667            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12668
12669            // Safety:
12670            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12671            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12672            //   envelope_size bytes, there is always sufficient room.
12673            fidl::encoding::encode_in_envelope_optional::<
12674                fidl::encoding::Endpoint<
12675                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12676                >,
12677                fidl::encoding::DefaultFuchsiaResourceDialect,
12678            >(
12679                self.directory.as_mut().map(
12680                    <fidl::encoding::Endpoint<
12681                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12682                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12683                ),
12684                encoder,
12685                offset + cur_offset,
12686                depth,
12687            )?;
12688
12689            _prev_end_offset = cur_offset + envelope_size;
12690
12691            Ok(())
12692        }
12693    }
12694
12695    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12696        for NamespaceEntry
12697    {
12698        #[inline(always)]
12699        fn new_empty() -> Self {
12700            Self::default()
12701        }
12702
12703        unsafe fn decode(
12704            &mut self,
12705            decoder: &mut fidl::encoding::Decoder<
12706                '_,
12707                fidl::encoding::DefaultFuchsiaResourceDialect,
12708            >,
12709            offset: usize,
12710            mut depth: fidl::encoding::Depth,
12711        ) -> fidl::Result<()> {
12712            decoder.debug_check_bounds::<Self>(offset);
12713            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12714                None => return Err(fidl::Error::NotNullable),
12715                Some(len) => len,
12716            };
12717            // Calling decoder.out_of_line_offset(0) is not allowed.
12718            if len == 0 {
12719                return Ok(());
12720            };
12721            depth.increment()?;
12722            let envelope_size = 8;
12723            let bytes_len = len * envelope_size;
12724            let offset = decoder.out_of_line_offset(bytes_len)?;
12725            // Decode the envelope for each type.
12726            let mut _next_ordinal_to_read = 0;
12727            let mut next_offset = offset;
12728            let end_offset = offset + bytes_len;
12729            _next_ordinal_to_read += 1;
12730            if next_offset >= end_offset {
12731                return Ok(());
12732            }
12733
12734            // Decode unknown envelopes for gaps in ordinals.
12735            while _next_ordinal_to_read < 1 {
12736                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12737                _next_ordinal_to_read += 1;
12738                next_offset += envelope_size;
12739            }
12740
12741            let next_out_of_line = decoder.next_out_of_line();
12742            let handles_before = decoder.remaining_handles();
12743            if let Some((inlined, num_bytes, num_handles)) =
12744                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12745            {
12746                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12747                if inlined != (member_inline_size <= 4) {
12748                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12749                }
12750                let inner_offset;
12751                let mut inner_depth = depth.clone();
12752                if inlined {
12753                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12754                    inner_offset = next_offset;
12755                } else {
12756                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12757                    inner_depth.increment()?;
12758                }
12759                let val_ref = self.path.get_or_insert_with(|| {
12760                    fidl::new_empty!(
12761                        fidl::encoding::BoundedString<4095>,
12762                        fidl::encoding::DefaultFuchsiaResourceDialect
12763                    )
12764                });
12765                fidl::decode!(
12766                    fidl::encoding::BoundedString<4095>,
12767                    fidl::encoding::DefaultFuchsiaResourceDialect,
12768                    val_ref,
12769                    decoder,
12770                    inner_offset,
12771                    inner_depth
12772                )?;
12773                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12774                {
12775                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12776                }
12777                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12778                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12779                }
12780            }
12781
12782            next_offset += envelope_size;
12783            _next_ordinal_to_read += 1;
12784            if next_offset >= end_offset {
12785                return Ok(());
12786            }
12787
12788            // Decode unknown envelopes for gaps in ordinals.
12789            while _next_ordinal_to_read < 2 {
12790                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12791                _next_ordinal_to_read += 1;
12792                next_offset += envelope_size;
12793            }
12794
12795            let next_out_of_line = decoder.next_out_of_line();
12796            let handles_before = decoder.remaining_handles();
12797            if let Some((inlined, num_bytes, num_handles)) =
12798                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12799            {
12800                let member_inline_size = <fidl::encoding::Endpoint<
12801                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12802                > as fidl::encoding::TypeMarker>::inline_size(
12803                    decoder.context
12804                );
12805                if inlined != (member_inline_size <= 4) {
12806                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12807                }
12808                let inner_offset;
12809                let mut inner_depth = depth.clone();
12810                if inlined {
12811                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12812                    inner_offset = next_offset;
12813                } else {
12814                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12815                    inner_depth.increment()?;
12816                }
12817                let val_ref = self.directory.get_or_insert_with(|| {
12818                    fidl::new_empty!(
12819                        fidl::encoding::Endpoint<
12820                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12821                        >,
12822                        fidl::encoding::DefaultFuchsiaResourceDialect
12823                    )
12824                });
12825                fidl::decode!(
12826                    fidl::encoding::Endpoint<
12827                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12828                    >,
12829                    fidl::encoding::DefaultFuchsiaResourceDialect,
12830                    val_ref,
12831                    decoder,
12832                    inner_offset,
12833                    inner_depth
12834                )?;
12835                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12836                {
12837                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12838                }
12839                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12840                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12841                }
12842            }
12843
12844            next_offset += envelope_size;
12845
12846            // Decode the remaining unknown envelopes.
12847            while next_offset < end_offset {
12848                _next_ordinal_to_read += 1;
12849                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12850                next_offset += envelope_size;
12851            }
12852
12853            Ok(())
12854        }
12855    }
12856
12857    impl StartChildArgs {
12858        #[inline(always)]
12859        fn max_ordinal_present(&self) -> u64 {
12860            if let Some(_) = self.additional_inputs {
12861                return 4;
12862            }
12863            if let Some(_) = self.dictionary {
12864                return 3;
12865            }
12866            if let Some(_) = self.namespace_entries {
12867                return 2;
12868            }
12869            if let Some(_) = self.numbered_handles {
12870                return 1;
12871            }
12872            0
12873        }
12874    }
12875
12876    impl fidl::encoding::ResourceTypeMarker for StartChildArgs {
12877        type Borrowed<'a> = &'a mut Self;
12878        fn take_or_borrow<'a>(
12879            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12880        ) -> Self::Borrowed<'a> {
12881            value
12882        }
12883    }
12884
12885    unsafe impl fidl::encoding::TypeMarker for StartChildArgs {
12886        type Owned = Self;
12887
12888        #[inline(always)]
12889        fn inline_align(_context: fidl::encoding::Context) -> usize {
12890            8
12891        }
12892
12893        #[inline(always)]
12894        fn inline_size(_context: fidl::encoding::Context) -> usize {
12895            16
12896        }
12897    }
12898
12899    unsafe impl
12900        fidl::encoding::Encode<StartChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
12901        for &mut StartChildArgs
12902    {
12903        unsafe fn encode(
12904            self,
12905            encoder: &mut fidl::encoding::Encoder<
12906                '_,
12907                fidl::encoding::DefaultFuchsiaResourceDialect,
12908            >,
12909            offset: usize,
12910            mut depth: fidl::encoding::Depth,
12911        ) -> fidl::Result<()> {
12912            encoder.debug_check_bounds::<StartChildArgs>(offset);
12913            // Vector header
12914            let max_ordinal: u64 = self.max_ordinal_present();
12915            encoder.write_num(max_ordinal, offset);
12916            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12917            // Calling encoder.out_of_line_offset(0) is not allowed.
12918            if max_ordinal == 0 {
12919                return Ok(());
12920            }
12921            depth.increment()?;
12922            let envelope_size = 8;
12923            let bytes_len = max_ordinal as usize * envelope_size;
12924            #[allow(unused_variables)]
12925            let offset = encoder.out_of_line_offset(bytes_len);
12926            let mut _prev_end_offset: usize = 0;
12927            if 1 > max_ordinal {
12928                return Ok(());
12929            }
12930
12931            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12932            // are envelope_size bytes.
12933            let cur_offset: usize = (1 - 1) * envelope_size;
12934
12935            // Zero reserved fields.
12936            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12937
12938            // Safety:
12939            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12940            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12941            //   envelope_size bytes, there is always sufficient room.
12942            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12943            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12944            encoder, offset + cur_offset, depth
12945        )?;
12946
12947            _prev_end_offset = cur_offset + envelope_size;
12948            if 2 > max_ordinal {
12949                return Ok(());
12950            }
12951
12952            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12953            // are envelope_size bytes.
12954            let cur_offset: usize = (2 - 1) * envelope_size;
12955
12956            // Zero reserved fields.
12957            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12958
12959            // Safety:
12960            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12961            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12962            //   envelope_size bytes, there is always sufficient room.
12963            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12964            self.namespace_entries.as_mut().map(<fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12965            encoder, offset + cur_offset, depth
12966        )?;
12967
12968            _prev_end_offset = cur_offset + envelope_size;
12969            if 3 > max_ordinal {
12970                return Ok(());
12971            }
12972
12973            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12974            // are envelope_size bytes.
12975            let cur_offset: usize = (3 - 1) * envelope_size;
12976
12977            // Zero reserved fields.
12978            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12979
12980            // Safety:
12981            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12982            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12983            //   envelope_size bytes, there is always sufficient room.
12984            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
12985            self.dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12986            encoder, offset + cur_offset, depth
12987        )?;
12988
12989            _prev_end_offset = cur_offset + envelope_size;
12990            if 4 > max_ordinal {
12991                return Ok(());
12992            }
12993
12994            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12995            // are envelope_size bytes.
12996            let cur_offset: usize = (4 - 1) * envelope_size;
12997
12998            // Zero reserved fields.
12999            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13000
13001            // Safety:
13002            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13003            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13004            //   envelope_size bytes, there is always sufficient room.
13005            fidl::encoding::encode_in_envelope_optional::<
13006                fidl::encoding::HandleType<
13007                    fidl::EventPair,
13008                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13009                    2147483648,
13010                >,
13011                fidl::encoding::DefaultFuchsiaResourceDialect,
13012            >(
13013                self.additional_inputs.as_mut().map(
13014                    <fidl::encoding::HandleType<
13015                        fidl::EventPair,
13016                        { fidl::ObjectType::EVENTPAIR.into_raw() },
13017                        2147483648,
13018                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13019                ),
13020                encoder,
13021                offset + cur_offset,
13022                depth,
13023            )?;
13024
13025            _prev_end_offset = cur_offset + envelope_size;
13026
13027            Ok(())
13028        }
13029    }
13030
13031    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13032        for StartChildArgs
13033    {
13034        #[inline(always)]
13035        fn new_empty() -> Self {
13036            Self::default()
13037        }
13038
13039        unsafe fn decode(
13040            &mut self,
13041            decoder: &mut fidl::encoding::Decoder<
13042                '_,
13043                fidl::encoding::DefaultFuchsiaResourceDialect,
13044            >,
13045            offset: usize,
13046            mut depth: fidl::encoding::Depth,
13047        ) -> fidl::Result<()> {
13048            decoder.debug_check_bounds::<Self>(offset);
13049            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13050                None => return Err(fidl::Error::NotNullable),
13051                Some(len) => len,
13052            };
13053            // Calling decoder.out_of_line_offset(0) is not allowed.
13054            if len == 0 {
13055                return Ok(());
13056            };
13057            depth.increment()?;
13058            let envelope_size = 8;
13059            let bytes_len = len * envelope_size;
13060            let offset = decoder.out_of_line_offset(bytes_len)?;
13061            // Decode the envelope for each type.
13062            let mut _next_ordinal_to_read = 0;
13063            let mut next_offset = offset;
13064            let end_offset = offset + bytes_len;
13065            _next_ordinal_to_read += 1;
13066            if next_offset >= end_offset {
13067                return Ok(());
13068            }
13069
13070            // Decode unknown envelopes for gaps in ordinals.
13071            while _next_ordinal_to_read < 1 {
13072                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13073                _next_ordinal_to_read += 1;
13074                next_offset += envelope_size;
13075            }
13076
13077            let next_out_of_line = decoder.next_out_of_line();
13078            let handles_before = decoder.remaining_handles();
13079            if let Some((inlined, num_bytes, num_handles)) =
13080                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13081            {
13082                let member_inline_size = <fidl::encoding::Vector<
13083                    fidl_fuchsia_process::HandleInfo,
13084                    128,
13085                > as fidl::encoding::TypeMarker>::inline_size(
13086                    decoder.context
13087                );
13088                if inlined != (member_inline_size <= 4) {
13089                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13090                }
13091                let inner_offset;
13092                let mut inner_depth = depth.clone();
13093                if inlined {
13094                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13095                    inner_offset = next_offset;
13096                } else {
13097                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13098                    inner_depth.increment()?;
13099                }
13100                let val_ref =
13101                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
13102                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13103                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13104                {
13105                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13106                }
13107                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13108                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13109                }
13110            }
13111
13112            next_offset += envelope_size;
13113            _next_ordinal_to_read += 1;
13114            if next_offset >= end_offset {
13115                return Ok(());
13116            }
13117
13118            // Decode unknown envelopes for gaps in ordinals.
13119            while _next_ordinal_to_read < 2 {
13120                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13121                _next_ordinal_to_read += 1;
13122                next_offset += envelope_size;
13123            }
13124
13125            let next_out_of_line = decoder.next_out_of_line();
13126            let handles_before = decoder.remaining_handles();
13127            if let Some((inlined, num_bytes, num_handles)) =
13128                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13129            {
13130                let member_inline_size = <fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13131                if inlined != (member_inline_size <= 4) {
13132                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13133                }
13134                let inner_offset;
13135                let mut inner_depth = depth.clone();
13136                if inlined {
13137                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13138                    inner_offset = next_offset;
13139                } else {
13140                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13141                    inner_depth.increment()?;
13142                }
13143                let val_ref =
13144                self.namespace_entries.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
13145                fidl::decode!(fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13146                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13147                {
13148                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13149                }
13150                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13151                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13152                }
13153            }
13154
13155            next_offset += envelope_size;
13156            _next_ordinal_to_read += 1;
13157            if next_offset >= end_offset {
13158                return Ok(());
13159            }
13160
13161            // Decode unknown envelopes for gaps in ordinals.
13162            while _next_ordinal_to_read < 3 {
13163                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13164                _next_ordinal_to_read += 1;
13165                next_offset += envelope_size;
13166            }
13167
13168            let next_out_of_line = decoder.next_out_of_line();
13169            let handles_before = decoder.remaining_handles();
13170            if let Some((inlined, num_bytes, num_handles)) =
13171                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13172            {
13173                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13174                if inlined != (member_inline_size <= 4) {
13175                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13176                }
13177                let inner_offset;
13178                let mut inner_depth = depth.clone();
13179                if inlined {
13180                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13181                    inner_offset = next_offset;
13182                } else {
13183                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13184                    inner_depth.increment()?;
13185                }
13186                let val_ref = self.dictionary.get_or_insert_with(|| {
13187                    fidl::new_empty!(
13188                        fidl_fuchsia_component_sandbox::DictionaryRef,
13189                        fidl::encoding::DefaultFuchsiaResourceDialect
13190                    )
13191                });
13192                fidl::decode!(
13193                    fidl_fuchsia_component_sandbox::DictionaryRef,
13194                    fidl::encoding::DefaultFuchsiaResourceDialect,
13195                    val_ref,
13196                    decoder,
13197                    inner_offset,
13198                    inner_depth
13199                )?;
13200                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13201                {
13202                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13203                }
13204                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13205                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13206                }
13207            }
13208
13209            next_offset += envelope_size;
13210            _next_ordinal_to_read += 1;
13211            if next_offset >= end_offset {
13212                return Ok(());
13213            }
13214
13215            // Decode unknown envelopes for gaps in ordinals.
13216            while _next_ordinal_to_read < 4 {
13217                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13218                _next_ordinal_to_read += 1;
13219                next_offset += envelope_size;
13220            }
13221
13222            let next_out_of_line = decoder.next_out_of_line();
13223            let handles_before = decoder.remaining_handles();
13224            if let Some((inlined, num_bytes, num_handles)) =
13225                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13226            {
13227                let member_inline_size = <fidl::encoding::HandleType<
13228                    fidl::EventPair,
13229                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13230                    2147483648,
13231                > as fidl::encoding::TypeMarker>::inline_size(
13232                    decoder.context
13233                );
13234                if inlined != (member_inline_size <= 4) {
13235                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13236                }
13237                let inner_offset;
13238                let mut inner_depth = depth.clone();
13239                if inlined {
13240                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13241                    inner_offset = next_offset;
13242                } else {
13243                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13244                    inner_depth.increment()?;
13245                }
13246                let val_ref =
13247                self.additional_inputs.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13248                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13249                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13250                {
13251                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13252                }
13253                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13254                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13255                }
13256            }
13257
13258            next_offset += envelope_size;
13259
13260            // Decode the remaining unknown envelopes.
13261            while next_offset < end_offset {
13262                _next_ordinal_to_read += 1;
13263                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13264                next_offset += envelope_size;
13265            }
13266
13267            Ok(())
13268        }
13269    }
13270
13271    impl fidl::encoding::ResourceTypeMarker for EventPayload {
13272        type Borrowed<'a> = &'a mut Self;
13273        fn take_or_borrow<'a>(
13274            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13275        ) -> Self::Borrowed<'a> {
13276            value
13277        }
13278    }
13279
13280    unsafe impl fidl::encoding::TypeMarker for EventPayload {
13281        type Owned = Self;
13282
13283        #[inline(always)]
13284        fn inline_align(_context: fidl::encoding::Context) -> usize {
13285            8
13286        }
13287
13288        #[inline(always)]
13289        fn inline_size(_context: fidl::encoding::Context) -> usize {
13290            16
13291        }
13292    }
13293
13294    unsafe impl fidl::encoding::Encode<EventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13295        for &mut EventPayload
13296    {
13297        #[inline]
13298        unsafe fn encode(
13299            self,
13300            encoder: &mut fidl::encoding::Encoder<
13301                '_,
13302                fidl::encoding::DefaultFuchsiaResourceDialect,
13303            >,
13304            offset: usize,
13305            _depth: fidl::encoding::Depth,
13306        ) -> fidl::Result<()> {
13307            encoder.debug_check_bounds::<EventPayload>(offset);
13308            encoder.write_num::<u64>(self.ordinal(), offset);
13309            match self {
13310            EventPayload::CapabilityRequested(ref mut val) => {
13311                fidl::encoding::encode_in_envelope::<CapabilityRequestedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13312                    <CapabilityRequestedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13313                    encoder, offset + 8, _depth
13314                )
13315            }
13316            EventPayload::Purged(ref val) => {
13317                fidl::encoding::encode_in_envelope::<PurgedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13318                    <PurgedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13319                    encoder, offset + 8, _depth
13320                )
13321            }
13322            EventPayload::Discovered(ref val) => {
13323                fidl::encoding::encode_in_envelope::<DiscoveredPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13324                    <DiscoveredPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13325                    encoder, offset + 8, _depth
13326                )
13327            }
13328            EventPayload::Destroyed(ref val) => {
13329                fidl::encoding::encode_in_envelope::<DestroyedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13330                    <DestroyedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13331                    encoder, offset + 8, _depth
13332                )
13333            }
13334            EventPayload::Resolved(ref val) => {
13335                fidl::encoding::encode_in_envelope::<ResolvedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13336                    <ResolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13337                    encoder, offset + 8, _depth
13338                )
13339            }
13340            EventPayload::Started(ref val) => {
13341                fidl::encoding::encode_in_envelope::<StartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13342                    <StartedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13343                    encoder, offset + 8, _depth
13344                )
13345            }
13346            EventPayload::Stopped(ref val) => {
13347                fidl::encoding::encode_in_envelope::<StoppedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13348                    <StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13349                    encoder, offset + 8, _depth
13350                )
13351            }
13352            EventPayload::DebugStarted(ref mut val) => {
13353                fidl::encoding::encode_in_envelope::<DebugStartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13354                    <DebugStartedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13355                    encoder, offset + 8, _depth
13356                )
13357            }
13358            EventPayload::Unresolved(ref val) => {
13359                fidl::encoding::encode_in_envelope::<UnresolvedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13360                    <UnresolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13361                    encoder, offset + 8, _depth
13362                )
13363            }
13364            EventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
13365        }
13366        }
13367    }
13368
13369    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for EventPayload {
13370        #[inline(always)]
13371        fn new_empty() -> Self {
13372            Self::__SourceBreaking { unknown_ordinal: 0 }
13373        }
13374
13375        #[inline]
13376        unsafe fn decode(
13377            &mut self,
13378            decoder: &mut fidl::encoding::Decoder<
13379                '_,
13380                fidl::encoding::DefaultFuchsiaResourceDialect,
13381            >,
13382            offset: usize,
13383            mut depth: fidl::encoding::Depth,
13384        ) -> fidl::Result<()> {
13385            decoder.debug_check_bounds::<Self>(offset);
13386            #[allow(unused_variables)]
13387            let next_out_of_line = decoder.next_out_of_line();
13388            let handles_before = decoder.remaining_handles();
13389            let (ordinal, inlined, num_bytes, num_handles) =
13390                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
13391
13392            let member_inline_size = match ordinal {
13393                1 => <CapabilityRequestedPayload as fidl::encoding::TypeMarker>::inline_size(
13394                    decoder.context,
13395                ),
13396                2 => <PurgedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13397                4 => {
13398                    <DiscoveredPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13399                }
13400                5 => <DestroyedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13401                6 => <ResolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13402                7 => <StartedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13403                8 => <StoppedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
13404                9 => <DebugStartedPayload as fidl::encoding::TypeMarker>::inline_size(
13405                    decoder.context,
13406                ),
13407                10 => {
13408                    <UnresolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
13409                }
13410                0 => return Err(fidl::Error::UnknownUnionTag),
13411                _ => num_bytes as usize,
13412            };
13413
13414            if inlined != (member_inline_size <= 4) {
13415                return Err(fidl::Error::InvalidInlineBitInEnvelope);
13416            }
13417            let _inner_offset;
13418            if inlined {
13419                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
13420                _inner_offset = offset + 8;
13421            } else {
13422                depth.increment()?;
13423                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13424            }
13425            match ordinal {
13426                1 => {
13427                    #[allow(irrefutable_let_patterns)]
13428                    if let EventPayload::CapabilityRequested(_) = self {
13429                        // Do nothing, read the value into the object
13430                    } else {
13431                        // Initialize `self` to the right variant
13432                        *self = EventPayload::CapabilityRequested(fidl::new_empty!(
13433                            CapabilityRequestedPayload,
13434                            fidl::encoding::DefaultFuchsiaResourceDialect
13435                        ));
13436                    }
13437                    #[allow(irrefutable_let_patterns)]
13438                    if let EventPayload::CapabilityRequested(ref mut val) = self {
13439                        fidl::decode!(
13440                            CapabilityRequestedPayload,
13441                            fidl::encoding::DefaultFuchsiaResourceDialect,
13442                            val,
13443                            decoder,
13444                            _inner_offset,
13445                            depth
13446                        )?;
13447                    } else {
13448                        unreachable!()
13449                    }
13450                }
13451                2 => {
13452                    #[allow(irrefutable_let_patterns)]
13453                    if let EventPayload::Purged(_) = self {
13454                        // Do nothing, read the value into the object
13455                    } else {
13456                        // Initialize `self` to the right variant
13457                        *self = EventPayload::Purged(fidl::new_empty!(
13458                            PurgedPayload,
13459                            fidl::encoding::DefaultFuchsiaResourceDialect
13460                        ));
13461                    }
13462                    #[allow(irrefutable_let_patterns)]
13463                    if let EventPayload::Purged(ref mut val) = self {
13464                        fidl::decode!(
13465                            PurgedPayload,
13466                            fidl::encoding::DefaultFuchsiaResourceDialect,
13467                            val,
13468                            decoder,
13469                            _inner_offset,
13470                            depth
13471                        )?;
13472                    } else {
13473                        unreachable!()
13474                    }
13475                }
13476                4 => {
13477                    #[allow(irrefutable_let_patterns)]
13478                    if let EventPayload::Discovered(_) = self {
13479                        // Do nothing, read the value into the object
13480                    } else {
13481                        // Initialize `self` to the right variant
13482                        *self = EventPayload::Discovered(fidl::new_empty!(
13483                            DiscoveredPayload,
13484                            fidl::encoding::DefaultFuchsiaResourceDialect
13485                        ));
13486                    }
13487                    #[allow(irrefutable_let_patterns)]
13488                    if let EventPayload::Discovered(ref mut val) = self {
13489                        fidl::decode!(
13490                            DiscoveredPayload,
13491                            fidl::encoding::DefaultFuchsiaResourceDialect,
13492                            val,
13493                            decoder,
13494                            _inner_offset,
13495                            depth
13496                        )?;
13497                    } else {
13498                        unreachable!()
13499                    }
13500                }
13501                5 => {
13502                    #[allow(irrefutable_let_patterns)]
13503                    if let EventPayload::Destroyed(_) = self {
13504                        // Do nothing, read the value into the object
13505                    } else {
13506                        // Initialize `self` to the right variant
13507                        *self = EventPayload::Destroyed(fidl::new_empty!(
13508                            DestroyedPayload,
13509                            fidl::encoding::DefaultFuchsiaResourceDialect
13510                        ));
13511                    }
13512                    #[allow(irrefutable_let_patterns)]
13513                    if let EventPayload::Destroyed(ref mut val) = self {
13514                        fidl::decode!(
13515                            DestroyedPayload,
13516                            fidl::encoding::DefaultFuchsiaResourceDialect,
13517                            val,
13518                            decoder,
13519                            _inner_offset,
13520                            depth
13521                        )?;
13522                    } else {
13523                        unreachable!()
13524                    }
13525                }
13526                6 => {
13527                    #[allow(irrefutable_let_patterns)]
13528                    if let EventPayload::Resolved(_) = self {
13529                        // Do nothing, read the value into the object
13530                    } else {
13531                        // Initialize `self` to the right variant
13532                        *self = EventPayload::Resolved(fidl::new_empty!(
13533                            ResolvedPayload,
13534                            fidl::encoding::DefaultFuchsiaResourceDialect
13535                        ));
13536                    }
13537                    #[allow(irrefutable_let_patterns)]
13538                    if let EventPayload::Resolved(ref mut val) = self {
13539                        fidl::decode!(
13540                            ResolvedPayload,
13541                            fidl::encoding::DefaultFuchsiaResourceDialect,
13542                            val,
13543                            decoder,
13544                            _inner_offset,
13545                            depth
13546                        )?;
13547                    } else {
13548                        unreachable!()
13549                    }
13550                }
13551                7 => {
13552                    #[allow(irrefutable_let_patterns)]
13553                    if let EventPayload::Started(_) = self {
13554                        // Do nothing, read the value into the object
13555                    } else {
13556                        // Initialize `self` to the right variant
13557                        *self = EventPayload::Started(fidl::new_empty!(
13558                            StartedPayload,
13559                            fidl::encoding::DefaultFuchsiaResourceDialect
13560                        ));
13561                    }
13562                    #[allow(irrefutable_let_patterns)]
13563                    if let EventPayload::Started(ref mut val) = self {
13564                        fidl::decode!(
13565                            StartedPayload,
13566                            fidl::encoding::DefaultFuchsiaResourceDialect,
13567                            val,
13568                            decoder,
13569                            _inner_offset,
13570                            depth
13571                        )?;
13572                    } else {
13573                        unreachable!()
13574                    }
13575                }
13576                8 => {
13577                    #[allow(irrefutable_let_patterns)]
13578                    if let EventPayload::Stopped(_) = self {
13579                        // Do nothing, read the value into the object
13580                    } else {
13581                        // Initialize `self` to the right variant
13582                        *self = EventPayload::Stopped(fidl::new_empty!(
13583                            StoppedPayload,
13584                            fidl::encoding::DefaultFuchsiaResourceDialect
13585                        ));
13586                    }
13587                    #[allow(irrefutable_let_patterns)]
13588                    if let EventPayload::Stopped(ref mut val) = self {
13589                        fidl::decode!(
13590                            StoppedPayload,
13591                            fidl::encoding::DefaultFuchsiaResourceDialect,
13592                            val,
13593                            decoder,
13594                            _inner_offset,
13595                            depth
13596                        )?;
13597                    } else {
13598                        unreachable!()
13599                    }
13600                }
13601                9 => {
13602                    #[allow(irrefutable_let_patterns)]
13603                    if let EventPayload::DebugStarted(_) = self {
13604                        // Do nothing, read the value into the object
13605                    } else {
13606                        // Initialize `self` to the right variant
13607                        *self = EventPayload::DebugStarted(fidl::new_empty!(
13608                            DebugStartedPayload,
13609                            fidl::encoding::DefaultFuchsiaResourceDialect
13610                        ));
13611                    }
13612                    #[allow(irrefutable_let_patterns)]
13613                    if let EventPayload::DebugStarted(ref mut val) = self {
13614                        fidl::decode!(
13615                            DebugStartedPayload,
13616                            fidl::encoding::DefaultFuchsiaResourceDialect,
13617                            val,
13618                            decoder,
13619                            _inner_offset,
13620                            depth
13621                        )?;
13622                    } else {
13623                        unreachable!()
13624                    }
13625                }
13626                10 => {
13627                    #[allow(irrefutable_let_patterns)]
13628                    if let EventPayload::Unresolved(_) = self {
13629                        // Do nothing, read the value into the object
13630                    } else {
13631                        // Initialize `self` to the right variant
13632                        *self = EventPayload::Unresolved(fidl::new_empty!(
13633                            UnresolvedPayload,
13634                            fidl::encoding::DefaultFuchsiaResourceDialect
13635                        ));
13636                    }
13637                    #[allow(irrefutable_let_patterns)]
13638                    if let EventPayload::Unresolved(ref mut val) = self {
13639                        fidl::decode!(
13640                            UnresolvedPayload,
13641                            fidl::encoding::DefaultFuchsiaResourceDialect,
13642                            val,
13643                            decoder,
13644                            _inner_offset,
13645                            depth
13646                        )?;
13647                    } else {
13648                        unreachable!()
13649                    }
13650                }
13651                #[allow(deprecated)]
13652                ordinal => {
13653                    for _ in 0..num_handles {
13654                        decoder.drop_next_handle()?;
13655                    }
13656                    *self = EventPayload::__SourceBreaking { unknown_ordinal: ordinal };
13657                }
13658            }
13659            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
13660                return Err(fidl::Error::InvalidNumBytesInEnvelope);
13661            }
13662            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13663                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13664            }
13665            Ok(())
13666        }
13667    }
13668}