Skip to main content

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 NamespaceCreate2Request {
84    pub entries: Vec<NamespaceInputEntry2>,
85}
86
87impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreate2Request {}
88
89#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
90pub struct NamespaceCreateRequest {
91    pub entries: Vec<NamespaceInputEntry>,
92}
93
94impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreateRequest {}
95
96#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
97pub struct NamespaceInputEntry {
98    pub path: String,
99    pub dictionary: fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
100}
101
102impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceInputEntry {}
103
104#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
105pub struct NamespaceInputEntry2 {
106    /// The path at which the entry will exist in the namespace.
107    pub path: String,
108    /// A capability (created using fuchsia.component.runtime.Capabilities) to
109    /// install in the namespace. Currently only dictionaries are supported.
110    pub capability: fidl::EventPair,
111}
112
113impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceInputEntry2 {}
114
115#[derive(Debug, PartialEq)]
116pub struct NamespaceCreate2Response {
117    pub entries: Vec<NamespaceEntry>,
118}
119
120impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreate2Response {}
121
122#[derive(Debug, PartialEq)]
123pub struct NamespaceCreateResponse {
124    pub entries: Vec<NamespaceEntry>,
125}
126
127impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceCreateResponse {}
128
129#[derive(Debug, PartialEq)]
130pub struct RealmCreateChildRequest {
131    pub collection: fidl_fuchsia_component_decl::CollectionRef,
132    pub decl: fidl_fuchsia_component_decl::Child,
133    pub args: CreateChildArgs,
134}
135
136impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmCreateChildRequest {}
137
138#[derive(Debug, PartialEq)]
139pub struct RealmGetChildOutputDictionaryDeprecatedRequest {
140    pub child: fidl_fuchsia_component_decl::ChildRef,
141}
142
143impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
144    for RealmGetChildOutputDictionaryDeprecatedRequest
145{
146}
147
148#[derive(Debug, PartialEq)]
149pub struct RealmGetChildOutputDictionaryRequest {
150    pub child: fidl_fuchsia_component_decl::ChildRef,
151}
152
153impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
154    for RealmGetChildOutputDictionaryRequest
155{
156}
157
158#[derive(Debug, PartialEq)]
159pub struct RealmListChildrenRequest {
160    pub collection: fidl_fuchsia_component_decl::CollectionRef,
161    pub iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
162}
163
164impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RealmListChildrenRequest {}
165
166#[derive(Debug, PartialEq)]
167pub struct RealmOpenControllerRequest {
168    pub child: fidl_fuchsia_component_decl::ChildRef,
169    pub controller: fidl::endpoints::ServerEnd<ControllerMarker>,
170}
171
172impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
173    for RealmOpenControllerRequest
174{
175}
176
177#[derive(Debug, PartialEq)]
178pub struct RealmOpenExposedDirRequest {
179    pub child: fidl_fuchsia_component_decl::ChildRef,
180    pub exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
181}
182
183impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
184    for RealmOpenExposedDirRequest
185{
186}
187
188#[derive(Debug, PartialEq)]
189pub struct RealmGetChildOutputDictionaryDeprecatedResponse {
190    pub dictionary: fidl_fuchsia_component_sandbox::DictionaryRef,
191}
192
193impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
194    for RealmGetChildOutputDictionaryDeprecatedResponse
195{
196}
197
198#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
199pub struct RealmGetChildOutputDictionaryResponse {
200    pub dictionary: fidl::EventPair,
201}
202
203impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
204    for RealmGetChildOutputDictionaryResponse
205{
206}
207
208#[derive(Debug, PartialEq)]
209pub struct RealmGetResolvedInfoResponse {
210    pub resolved_info: fidl_fuchsia_component_resolution::Component,
211}
212
213impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
214    for RealmGetResolvedInfoResponse
215{
216}
217
218#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
219pub struct StorageAdminListStorageInRealmRequest {
220    pub relative_moniker: String,
221    pub iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
222}
223
224impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
225    for StorageAdminListStorageInRealmRequest
226{
227}
228
229#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
230pub struct StorageAdminOpenComponentStorageByIdRequest {
231    pub id: String,
232    pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
233}
234
235impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
236    for StorageAdminOpenComponentStorageByIdRequest
237{
238}
239
240#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
241pub struct StorageAdminOpenStorageRequest {
242    pub relative_moniker: String,
243    pub object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
244}
245
246impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
247    for StorageAdminOpenStorageRequest
248{
249}
250
251/// Payload for CapabilityRequested events
252#[derive(Debug, Default, PartialEq)]
253pub struct CapabilityRequestedPayload {
254    /// The name of the capability.
255    pub name: Option<String>,
256    /// A handle to the server end of the channel to host
257    /// capability.
258    pub capability: Option<fidl::Channel>,
259    #[doc(hidden)]
260    pub __source_breaking: fidl::marker::SourceBreaking,
261}
262
263impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
264    for CapabilityRequestedPayload
265{
266}
267
268#[derive(Debug, Default, PartialEq)]
269pub struct CreateChildArgs {
270    /// The numbered handles to pass to the component instance.
271    ///
272    /// If the runner for the component does not support the numbered handles it is
273    /// expected to close the handles.
274    pub numbered_handles: Option<Vec<fidl_fuchsia_process::HandleInfo>>,
275    /// Dynamic offers that will target the component instance.
276    ///
277    /// Including `OfferDecl`s in this vector will cause additional capabilities
278    /// to be offered to the newly created child, beyond the `OfferDecl`s in the
279    /// parent's `ComponentDecl` that target the collection.
280    ///
281    /// Any kind of offer (e.g., protocol, directory) can be used as a dynamic
282    /// offer. Any source that would be valid for a static offer is also valid
283    /// for a dynamic offer. Additionally, unlike static offers, dynamic offers
284    /// can use a "sibling" dynamic child component as a source by setting the
285    /// source to a `ChildRef` that sets the `collection` field.
286    ///
287    /// Dynamic offers always target the newly created child component. As a
288    /// result, `OfferDecl`s in `dynamic_offers` must not set the `target`
289    /// field, as its value is implied.
290    ///
291    /// If either the source (that is, the component named in the `source` field
292    /// of the `OfferDecl`) or the target of a dynamic offer is destroyed, the
293    /// offer itself is destroyed simultaneously.
294    ///
295    /// In order to set this field to a non-empty value, the collection in which
296    /// the child component is being created must specify
297    /// `ComponentDecl.allowed_offers = STATIC_AND_DYNAMIC`.
298    pub dynamic_offers: Option<Vec<fidl_fuchsia_component_decl::Offer>>,
299    /// The controller for this component, which may be used to influence the
300    /// component's lifecycle.
301    pub controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
302    /// A dictionary that contains extra capabilities for the component instance.
303    /// This field should be considered deprecated in favor of
304    /// `additional_inputs`. If both are set, an `INVALID_ARGUMENTS` error will
305    /// be returned.
306    pub dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
307    /// A handle to a dictionary created using
308    /// fuchsia.component.runtime.Capabilities that contains additional
309    /// capabilities that should be added to the inputs of the created child.
310    pub additional_inputs: Option<fidl::EventPair>,
311    #[doc(hidden)]
312    pub __source_breaking: fidl::marker::SourceBreaking,
313}
314
315impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateChildArgs {}
316
317/// Payload for DebugStarted events.
318#[derive(Debug, Default, PartialEq)]
319pub struct DebugStartedPayload {
320    /// The directory served by the runner to present runtime and runner-specific information
321    /// about the component. The other side is sent to the runner in ComponentStartInfo.
322    /// For example, it can be queried to know whether the component is an ELF component and
323    /// supports the break_on_start protocol below.
324    pub runtime_dir: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
325    /// An eventpair that can be used by debuggers to defer the launch of the component,
326    /// e.g., ELF debuggers can setup the exception channel on the job while holding
327    /// the eventpair, then drop the eventpair to notify the runner that processes could
328    /// be created. The other side is sent to the runner in ComponentStartInfo.
329    pub break_on_start: Option<fidl::EventPair>,
330    #[doc(hidden)]
331    pub __source_breaking: fidl::marker::SourceBreaking,
332}
333
334impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for DebugStartedPayload {}
335
336/// Contains all information about a single event
337#[derive(Debug, Default, PartialEq)]
338pub struct Event {
339    /// Information about the component for which this event was generated.
340    pub header: Option<EventHeader>,
341    /// Optional payload for some event types
342    pub payload: Option<EventPayload>,
343    #[doc(hidden)]
344    pub __source_breaking: fidl::marker::SourceBreaking,
345}
346
347impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Event {}
348
349/// A single component namespace entry, which describes a namespace mount point
350/// (`path`) and the directory backing it (`directory`). This type is usually
351/// composed inside a vector.  See `ComponentStartInfo.ns` for more details.
352#[derive(Debug, Default, PartialEq)]
353pub struct NamespaceEntry {
354    /// The mount point for the directory, including a
355    /// leading slash. For example: "/pkg", "/svc", or "/config/data".
356    pub path: Option<String>,
357    /// The directory mounted at the above `path`.
358    pub directory: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>>,
359    #[doc(hidden)]
360    pub __source_breaking: fidl::marker::SourceBreaking,
361}
362
363impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for NamespaceEntry {}
364
365#[derive(Debug, Default, PartialEq)]
366pub struct StartChildArgs {
367    /// The numbered handles to pass to the component instance.
368    ///
369    /// If the runner for the component does not support the numbered handles it
370    /// is expected to close the handles.
371    ///
372    /// If set, the values given here will override the handles given in
373    /// CreateChildArgs.
374    pub numbered_handles: Option<Vec<fidl_fuchsia_process::HandleInfo>>,
375    /// The namespace generated by component manager will be extended to include
376    /// any namespace entries listed here before being given to the component's
377    /// runner.
378    ///
379    /// If there are any conflicting entries, an error will occur when starting
380    /// the component.
381    pub namespace_entries: Option<Vec<NamespaceEntry>>,
382    /// A dictionary that contains extra capabilities for the component instance.
383    /// This field should be considered deprecated in favor of
384    /// `additional_inputs`. If both are set, an `INVALID_ARGUMENTS` error will
385    /// be returned.
386    pub dictionary: Option<fidl_fuchsia_component_sandbox::DictionaryRef>,
387    /// A handle to a dictionary created using
388    /// fuchsia.component.runtime.Capabilities that contains additional
389    /// capabilities that should be added to the inputs of the started program.
390    pub additional_inputs: Option<fidl::EventPair>,
391    #[doc(hidden)]
392    pub __source_breaking: fidl::marker::SourceBreaking,
393}
394
395impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StartChildArgs {}
396
397/// Encapsulates additional data/protocols for some event types.
398#[derive(Debug)]
399pub enum EventPayload {
400    /// Payload for CapabilityRequested events
401    CapabilityRequested(CapabilityRequestedPayload),
402    /// Payload for Purged events.
403    Purged(PurgedPayload),
404    /// Payload for Discovered events.
405    Discovered(DiscoveredPayload),
406    /// Payload for Destroyed events.
407    Destroyed(DestroyedPayload),
408    /// Payload for Resolved events
409    Resolved(ResolvedPayload),
410    /// Payload for Started events
411    Started(StartedPayload),
412    /// Payload for Stopped events
413    Stopped(StoppedPayload),
414    /// Payload for DebugStarted events
415    DebugStarted(DebugStartedPayload),
416    /// Payload for Unresolved events
417    Unresolved(UnresolvedPayload),
418    #[doc(hidden)]
419    __SourceBreaking { unknown_ordinal: u64 },
420}
421
422/// Pattern that matches an unknown `EventPayload` member.
423#[macro_export]
424macro_rules! EventPayloadUnknown {
425    () => {
426        _
427    };
428}
429
430// Custom PartialEq so that unknown variants are not equal to themselves.
431impl PartialEq for EventPayload {
432    fn eq(&self, other: &Self) -> bool {
433        match (self, other) {
434            (Self::CapabilityRequested(x), Self::CapabilityRequested(y)) => *x == *y,
435            (Self::Purged(x), Self::Purged(y)) => *x == *y,
436            (Self::Discovered(x), Self::Discovered(y)) => *x == *y,
437            (Self::Destroyed(x), Self::Destroyed(y)) => *x == *y,
438            (Self::Resolved(x), Self::Resolved(y)) => *x == *y,
439            (Self::Started(x), Self::Started(y)) => *x == *y,
440            (Self::Stopped(x), Self::Stopped(y)) => *x == *y,
441            (Self::DebugStarted(x), Self::DebugStarted(y)) => *x == *y,
442            (Self::Unresolved(x), Self::Unresolved(y)) => *x == *y,
443            _ => false,
444        }
445    }
446}
447
448impl EventPayload {
449    #[inline]
450    pub fn ordinal(&self) -> u64 {
451        match *self {
452            Self::CapabilityRequested(_) => 1,
453            Self::Purged(_) => 2,
454            Self::Discovered(_) => 4,
455            Self::Destroyed(_) => 5,
456            Self::Resolved(_) => 6,
457            Self::Started(_) => 7,
458            Self::Stopped(_) => 8,
459            Self::DebugStarted(_) => 9,
460            Self::Unresolved(_) => 10,
461            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
462        }
463    }
464
465    #[inline]
466    pub fn unknown_variant_for_testing() -> Self {
467        Self::__SourceBreaking { unknown_ordinal: 0 }
468    }
469
470    #[inline]
471    pub fn is_unknown(&self) -> bool {
472        match self {
473            Self::__SourceBreaking { .. } => true,
474            _ => false,
475        }
476    }
477}
478
479impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for EventPayload {}
480
481#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
482pub struct BinderMarker;
483
484impl fidl::endpoints::ProtocolMarker for BinderMarker {
485    type Proxy = BinderProxy;
486    type RequestStream = BinderRequestStream;
487    #[cfg(target_os = "fuchsia")]
488    type SynchronousProxy = BinderSynchronousProxy;
489
490    const DEBUG_NAME: &'static str = "fuchsia.component.Binder";
491}
492impl fidl::endpoints::DiscoverableProtocolMarker for BinderMarker {}
493
494pub trait BinderProxyInterface: Send + Sync {}
495#[derive(Debug)]
496#[cfg(target_os = "fuchsia")]
497pub struct BinderSynchronousProxy {
498    client: fidl::client::sync::Client,
499}
500
501#[cfg(target_os = "fuchsia")]
502impl fidl::endpoints::SynchronousProxy for BinderSynchronousProxy {
503    type Proxy = BinderProxy;
504    type Protocol = BinderMarker;
505
506    fn from_channel(inner: fidl::Channel) -> Self {
507        Self::new(inner)
508    }
509
510    fn into_channel(self) -> fidl::Channel {
511        self.client.into_channel()
512    }
513
514    fn as_channel(&self) -> &fidl::Channel {
515        self.client.as_channel()
516    }
517}
518
519#[cfg(target_os = "fuchsia")]
520impl BinderSynchronousProxy {
521    pub fn new(channel: fidl::Channel) -> Self {
522        Self { client: fidl::client::sync::Client::new(channel) }
523    }
524
525    pub fn into_channel(self) -> fidl::Channel {
526        self.client.into_channel()
527    }
528
529    /// Waits until an event arrives and returns it. It is safe for other
530    /// threads to make concurrent requests while waiting for an event.
531    pub fn wait_for_event(
532        &self,
533        deadline: zx::MonotonicInstant,
534    ) -> Result<BinderEvent, fidl::Error> {
535        BinderEvent::decode(self.client.wait_for_event::<BinderMarker>(deadline)?)
536    }
537}
538
539#[cfg(target_os = "fuchsia")]
540impl From<BinderSynchronousProxy> for zx::NullableHandle {
541    fn from(value: BinderSynchronousProxy) -> Self {
542        value.into_channel().into()
543    }
544}
545
546#[cfg(target_os = "fuchsia")]
547impl From<fidl::Channel> for BinderSynchronousProxy {
548    fn from(value: fidl::Channel) -> Self {
549        Self::new(value)
550    }
551}
552
553#[cfg(target_os = "fuchsia")]
554impl fidl::endpoints::FromClient for BinderSynchronousProxy {
555    type Protocol = BinderMarker;
556
557    fn from_client(value: fidl::endpoints::ClientEnd<BinderMarker>) -> Self {
558        Self::new(value.into_channel())
559    }
560}
561
562#[derive(Debug, Clone)]
563pub struct BinderProxy {
564    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
565}
566
567impl fidl::endpoints::Proxy for BinderProxy {
568    type Protocol = BinderMarker;
569
570    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
571        Self::new(inner)
572    }
573
574    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
575        self.client.into_channel().map_err(|client| Self { client })
576    }
577
578    fn as_channel(&self) -> &::fidl::AsyncChannel {
579        self.client.as_channel()
580    }
581}
582
583impl BinderProxy {
584    /// Create a new Proxy for fuchsia.component/Binder.
585    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
586        let protocol_name = <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
587        Self { client: fidl::client::Client::new(channel, protocol_name) }
588    }
589
590    /// Get a Stream of events from the remote end of the protocol.
591    ///
592    /// # Panics
593    ///
594    /// Panics if the event stream was already taken.
595    pub fn take_event_stream(&self) -> BinderEventStream {
596        BinderEventStream { event_receiver: self.client.take_event_receiver() }
597    }
598}
599
600impl BinderProxyInterface for BinderProxy {}
601
602pub struct BinderEventStream {
603    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
604}
605
606impl std::marker::Unpin for BinderEventStream {}
607
608impl futures::stream::FusedStream for BinderEventStream {
609    fn is_terminated(&self) -> bool {
610        self.event_receiver.is_terminated()
611    }
612}
613
614impl futures::Stream for BinderEventStream {
615    type Item = Result<BinderEvent, fidl::Error>;
616
617    fn poll_next(
618        mut self: std::pin::Pin<&mut Self>,
619        cx: &mut std::task::Context<'_>,
620    ) -> std::task::Poll<Option<Self::Item>> {
621        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
622            &mut self.event_receiver,
623            cx
624        )?) {
625            Some(buf) => std::task::Poll::Ready(Some(BinderEvent::decode(buf))),
626            None => std::task::Poll::Ready(None),
627        }
628    }
629}
630
631#[derive(Debug)]
632pub enum BinderEvent {}
633
634impl BinderEvent {
635    /// Decodes a message buffer as a [`BinderEvent`].
636    fn decode(
637        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
638    ) -> Result<BinderEvent, fidl::Error> {
639        let (bytes, _handles) = buf.split_mut();
640        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
641        debug_assert_eq!(tx_header.tx_id, 0);
642        match tx_header.ordinal {
643            _ => Err(fidl::Error::UnknownOrdinal {
644                ordinal: tx_header.ordinal,
645                protocol_name: <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
646            }),
647        }
648    }
649}
650
651/// A Stream of incoming requests for fuchsia.component/Binder.
652pub struct BinderRequestStream {
653    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
654    is_terminated: bool,
655}
656
657impl std::marker::Unpin for BinderRequestStream {}
658
659impl futures::stream::FusedStream for BinderRequestStream {
660    fn is_terminated(&self) -> bool {
661        self.is_terminated
662    }
663}
664
665impl fidl::endpoints::RequestStream for BinderRequestStream {
666    type Protocol = BinderMarker;
667    type ControlHandle = BinderControlHandle;
668
669    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
670        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
671    }
672
673    fn control_handle(&self) -> Self::ControlHandle {
674        BinderControlHandle { inner: self.inner.clone() }
675    }
676
677    fn into_inner(
678        self,
679    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
680    {
681        (self.inner, self.is_terminated)
682    }
683
684    fn from_inner(
685        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
686        is_terminated: bool,
687    ) -> Self {
688        Self { inner, is_terminated }
689    }
690}
691
692impl futures::Stream for BinderRequestStream {
693    type Item = Result<BinderRequest, fidl::Error>;
694
695    fn poll_next(
696        mut self: std::pin::Pin<&mut Self>,
697        cx: &mut std::task::Context<'_>,
698    ) -> std::task::Poll<Option<Self::Item>> {
699        let this = &mut *self;
700        if this.inner.check_shutdown(cx) {
701            this.is_terminated = true;
702            return std::task::Poll::Ready(None);
703        }
704        if this.is_terminated {
705            panic!("polled BinderRequestStream after completion");
706        }
707        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
708            |bytes, handles| {
709                match this.inner.channel().read_etc(cx, bytes, handles) {
710                    std::task::Poll::Ready(Ok(())) => {}
711                    std::task::Poll::Pending => return std::task::Poll::Pending,
712                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
713                        this.is_terminated = true;
714                        return std::task::Poll::Ready(None);
715                    }
716                    std::task::Poll::Ready(Err(e)) => {
717                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
718                            e.into(),
719                        ))));
720                    }
721                }
722
723                // A message has been received from the channel
724                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
725
726                std::task::Poll::Ready(Some(match header.ordinal {
727                    _ => Err(fidl::Error::UnknownOrdinal {
728                        ordinal: header.ordinal,
729                        protocol_name:
730                            <BinderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
731                    }),
732                }))
733            },
734        )
735    }
736}
737
738/// A framework-provided protocol that allows components that use it to bind to
739/// the component that exposes it. The act of connecting to this protocol will
740/// trigger the bind. Thus, this protocol contains no methods. For more details
741/// on binding, see
742/// https://fuchsia.dev/fuchsia-src/concepts/components/v2/lifecycle#binding.
743///
744/// When a component connects to protocol, the component exposing this capability
745/// will be started if it's not already running. Upon a failure to start, the
746/// component framework will close the server end of the channel with a
747/// zx.Status epitaph.
748#[derive(Debug)]
749pub enum BinderRequest {}
750
751impl BinderRequest {
752    /// Name of the method defined in FIDL
753    pub fn method_name(&self) -> &'static str {
754        match *self {}
755    }
756}
757
758#[derive(Debug, Clone)]
759pub struct BinderControlHandle {
760    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
761}
762
763impl BinderControlHandle {
764    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
765        self.inner.shutdown_with_epitaph(status.into())
766    }
767}
768
769impl fidl::endpoints::ControlHandle for BinderControlHandle {
770    fn shutdown(&self) {
771        self.inner.shutdown()
772    }
773
774    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
775        self.inner.shutdown_with_epitaph(status)
776    }
777
778    fn is_closed(&self) -> bool {
779        self.inner.channel().is_closed()
780    }
781    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
782        self.inner.channel().on_closed()
783    }
784
785    #[cfg(target_os = "fuchsia")]
786    fn signal_peer(
787        &self,
788        clear_mask: zx::Signals,
789        set_mask: zx::Signals,
790    ) -> Result<(), zx_status::Status> {
791        use fidl::Peered;
792        self.inner.channel().signal_peer(clear_mask, set_mask)
793    }
794}
795
796impl BinderControlHandle {}
797
798#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
799pub struct ChildIteratorMarker;
800
801impl fidl::endpoints::ProtocolMarker for ChildIteratorMarker {
802    type Proxy = ChildIteratorProxy;
803    type RequestStream = ChildIteratorRequestStream;
804    #[cfg(target_os = "fuchsia")]
805    type SynchronousProxy = ChildIteratorSynchronousProxy;
806
807    const DEBUG_NAME: &'static str = "(anonymous) ChildIterator";
808}
809
810pub trait ChildIteratorProxyInterface: Send + Sync {
811    type NextResponseFut: std::future::Future<
812            Output = Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error>,
813        > + Send;
814    fn r#next(&self) -> Self::NextResponseFut;
815}
816#[derive(Debug)]
817#[cfg(target_os = "fuchsia")]
818pub struct ChildIteratorSynchronousProxy {
819    client: fidl::client::sync::Client,
820}
821
822#[cfg(target_os = "fuchsia")]
823impl fidl::endpoints::SynchronousProxy for ChildIteratorSynchronousProxy {
824    type Proxy = ChildIteratorProxy;
825    type Protocol = ChildIteratorMarker;
826
827    fn from_channel(inner: fidl::Channel) -> Self {
828        Self::new(inner)
829    }
830
831    fn into_channel(self) -> fidl::Channel {
832        self.client.into_channel()
833    }
834
835    fn as_channel(&self) -> &fidl::Channel {
836        self.client.as_channel()
837    }
838}
839
840#[cfg(target_os = "fuchsia")]
841impl ChildIteratorSynchronousProxy {
842    pub fn new(channel: fidl::Channel) -> Self {
843        Self { client: fidl::client::sync::Client::new(channel) }
844    }
845
846    pub fn into_channel(self) -> fidl::Channel {
847        self.client.into_channel()
848    }
849
850    /// Waits until an event arrives and returns it. It is safe for other
851    /// threads to make concurrent requests while waiting for an event.
852    pub fn wait_for_event(
853        &self,
854        deadline: zx::MonotonicInstant,
855    ) -> Result<ChildIteratorEvent, fidl::Error> {
856        ChildIteratorEvent::decode(self.client.wait_for_event::<ChildIteratorMarker>(deadline)?)
857    }
858
859    /// Advance the iterator and return the next batch of children.
860    ///
861    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
862    /// no more children.
863    pub fn r#next(
864        &self,
865        ___deadline: zx::MonotonicInstant,
866    ) -> Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error> {
867        let _response = self.client.send_query::<
868            fidl::encoding::EmptyPayload,
869            ChildIteratorNextResponse,
870            ChildIteratorMarker,
871        >(
872            (),
873            0x40e4c3882b050d08,
874            fidl::encoding::DynamicFlags::empty(),
875            ___deadline,
876        )?;
877        Ok(_response.children)
878    }
879}
880
881#[cfg(target_os = "fuchsia")]
882impl From<ChildIteratorSynchronousProxy> for zx::NullableHandle {
883    fn from(value: ChildIteratorSynchronousProxy) -> Self {
884        value.into_channel().into()
885    }
886}
887
888#[cfg(target_os = "fuchsia")]
889impl From<fidl::Channel> for ChildIteratorSynchronousProxy {
890    fn from(value: fidl::Channel) -> Self {
891        Self::new(value)
892    }
893}
894
895#[cfg(target_os = "fuchsia")]
896impl fidl::endpoints::FromClient for ChildIteratorSynchronousProxy {
897    type Protocol = ChildIteratorMarker;
898
899    fn from_client(value: fidl::endpoints::ClientEnd<ChildIteratorMarker>) -> Self {
900        Self::new(value.into_channel())
901    }
902}
903
904#[derive(Debug, Clone)]
905pub struct ChildIteratorProxy {
906    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
907}
908
909impl fidl::endpoints::Proxy for ChildIteratorProxy {
910    type Protocol = ChildIteratorMarker;
911
912    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
913        Self::new(inner)
914    }
915
916    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
917        self.client.into_channel().map_err(|client| Self { client })
918    }
919
920    fn as_channel(&self) -> &::fidl::AsyncChannel {
921        self.client.as_channel()
922    }
923}
924
925impl ChildIteratorProxy {
926    /// Create a new Proxy for fuchsia.component/ChildIterator.
927    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
928        let protocol_name = <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
929        Self { client: fidl::client::Client::new(channel, protocol_name) }
930    }
931
932    /// Get a Stream of events from the remote end of the protocol.
933    ///
934    /// # Panics
935    ///
936    /// Panics if the event stream was already taken.
937    pub fn take_event_stream(&self) -> ChildIteratorEventStream {
938        ChildIteratorEventStream { event_receiver: self.client.take_event_receiver() }
939    }
940
941    /// Advance the iterator and return the next batch of children.
942    ///
943    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
944    /// no more children.
945    pub fn r#next(
946        &self,
947    ) -> fidl::client::QueryResponseFut<
948        Vec<fidl_fuchsia_component_decl::ChildRef>,
949        fidl::encoding::DefaultFuchsiaResourceDialect,
950    > {
951        ChildIteratorProxyInterface::r#next(self)
952    }
953}
954
955impl ChildIteratorProxyInterface for ChildIteratorProxy {
956    type NextResponseFut = fidl::client::QueryResponseFut<
957        Vec<fidl_fuchsia_component_decl::ChildRef>,
958        fidl::encoding::DefaultFuchsiaResourceDialect,
959    >;
960    fn r#next(&self) -> Self::NextResponseFut {
961        fn _decode(
962            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
963        ) -> Result<Vec<fidl_fuchsia_component_decl::ChildRef>, fidl::Error> {
964            let _response = fidl::client::decode_transaction_body::<
965                ChildIteratorNextResponse,
966                fidl::encoding::DefaultFuchsiaResourceDialect,
967                0x40e4c3882b050d08,
968            >(_buf?)?;
969            Ok(_response.children)
970        }
971        self.client.send_query_and_decode::<
972            fidl::encoding::EmptyPayload,
973            Vec<fidl_fuchsia_component_decl::ChildRef>,
974        >(
975            (),
976            0x40e4c3882b050d08,
977            fidl::encoding::DynamicFlags::empty(),
978            _decode,
979        )
980    }
981}
982
983pub struct ChildIteratorEventStream {
984    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
985}
986
987impl std::marker::Unpin for ChildIteratorEventStream {}
988
989impl futures::stream::FusedStream for ChildIteratorEventStream {
990    fn is_terminated(&self) -> bool {
991        self.event_receiver.is_terminated()
992    }
993}
994
995impl futures::Stream for ChildIteratorEventStream {
996    type Item = Result<ChildIteratorEvent, fidl::Error>;
997
998    fn poll_next(
999        mut self: std::pin::Pin<&mut Self>,
1000        cx: &mut std::task::Context<'_>,
1001    ) -> std::task::Poll<Option<Self::Item>> {
1002        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1003            &mut self.event_receiver,
1004            cx
1005        )?) {
1006            Some(buf) => std::task::Poll::Ready(Some(ChildIteratorEvent::decode(buf))),
1007            None => std::task::Poll::Ready(None),
1008        }
1009    }
1010}
1011
1012#[derive(Debug)]
1013pub enum ChildIteratorEvent {}
1014
1015impl ChildIteratorEvent {
1016    /// Decodes a message buffer as a [`ChildIteratorEvent`].
1017    fn decode(
1018        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1019    ) -> Result<ChildIteratorEvent, fidl::Error> {
1020        let (bytes, _handles) = buf.split_mut();
1021        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1022        debug_assert_eq!(tx_header.tx_id, 0);
1023        match tx_header.ordinal {
1024            _ => Err(fidl::Error::UnknownOrdinal {
1025                ordinal: tx_header.ordinal,
1026                protocol_name: <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1027            }),
1028        }
1029    }
1030}
1031
1032/// A Stream of incoming requests for fuchsia.component/ChildIterator.
1033pub struct ChildIteratorRequestStream {
1034    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1035    is_terminated: bool,
1036}
1037
1038impl std::marker::Unpin for ChildIteratorRequestStream {}
1039
1040impl futures::stream::FusedStream for ChildIteratorRequestStream {
1041    fn is_terminated(&self) -> bool {
1042        self.is_terminated
1043    }
1044}
1045
1046impl fidl::endpoints::RequestStream for ChildIteratorRequestStream {
1047    type Protocol = ChildIteratorMarker;
1048    type ControlHandle = ChildIteratorControlHandle;
1049
1050    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1051        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1052    }
1053
1054    fn control_handle(&self) -> Self::ControlHandle {
1055        ChildIteratorControlHandle { inner: self.inner.clone() }
1056    }
1057
1058    fn into_inner(
1059        self,
1060    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1061    {
1062        (self.inner, self.is_terminated)
1063    }
1064
1065    fn from_inner(
1066        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1067        is_terminated: bool,
1068    ) -> Self {
1069        Self { inner, is_terminated }
1070    }
1071}
1072
1073impl futures::Stream for ChildIteratorRequestStream {
1074    type Item = Result<ChildIteratorRequest, fidl::Error>;
1075
1076    fn poll_next(
1077        mut self: std::pin::Pin<&mut Self>,
1078        cx: &mut std::task::Context<'_>,
1079    ) -> std::task::Poll<Option<Self::Item>> {
1080        let this = &mut *self;
1081        if this.inner.check_shutdown(cx) {
1082            this.is_terminated = true;
1083            return std::task::Poll::Ready(None);
1084        }
1085        if this.is_terminated {
1086            panic!("polled ChildIteratorRequestStream after completion");
1087        }
1088        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1089            |bytes, handles| {
1090                match this.inner.channel().read_etc(cx, bytes, handles) {
1091                    std::task::Poll::Ready(Ok(())) => {}
1092                    std::task::Poll::Pending => return std::task::Poll::Pending,
1093                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1094                        this.is_terminated = true;
1095                        return std::task::Poll::Ready(None);
1096                    }
1097                    std::task::Poll::Ready(Err(e)) => {
1098                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1099                            e.into(),
1100                        ))));
1101                    }
1102                }
1103
1104                // A message has been received from the channel
1105                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1106
1107                std::task::Poll::Ready(Some(match header.ordinal {
1108                    0x40e4c3882b050d08 => {
1109                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1110                        let mut req = fidl::new_empty!(
1111                            fidl::encoding::EmptyPayload,
1112                            fidl::encoding::DefaultFuchsiaResourceDialect
1113                        );
1114                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1115                        let control_handle =
1116                            ChildIteratorControlHandle { inner: this.inner.clone() };
1117                        Ok(ChildIteratorRequest::Next {
1118                            responder: ChildIteratorNextResponder {
1119                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1120                                tx_id: header.tx_id,
1121                            },
1122                        })
1123                    }
1124                    _ => Err(fidl::Error::UnknownOrdinal {
1125                        ordinal: header.ordinal,
1126                        protocol_name:
1127                            <ChildIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1128                    }),
1129                }))
1130            },
1131        )
1132    }
1133}
1134
1135/// A protocol to iterate over the list of children in a realm.
1136#[derive(Debug)]
1137pub enum ChildIteratorRequest {
1138    /// Advance the iterator and return the next batch of children.
1139    ///
1140    /// Returns a vector of `ChildRef`. Returns an empty vector when there are
1141    /// no more children.
1142    Next { responder: ChildIteratorNextResponder },
1143}
1144
1145impl ChildIteratorRequest {
1146    #[allow(irrefutable_let_patterns)]
1147    pub fn into_next(self) -> Option<(ChildIteratorNextResponder)> {
1148        if let ChildIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
1149    }
1150
1151    /// Name of the method defined in FIDL
1152    pub fn method_name(&self) -> &'static str {
1153        match *self {
1154            ChildIteratorRequest::Next { .. } => "next",
1155        }
1156    }
1157}
1158
1159#[derive(Debug, Clone)]
1160pub struct ChildIteratorControlHandle {
1161    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1162}
1163
1164impl ChildIteratorControlHandle {
1165    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1166        self.inner.shutdown_with_epitaph(status.into())
1167    }
1168}
1169
1170impl fidl::endpoints::ControlHandle for ChildIteratorControlHandle {
1171    fn shutdown(&self) {
1172        self.inner.shutdown()
1173    }
1174
1175    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1176        self.inner.shutdown_with_epitaph(status)
1177    }
1178
1179    fn is_closed(&self) -> bool {
1180        self.inner.channel().is_closed()
1181    }
1182    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1183        self.inner.channel().on_closed()
1184    }
1185
1186    #[cfg(target_os = "fuchsia")]
1187    fn signal_peer(
1188        &self,
1189        clear_mask: zx::Signals,
1190        set_mask: zx::Signals,
1191    ) -> Result<(), zx_status::Status> {
1192        use fidl::Peered;
1193        self.inner.channel().signal_peer(clear_mask, set_mask)
1194    }
1195}
1196
1197impl ChildIteratorControlHandle {}
1198
1199#[must_use = "FIDL methods require a response to be sent"]
1200#[derive(Debug)]
1201pub struct ChildIteratorNextResponder {
1202    control_handle: std::mem::ManuallyDrop<ChildIteratorControlHandle>,
1203    tx_id: u32,
1204}
1205
1206/// Set the the channel to be shutdown (see [`ChildIteratorControlHandle::shutdown`])
1207/// if the responder is dropped without sending a response, so that the client
1208/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1209impl std::ops::Drop for ChildIteratorNextResponder {
1210    fn drop(&mut self) {
1211        self.control_handle.shutdown();
1212        // Safety: drops once, never accessed again
1213        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1214    }
1215}
1216
1217impl fidl::endpoints::Responder for ChildIteratorNextResponder {
1218    type ControlHandle = ChildIteratorControlHandle;
1219
1220    fn control_handle(&self) -> &ChildIteratorControlHandle {
1221        &self.control_handle
1222    }
1223
1224    fn drop_without_shutdown(mut self) {
1225        // Safety: drops once, never accessed again due to mem::forget
1226        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1227        // Prevent Drop from running (which would shut down the channel)
1228        std::mem::forget(self);
1229    }
1230}
1231
1232impl ChildIteratorNextResponder {
1233    /// Sends a response to the FIDL transaction.
1234    ///
1235    /// Sets the channel to shutdown if an error occurs.
1236    pub fn send(
1237        self,
1238        mut children: &[fidl_fuchsia_component_decl::ChildRef],
1239    ) -> Result<(), fidl::Error> {
1240        let _result = self.send_raw(children);
1241        if _result.is_err() {
1242            self.control_handle.shutdown();
1243        }
1244        self.drop_without_shutdown();
1245        _result
1246    }
1247
1248    /// Similar to "send" but does not shutdown the channel if an error occurs.
1249    pub fn send_no_shutdown_on_err(
1250        self,
1251        mut children: &[fidl_fuchsia_component_decl::ChildRef],
1252    ) -> Result<(), fidl::Error> {
1253        let _result = self.send_raw(children);
1254        self.drop_without_shutdown();
1255        _result
1256    }
1257
1258    fn send_raw(
1259        &self,
1260        mut children: &[fidl_fuchsia_component_decl::ChildRef],
1261    ) -> Result<(), fidl::Error> {
1262        self.control_handle.inner.send::<ChildIteratorNextResponse>(
1263            (children,),
1264            self.tx_id,
1265            0x40e4c3882b050d08,
1266            fidl::encoding::DynamicFlags::empty(),
1267        )
1268    }
1269}
1270
1271#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1272pub struct ControllerMarker;
1273
1274impl fidl::endpoints::ProtocolMarker for ControllerMarker {
1275    type Proxy = ControllerProxy;
1276    type RequestStream = ControllerRequestStream;
1277    #[cfg(target_os = "fuchsia")]
1278    type SynchronousProxy = ControllerSynchronousProxy;
1279
1280    const DEBUG_NAME: &'static str = "(anonymous) Controller";
1281}
1282pub type ControllerStartResult = Result<(), Error>;
1283pub type ControllerIsStartedResult = Result<bool, Error>;
1284pub type ControllerOpenExposedDirResult = Result<(), Error>;
1285pub type ControllerGetExposedDictionaryResult =
1286    Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>;
1287pub type ControllerGetOutputDictionaryResult = Result<fidl::EventPair, Error>;
1288pub type ControllerDestroyResult = Result<(), Error>;
1289
1290pub trait ControllerProxyInterface: Send + Sync {
1291    type StartResponseFut: std::future::Future<Output = Result<ControllerStartResult, fidl::Error>>
1292        + Send;
1293    fn r#start(
1294        &self,
1295        args: StartChildArgs,
1296        execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1297    ) -> Self::StartResponseFut;
1298    type IsStartedResponseFut: std::future::Future<Output = Result<ControllerIsStartedResult, fidl::Error>>
1299        + Send;
1300    fn r#is_started(&self) -> Self::IsStartedResponseFut;
1301    type OpenExposedDirResponseFut: std::future::Future<Output = Result<ControllerOpenExposedDirResult, fidl::Error>>
1302        + Send;
1303    fn r#open_exposed_dir(
1304        &self,
1305        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1306    ) -> Self::OpenExposedDirResponseFut;
1307    type GetExposedDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetExposedDictionaryResult, fidl::Error>>
1308        + Send;
1309    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut;
1310    type GetOutputDictionaryResponseFut: std::future::Future<Output = Result<ControllerGetOutputDictionaryResult, fidl::Error>>
1311        + Send;
1312    fn r#get_output_dictionary(&self) -> Self::GetOutputDictionaryResponseFut;
1313    type DestroyResponseFut: std::future::Future<Output = Result<ControllerDestroyResult, fidl::Error>>
1314        + Send;
1315    fn r#destroy(&self) -> Self::DestroyResponseFut;
1316}
1317#[derive(Debug)]
1318#[cfg(target_os = "fuchsia")]
1319pub struct ControllerSynchronousProxy {
1320    client: fidl::client::sync::Client,
1321}
1322
1323#[cfg(target_os = "fuchsia")]
1324impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
1325    type Proxy = ControllerProxy;
1326    type Protocol = ControllerMarker;
1327
1328    fn from_channel(inner: fidl::Channel) -> Self {
1329        Self::new(inner)
1330    }
1331
1332    fn into_channel(self) -> fidl::Channel {
1333        self.client.into_channel()
1334    }
1335
1336    fn as_channel(&self) -> &fidl::Channel {
1337        self.client.as_channel()
1338    }
1339}
1340
1341#[cfg(target_os = "fuchsia")]
1342impl ControllerSynchronousProxy {
1343    pub fn new(channel: fidl::Channel) -> Self {
1344        Self { client: fidl::client::sync::Client::new(channel) }
1345    }
1346
1347    pub fn into_channel(self) -> fidl::Channel {
1348        self.client.into_channel()
1349    }
1350
1351    /// Waits until an event arrives and returns it. It is safe for other
1352    /// threads to make concurrent requests while waiting for an event.
1353    pub fn wait_for_event(
1354        &self,
1355        deadline: zx::MonotonicInstant,
1356    ) -> Result<ControllerEvent, fidl::Error> {
1357        ControllerEvent::decode(self.client.wait_for_event::<ControllerMarker>(deadline)?)
1358    }
1359
1360    /// Start the component, optionally providing additional handles to be given
1361    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1362    /// currently running.
1363    pub fn r#start(
1364        &self,
1365        mut args: StartChildArgs,
1366        mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1367        ___deadline: zx::MonotonicInstant,
1368    ) -> Result<ControllerStartResult, fidl::Error> {
1369        let _response = self.client.send_query::<
1370            ControllerStartRequest,
1371            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1372            ControllerMarker,
1373        >(
1374            (&mut args, execution_controller,),
1375            0x68878076b8d2eac5,
1376            fidl::encoding::DynamicFlags::FLEXIBLE,
1377            ___deadline,
1378        )?
1379        .into_result::<ControllerMarker>("start")?;
1380        Ok(_response.map(|x| x))
1381    }
1382
1383    /// Returns true if this instance is currently running.
1384    pub fn r#is_started(
1385        &self,
1386        ___deadline: zx::MonotonicInstant,
1387    ) -> Result<ControllerIsStartedResult, fidl::Error> {
1388        let _response = self.client.send_query::<
1389            fidl::encoding::EmptyPayload,
1390            fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1391            ControllerMarker,
1392        >(
1393            (),
1394            0x2155e6e1db2083c3,
1395            fidl::encoding::DynamicFlags::FLEXIBLE,
1396            ___deadline,
1397        )?
1398        .into_result::<ControllerMarker>("is_started")?;
1399        Ok(_response.map(|x| x.is_started))
1400    }
1401
1402    /// Opens the exposed directory of the controlled component, through which
1403    /// capabilities the component exposed via `ComponentDecl.exposes` are
1404    /// available, on success.
1405    ///
1406    /// Binding to the exposed directory requires that the component be
1407    /// resolved, but it will not be started until/unless some capability is
1408    /// requested that requires it to be.
1409    ///
1410    /// If this component is destroyed, any outstanding connections to
1411    /// `exposed_dir` will be closed.
1412    ///
1413    /// Errors:
1414    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
1415    pub fn r#open_exposed_dir(
1416        &self,
1417        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1418        ___deadline: zx::MonotonicInstant,
1419    ) -> Result<ControllerOpenExposedDirResult, fidl::Error> {
1420        let _response = self.client.send_query::<
1421            ControllerOpenExposedDirRequest,
1422            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1423            ControllerMarker,
1424        >(
1425            (exposed_dir,),
1426            0x253cabb9a840ed94,
1427            fidl::encoding::DynamicFlags::empty(),
1428            ___deadline,
1429        )?;
1430        Ok(_response.map(|x| x))
1431    }
1432
1433    /// Returns the dictionary containing the component's exposed capabilities.
1434    pub fn r#get_exposed_dictionary(
1435        &self,
1436        ___deadline: zx::MonotonicInstant,
1437    ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1438        let _response = self.client.send_query::<
1439            fidl::encoding::EmptyPayload,
1440            fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1441            ControllerMarker,
1442        >(
1443            (),
1444            0x7e48373e5eda1f9b,
1445            fidl::encoding::DynamicFlags::FLEXIBLE,
1446            ___deadline,
1447        )?
1448        .into_result::<ControllerMarker>("get_exposed_dictionary")?;
1449        Ok(_response.map(|x| x.dictionary))
1450    }
1451
1452    /// Returns a reference to the component's output dictionary, which may be
1453    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
1454    pub fn r#get_output_dictionary(
1455        &self,
1456        ___deadline: zx::MonotonicInstant,
1457    ) -> Result<ControllerGetOutputDictionaryResult, fidl::Error> {
1458        let _response = self.client.send_query::<
1459            fidl::encoding::EmptyPayload,
1460            fidl::encoding::FlexibleResultType<ControllerGetOutputDictionaryResponse, Error>,
1461            ControllerMarker,
1462        >(
1463            (),
1464            0x3a0c4696620ad221,
1465            fidl::encoding::DynamicFlags::FLEXIBLE,
1466            ___deadline,
1467        )?
1468        .into_result::<ControllerMarker>("get_output_dictionary")?;
1469        Ok(_response.map(|x| x.dictionary))
1470    }
1471
1472    /// Destroys this component. When this method returns, the component is
1473    /// either destroyed or in the case of an error no destruction happened.
1474    ///
1475    /// Errors:
1476    ///
1477    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1478    /// Currently, this can happen if the component is a static child of its
1479    /// parent.
1480    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
1481    ///   manager's logs will contain more detail.
1482    pub fn r#destroy(
1483        &self,
1484        ___deadline: zx::MonotonicInstant,
1485    ) -> Result<ControllerDestroyResult, fidl::Error> {
1486        let _response = self.client.send_query::<
1487            fidl::encoding::EmptyPayload,
1488            fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1489            ControllerMarker,
1490        >(
1491            (),
1492            0x74529fa68b5c1741,
1493            fidl::encoding::DynamicFlags::FLEXIBLE,
1494            ___deadline,
1495        )?
1496        .into_result::<ControllerMarker>("destroy")?;
1497        Ok(_response.map(|x| x))
1498    }
1499}
1500
1501#[cfg(target_os = "fuchsia")]
1502impl From<ControllerSynchronousProxy> for zx::NullableHandle {
1503    fn from(value: ControllerSynchronousProxy) -> Self {
1504        value.into_channel().into()
1505    }
1506}
1507
1508#[cfg(target_os = "fuchsia")]
1509impl From<fidl::Channel> for ControllerSynchronousProxy {
1510    fn from(value: fidl::Channel) -> Self {
1511        Self::new(value)
1512    }
1513}
1514
1515#[cfg(target_os = "fuchsia")]
1516impl fidl::endpoints::FromClient for ControllerSynchronousProxy {
1517    type Protocol = ControllerMarker;
1518
1519    fn from_client(value: fidl::endpoints::ClientEnd<ControllerMarker>) -> Self {
1520        Self::new(value.into_channel())
1521    }
1522}
1523
1524#[derive(Debug, Clone)]
1525pub struct ControllerProxy {
1526    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1527}
1528
1529impl fidl::endpoints::Proxy for ControllerProxy {
1530    type Protocol = ControllerMarker;
1531
1532    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1533        Self::new(inner)
1534    }
1535
1536    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1537        self.client.into_channel().map_err(|client| Self { client })
1538    }
1539
1540    fn as_channel(&self) -> &::fidl::AsyncChannel {
1541        self.client.as_channel()
1542    }
1543}
1544
1545impl ControllerProxy {
1546    /// Create a new Proxy for fuchsia.component/Controller.
1547    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1548        let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1549        Self { client: fidl::client::Client::new(channel, protocol_name) }
1550    }
1551
1552    /// Get a Stream of events from the remote end of the protocol.
1553    ///
1554    /// # Panics
1555    ///
1556    /// Panics if the event stream was already taken.
1557    pub fn take_event_stream(&self) -> ControllerEventStream {
1558        ControllerEventStream { event_receiver: self.client.take_event_receiver() }
1559    }
1560
1561    /// Start the component, optionally providing additional handles to be given
1562    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
1563    /// currently running.
1564    pub fn r#start(
1565        &self,
1566        mut args: StartChildArgs,
1567        mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1568    ) -> fidl::client::QueryResponseFut<
1569        ControllerStartResult,
1570        fidl::encoding::DefaultFuchsiaResourceDialect,
1571    > {
1572        ControllerProxyInterface::r#start(self, args, execution_controller)
1573    }
1574
1575    /// Returns true if this instance is currently running.
1576    pub fn r#is_started(
1577        &self,
1578    ) -> fidl::client::QueryResponseFut<
1579        ControllerIsStartedResult,
1580        fidl::encoding::DefaultFuchsiaResourceDialect,
1581    > {
1582        ControllerProxyInterface::r#is_started(self)
1583    }
1584
1585    /// Opens the exposed directory of the controlled component, through which
1586    /// capabilities the component exposed via `ComponentDecl.exposes` are
1587    /// available, on success.
1588    ///
1589    /// Binding to the exposed directory requires that the component be
1590    /// resolved, but it will not be started until/unless some capability is
1591    /// requested that requires it to be.
1592    ///
1593    /// If this component is destroyed, any outstanding connections to
1594    /// `exposed_dir` will be closed.
1595    ///
1596    /// Errors:
1597    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
1598    pub fn r#open_exposed_dir(
1599        &self,
1600        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1601    ) -> fidl::client::QueryResponseFut<
1602        ControllerOpenExposedDirResult,
1603        fidl::encoding::DefaultFuchsiaResourceDialect,
1604    > {
1605        ControllerProxyInterface::r#open_exposed_dir(self, exposed_dir)
1606    }
1607
1608    /// Returns the dictionary containing the component's exposed capabilities.
1609    pub fn r#get_exposed_dictionary(
1610        &self,
1611    ) -> fidl::client::QueryResponseFut<
1612        ControllerGetExposedDictionaryResult,
1613        fidl::encoding::DefaultFuchsiaResourceDialect,
1614    > {
1615        ControllerProxyInterface::r#get_exposed_dictionary(self)
1616    }
1617
1618    /// Returns a reference to the component's output dictionary, which may be
1619    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
1620    pub fn r#get_output_dictionary(
1621        &self,
1622    ) -> fidl::client::QueryResponseFut<
1623        ControllerGetOutputDictionaryResult,
1624        fidl::encoding::DefaultFuchsiaResourceDialect,
1625    > {
1626        ControllerProxyInterface::r#get_output_dictionary(self)
1627    }
1628
1629    /// Destroys this component. When this method returns, the component is
1630    /// either destroyed or in the case of an error no destruction happened.
1631    ///
1632    /// Errors:
1633    ///
1634    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
1635    /// Currently, this can happen if the component is a static child of its
1636    /// parent.
1637    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
1638    ///   manager's logs will contain more detail.
1639    pub fn r#destroy(
1640        &self,
1641    ) -> fidl::client::QueryResponseFut<
1642        ControllerDestroyResult,
1643        fidl::encoding::DefaultFuchsiaResourceDialect,
1644    > {
1645        ControllerProxyInterface::r#destroy(self)
1646    }
1647}
1648
1649impl ControllerProxyInterface for ControllerProxy {
1650    type StartResponseFut = fidl::client::QueryResponseFut<
1651        ControllerStartResult,
1652        fidl::encoding::DefaultFuchsiaResourceDialect,
1653    >;
1654    fn r#start(
1655        &self,
1656        mut args: StartChildArgs,
1657        mut execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
1658    ) -> Self::StartResponseFut {
1659        fn _decode(
1660            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1661        ) -> Result<ControllerStartResult, fidl::Error> {
1662            let _response = fidl::client::decode_transaction_body::<
1663                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1664                fidl::encoding::DefaultFuchsiaResourceDialect,
1665                0x68878076b8d2eac5,
1666            >(_buf?)?
1667            .into_result::<ControllerMarker>("start")?;
1668            Ok(_response.map(|x| x))
1669        }
1670        self.client.send_query_and_decode::<ControllerStartRequest, ControllerStartResult>(
1671            (&mut args, execution_controller),
1672            0x68878076b8d2eac5,
1673            fidl::encoding::DynamicFlags::FLEXIBLE,
1674            _decode,
1675        )
1676    }
1677
1678    type IsStartedResponseFut = fidl::client::QueryResponseFut<
1679        ControllerIsStartedResult,
1680        fidl::encoding::DefaultFuchsiaResourceDialect,
1681    >;
1682    fn r#is_started(&self) -> Self::IsStartedResponseFut {
1683        fn _decode(
1684            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1685        ) -> Result<ControllerIsStartedResult, fidl::Error> {
1686            let _response = fidl::client::decode_transaction_body::<
1687                fidl::encoding::FlexibleResultType<ControllerIsStartedResponse, Error>,
1688                fidl::encoding::DefaultFuchsiaResourceDialect,
1689                0x2155e6e1db2083c3,
1690            >(_buf?)?
1691            .into_result::<ControllerMarker>("is_started")?;
1692            Ok(_response.map(|x| x.is_started))
1693        }
1694        self.client
1695            .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerIsStartedResult>(
1696                (),
1697                0x2155e6e1db2083c3,
1698                fidl::encoding::DynamicFlags::FLEXIBLE,
1699                _decode,
1700            )
1701    }
1702
1703    type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
1704        ControllerOpenExposedDirResult,
1705        fidl::encoding::DefaultFuchsiaResourceDialect,
1706    >;
1707    fn r#open_exposed_dir(
1708        &self,
1709        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1710    ) -> Self::OpenExposedDirResponseFut {
1711        fn _decode(
1712            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1713        ) -> Result<ControllerOpenExposedDirResult, fidl::Error> {
1714            let _response = fidl::client::decode_transaction_body::<
1715                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
1716                fidl::encoding::DefaultFuchsiaResourceDialect,
1717                0x253cabb9a840ed94,
1718            >(_buf?)?;
1719            Ok(_response.map(|x| x))
1720        }
1721        self.client.send_query_and_decode::<
1722            ControllerOpenExposedDirRequest,
1723            ControllerOpenExposedDirResult,
1724        >(
1725            (exposed_dir,),
1726            0x253cabb9a840ed94,
1727            fidl::encoding::DynamicFlags::empty(),
1728            _decode,
1729        )
1730    }
1731
1732    type GetExposedDictionaryResponseFut = fidl::client::QueryResponseFut<
1733        ControllerGetExposedDictionaryResult,
1734        fidl::encoding::DefaultFuchsiaResourceDialect,
1735    >;
1736    fn r#get_exposed_dictionary(&self) -> Self::GetExposedDictionaryResponseFut {
1737        fn _decode(
1738            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1739        ) -> Result<ControllerGetExposedDictionaryResult, fidl::Error> {
1740            let _response = fidl::client::decode_transaction_body::<
1741                fidl::encoding::FlexibleResultType<ControllerGetExposedDictionaryResponse, Error>,
1742                fidl::encoding::DefaultFuchsiaResourceDialect,
1743                0x7e48373e5eda1f9b,
1744            >(_buf?)?
1745            .into_result::<ControllerMarker>("get_exposed_dictionary")?;
1746            Ok(_response.map(|x| x.dictionary))
1747        }
1748        self.client.send_query_and_decode::<
1749            fidl::encoding::EmptyPayload,
1750            ControllerGetExposedDictionaryResult,
1751        >(
1752            (),
1753            0x7e48373e5eda1f9b,
1754            fidl::encoding::DynamicFlags::FLEXIBLE,
1755            _decode,
1756        )
1757    }
1758
1759    type GetOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
1760        ControllerGetOutputDictionaryResult,
1761        fidl::encoding::DefaultFuchsiaResourceDialect,
1762    >;
1763    fn r#get_output_dictionary(&self) -> Self::GetOutputDictionaryResponseFut {
1764        fn _decode(
1765            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1766        ) -> Result<ControllerGetOutputDictionaryResult, fidl::Error> {
1767            let _response = fidl::client::decode_transaction_body::<
1768                fidl::encoding::FlexibleResultType<ControllerGetOutputDictionaryResponse, Error>,
1769                fidl::encoding::DefaultFuchsiaResourceDialect,
1770                0x3a0c4696620ad221,
1771            >(_buf?)?
1772            .into_result::<ControllerMarker>("get_output_dictionary")?;
1773            Ok(_response.map(|x| x.dictionary))
1774        }
1775        self.client.send_query_and_decode::<
1776            fidl::encoding::EmptyPayload,
1777            ControllerGetOutputDictionaryResult,
1778        >(
1779            (),
1780            0x3a0c4696620ad221,
1781            fidl::encoding::DynamicFlags::FLEXIBLE,
1782            _decode,
1783        )
1784    }
1785
1786    type DestroyResponseFut = fidl::client::QueryResponseFut<
1787        ControllerDestroyResult,
1788        fidl::encoding::DefaultFuchsiaResourceDialect,
1789    >;
1790    fn r#destroy(&self) -> Self::DestroyResponseFut {
1791        fn _decode(
1792            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1793        ) -> Result<ControllerDestroyResult, fidl::Error> {
1794            let _response = fidl::client::decode_transaction_body::<
1795                fidl::encoding::FlexibleResultType<fidl::encoding::EmptyStruct, Error>,
1796                fidl::encoding::DefaultFuchsiaResourceDialect,
1797                0x74529fa68b5c1741,
1798            >(_buf?)?
1799            .into_result::<ControllerMarker>("destroy")?;
1800            Ok(_response.map(|x| x))
1801        }
1802        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerDestroyResult>(
1803            (),
1804            0x74529fa68b5c1741,
1805            fidl::encoding::DynamicFlags::FLEXIBLE,
1806            _decode,
1807        )
1808    }
1809}
1810
1811pub struct ControllerEventStream {
1812    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1813}
1814
1815impl std::marker::Unpin for ControllerEventStream {}
1816
1817impl futures::stream::FusedStream for ControllerEventStream {
1818    fn is_terminated(&self) -> bool {
1819        self.event_receiver.is_terminated()
1820    }
1821}
1822
1823impl futures::Stream for ControllerEventStream {
1824    type Item = Result<ControllerEvent, fidl::Error>;
1825
1826    fn poll_next(
1827        mut self: std::pin::Pin<&mut Self>,
1828        cx: &mut std::task::Context<'_>,
1829    ) -> std::task::Poll<Option<Self::Item>> {
1830        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1831            &mut self.event_receiver,
1832            cx
1833        )?) {
1834            Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1835            None => std::task::Poll::Ready(None),
1836        }
1837    }
1838}
1839
1840#[derive(Debug)]
1841pub enum ControllerEvent {
1842    #[non_exhaustive]
1843    _UnknownEvent {
1844        /// Ordinal of the event that was sent.
1845        ordinal: u64,
1846    },
1847}
1848
1849impl ControllerEvent {
1850    /// Decodes a message buffer as a [`ControllerEvent`].
1851    fn decode(
1852        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1853    ) -> Result<ControllerEvent, fidl::Error> {
1854        let (bytes, _handles) = buf.split_mut();
1855        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1856        debug_assert_eq!(tx_header.tx_id, 0);
1857        match tx_header.ordinal {
1858            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
1859                Ok(ControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
1860            }
1861            _ => Err(fidl::Error::UnknownOrdinal {
1862                ordinal: tx_header.ordinal,
1863                protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1864            }),
1865        }
1866    }
1867}
1868
1869/// A Stream of incoming requests for fuchsia.component/Controller.
1870pub struct ControllerRequestStream {
1871    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1872    is_terminated: bool,
1873}
1874
1875impl std::marker::Unpin for ControllerRequestStream {}
1876
1877impl futures::stream::FusedStream for ControllerRequestStream {
1878    fn is_terminated(&self) -> bool {
1879        self.is_terminated
1880    }
1881}
1882
1883impl fidl::endpoints::RequestStream for ControllerRequestStream {
1884    type Protocol = ControllerMarker;
1885    type ControlHandle = ControllerControlHandle;
1886
1887    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1888        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1889    }
1890
1891    fn control_handle(&self) -> Self::ControlHandle {
1892        ControllerControlHandle { inner: self.inner.clone() }
1893    }
1894
1895    fn into_inner(
1896        self,
1897    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1898    {
1899        (self.inner, self.is_terminated)
1900    }
1901
1902    fn from_inner(
1903        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1904        is_terminated: bool,
1905    ) -> Self {
1906        Self { inner, is_terminated }
1907    }
1908}
1909
1910impl futures::Stream for ControllerRequestStream {
1911    type Item = Result<ControllerRequest, fidl::Error>;
1912
1913    fn poll_next(
1914        mut self: std::pin::Pin<&mut Self>,
1915        cx: &mut std::task::Context<'_>,
1916    ) -> std::task::Poll<Option<Self::Item>> {
1917        let this = &mut *self;
1918        if this.inner.check_shutdown(cx) {
1919            this.is_terminated = true;
1920            return std::task::Poll::Ready(None);
1921        }
1922        if this.is_terminated {
1923            panic!("polled ControllerRequestStream after completion");
1924        }
1925        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1926            |bytes, handles| {
1927                match this.inner.channel().read_etc(cx, bytes, handles) {
1928                    std::task::Poll::Ready(Ok(())) => {}
1929                    std::task::Poll::Pending => return std::task::Poll::Pending,
1930                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1931                        this.is_terminated = true;
1932                        return std::task::Poll::Ready(None);
1933                    }
1934                    std::task::Poll::Ready(Err(e)) => {
1935                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1936                            e.into(),
1937                        ))));
1938                    }
1939                }
1940
1941                // A message has been received from the channel
1942                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1943
1944                std::task::Poll::Ready(Some(match header.ordinal {
1945                    0x68878076b8d2eac5 => {
1946                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1947                        let mut req = fidl::new_empty!(
1948                            ControllerStartRequest,
1949                            fidl::encoding::DefaultFuchsiaResourceDialect
1950                        );
1951                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerStartRequest>(&header, _body_bytes, handles, &mut req)?;
1952                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1953                        Ok(ControllerRequest::Start {
1954                            args: req.args,
1955                            execution_controller: req.execution_controller,
1956
1957                            responder: ControllerStartResponder {
1958                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1959                                tx_id: header.tx_id,
1960                            },
1961                        })
1962                    }
1963                    0x2155e6e1db2083c3 => {
1964                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1965                        let mut req = fidl::new_empty!(
1966                            fidl::encoding::EmptyPayload,
1967                            fidl::encoding::DefaultFuchsiaResourceDialect
1968                        );
1969                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1970                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1971                        Ok(ControllerRequest::IsStarted {
1972                            responder: ControllerIsStartedResponder {
1973                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1974                                tx_id: header.tx_id,
1975                            },
1976                        })
1977                    }
1978                    0x253cabb9a840ed94 => {
1979                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1980                        let mut req = fidl::new_empty!(
1981                            ControllerOpenExposedDirRequest,
1982                            fidl::encoding::DefaultFuchsiaResourceDialect
1983                        );
1984                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
1985                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1986                        Ok(ControllerRequest::OpenExposedDir {
1987                            exposed_dir: req.exposed_dir,
1988
1989                            responder: ControllerOpenExposedDirResponder {
1990                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1991                                tx_id: header.tx_id,
1992                            },
1993                        })
1994                    }
1995                    0x7e48373e5eda1f9b => {
1996                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1997                        let mut req = fidl::new_empty!(
1998                            fidl::encoding::EmptyPayload,
1999                            fidl::encoding::DefaultFuchsiaResourceDialect
2000                        );
2001                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2002                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
2003                        Ok(ControllerRequest::GetExposedDictionary {
2004                            responder: ControllerGetExposedDictionaryResponder {
2005                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2006                                tx_id: header.tx_id,
2007                            },
2008                        })
2009                    }
2010                    0x3a0c4696620ad221 => {
2011                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2012                        let mut req = fidl::new_empty!(
2013                            fidl::encoding::EmptyPayload,
2014                            fidl::encoding::DefaultFuchsiaResourceDialect
2015                        );
2016                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2017                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
2018                        Ok(ControllerRequest::GetOutputDictionary {
2019                            responder: ControllerGetOutputDictionaryResponder {
2020                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2021                                tx_id: header.tx_id,
2022                            },
2023                        })
2024                    }
2025                    0x74529fa68b5c1741 => {
2026                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2027                        let mut req = fidl::new_empty!(
2028                            fidl::encoding::EmptyPayload,
2029                            fidl::encoding::DefaultFuchsiaResourceDialect
2030                        );
2031                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2032                        let control_handle = ControllerControlHandle { inner: this.inner.clone() };
2033                        Ok(ControllerRequest::Destroy {
2034                            responder: ControllerDestroyResponder {
2035                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2036                                tx_id: header.tx_id,
2037                            },
2038                        })
2039                    }
2040                    _ if header.tx_id == 0
2041                        && header
2042                            .dynamic_flags()
2043                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2044                    {
2045                        Ok(ControllerRequest::_UnknownMethod {
2046                            ordinal: header.ordinal,
2047                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
2048                            method_type: fidl::MethodType::OneWay,
2049                        })
2050                    }
2051                    _ if header
2052                        .dynamic_flags()
2053                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
2054                    {
2055                        this.inner.send_framework_err(
2056                            fidl::encoding::FrameworkErr::UnknownMethod,
2057                            header.tx_id,
2058                            header.ordinal,
2059                            header.dynamic_flags(),
2060                            (bytes, handles),
2061                        )?;
2062                        Ok(ControllerRequest::_UnknownMethod {
2063                            ordinal: header.ordinal,
2064                            control_handle: ControllerControlHandle { inner: this.inner.clone() },
2065                            method_type: fidl::MethodType::TwoWay,
2066                        })
2067                    }
2068                    _ => Err(fidl::Error::UnknownOrdinal {
2069                        ordinal: header.ordinal,
2070                        protocol_name:
2071                            <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2072                    }),
2073                }))
2074            },
2075        )
2076    }
2077}
2078
2079/// A protocol used to operate on a component.
2080///
2081/// One may get access to a `Controller` when creating a component with the
2082/// `Realm.CreateChild` method. You may also obtain a `Controller` for an
2083/// existing child component with the `Realm.OpenController` method.
2084#[derive(Debug)]
2085pub enum ControllerRequest {
2086    /// Start the component, optionally providing additional handles to be given
2087    /// to the component. Returns INSTANCE_ALREADY_RUNNING if the instance is
2088    /// currently running.
2089    Start {
2090        args: StartChildArgs,
2091        execution_controller: fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
2092        responder: ControllerStartResponder,
2093    },
2094    /// Returns true if this instance is currently running.
2095    IsStarted { responder: ControllerIsStartedResponder },
2096    /// Opens the exposed directory of the controlled component, through which
2097    /// capabilities the component exposed via `ComponentDecl.exposes` are
2098    /// available, on success.
2099    ///
2100    /// Binding to the exposed directory requires that the component be
2101    /// resolved, but it will not be started until/unless some capability is
2102    /// requested that requires it to be.
2103    ///
2104    /// If this component is destroyed, any outstanding connections to
2105    /// `exposed_dir` will be closed.
2106    ///
2107    /// Errors:
2108    /// - `INSTANCE_CANNOT_RESOLVE`: This component failed to resolve.
2109    OpenExposedDir {
2110        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2111        responder: ControllerOpenExposedDirResponder,
2112    },
2113    /// Returns the dictionary containing the component's exposed capabilities.
2114    GetExposedDictionary { responder: ControllerGetExposedDictionaryResponder },
2115    /// Returns a reference to the component's output dictionary, which may be
2116    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
2117    GetOutputDictionary { responder: ControllerGetOutputDictionaryResponder },
2118    /// Destroys this component. When this method returns, the component is
2119    /// either destroyed or in the case of an error no destruction happened.
2120    ///
2121    /// Errors:
2122    ///
2123    /// - `ACCESS_DENIED`: Destruction of this component is not allowed.
2124    /// Currently, this can happen if the component is a static child of its
2125    /// parent.
2126    /// - `INTERNAL`: Something prevented destruction from succeeding -- component
2127    ///   manager's logs will contain more detail.
2128    Destroy { responder: ControllerDestroyResponder },
2129    /// An interaction was received which does not match any known method.
2130    #[non_exhaustive]
2131    _UnknownMethod {
2132        /// Ordinal of the method that was called.
2133        ordinal: u64,
2134        control_handle: ControllerControlHandle,
2135        method_type: fidl::MethodType,
2136    },
2137}
2138
2139impl ControllerRequest {
2140    #[allow(irrefutable_let_patterns)]
2141    pub fn into_start(
2142        self,
2143    ) -> Option<(
2144        StartChildArgs,
2145        fidl::endpoints::ServerEnd<ExecutionControllerMarker>,
2146        ControllerStartResponder,
2147    )> {
2148        if let ControllerRequest::Start { args, execution_controller, responder } = self {
2149            Some((args, execution_controller, responder))
2150        } else {
2151            None
2152        }
2153    }
2154
2155    #[allow(irrefutable_let_patterns)]
2156    pub fn into_is_started(self) -> Option<(ControllerIsStartedResponder)> {
2157        if let ControllerRequest::IsStarted { responder } = self { Some((responder)) } else { None }
2158    }
2159
2160    #[allow(irrefutable_let_patterns)]
2161    pub fn into_open_exposed_dir(
2162        self,
2163    ) -> Option<(
2164        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2165        ControllerOpenExposedDirResponder,
2166    )> {
2167        if let ControllerRequest::OpenExposedDir { exposed_dir, responder } = self {
2168            Some((exposed_dir, responder))
2169        } else {
2170            None
2171        }
2172    }
2173
2174    #[allow(irrefutable_let_patterns)]
2175    pub fn into_get_exposed_dictionary(self) -> Option<(ControllerGetExposedDictionaryResponder)> {
2176        if let ControllerRequest::GetExposedDictionary { responder } = self {
2177            Some((responder))
2178        } else {
2179            None
2180        }
2181    }
2182
2183    #[allow(irrefutable_let_patterns)]
2184    pub fn into_get_output_dictionary(self) -> Option<(ControllerGetOutputDictionaryResponder)> {
2185        if let ControllerRequest::GetOutputDictionary { responder } = self {
2186            Some((responder))
2187        } else {
2188            None
2189        }
2190    }
2191
2192    #[allow(irrefutable_let_patterns)]
2193    pub fn into_destroy(self) -> Option<(ControllerDestroyResponder)> {
2194        if let ControllerRequest::Destroy { responder } = self { Some((responder)) } else { None }
2195    }
2196
2197    /// Name of the method defined in FIDL
2198    pub fn method_name(&self) -> &'static str {
2199        match *self {
2200            ControllerRequest::Start { .. } => "start",
2201            ControllerRequest::IsStarted { .. } => "is_started",
2202            ControllerRequest::OpenExposedDir { .. } => "open_exposed_dir",
2203            ControllerRequest::GetExposedDictionary { .. } => "get_exposed_dictionary",
2204            ControllerRequest::GetOutputDictionary { .. } => "get_output_dictionary",
2205            ControllerRequest::Destroy { .. } => "destroy",
2206            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
2207                "unknown one-way method"
2208            }
2209            ControllerRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
2210                "unknown two-way method"
2211            }
2212        }
2213    }
2214}
2215
2216#[derive(Debug, Clone)]
2217pub struct ControllerControlHandle {
2218    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2219}
2220
2221impl ControllerControlHandle {
2222    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2223        self.inner.shutdown_with_epitaph(status.into())
2224    }
2225}
2226
2227impl fidl::endpoints::ControlHandle for ControllerControlHandle {
2228    fn shutdown(&self) {
2229        self.inner.shutdown()
2230    }
2231
2232    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2233        self.inner.shutdown_with_epitaph(status)
2234    }
2235
2236    fn is_closed(&self) -> bool {
2237        self.inner.channel().is_closed()
2238    }
2239    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2240        self.inner.channel().on_closed()
2241    }
2242
2243    #[cfg(target_os = "fuchsia")]
2244    fn signal_peer(
2245        &self,
2246        clear_mask: zx::Signals,
2247        set_mask: zx::Signals,
2248    ) -> Result<(), zx_status::Status> {
2249        use fidl::Peered;
2250        self.inner.channel().signal_peer(clear_mask, set_mask)
2251    }
2252}
2253
2254impl ControllerControlHandle {}
2255
2256#[must_use = "FIDL methods require a response to be sent"]
2257#[derive(Debug)]
2258pub struct ControllerStartResponder {
2259    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2260    tx_id: u32,
2261}
2262
2263/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2264/// if the responder is dropped without sending a response, so that the client
2265/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2266impl std::ops::Drop for ControllerStartResponder {
2267    fn drop(&mut self) {
2268        self.control_handle.shutdown();
2269        // Safety: drops once, never accessed again
2270        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2271    }
2272}
2273
2274impl fidl::endpoints::Responder for ControllerStartResponder {
2275    type ControlHandle = ControllerControlHandle;
2276
2277    fn control_handle(&self) -> &ControllerControlHandle {
2278        &self.control_handle
2279    }
2280
2281    fn drop_without_shutdown(mut self) {
2282        // Safety: drops once, never accessed again due to mem::forget
2283        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2284        // Prevent Drop from running (which would shut down the channel)
2285        std::mem::forget(self);
2286    }
2287}
2288
2289impl ControllerStartResponder {
2290    /// Sends a response to the FIDL transaction.
2291    ///
2292    /// Sets the channel to shutdown if an error occurs.
2293    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2294        let _result = self.send_raw(result);
2295        if _result.is_err() {
2296            self.control_handle.shutdown();
2297        }
2298        self.drop_without_shutdown();
2299        _result
2300    }
2301
2302    /// Similar to "send" but does not shutdown the channel if an error occurs.
2303    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2304        let _result = self.send_raw(result);
2305        self.drop_without_shutdown();
2306        _result
2307    }
2308
2309    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2310        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2311            fidl::encoding::EmptyStruct,
2312            Error,
2313        >>(
2314            fidl::encoding::FlexibleResult::new(result),
2315            self.tx_id,
2316            0x68878076b8d2eac5,
2317            fidl::encoding::DynamicFlags::FLEXIBLE,
2318        )
2319    }
2320}
2321
2322#[must_use = "FIDL methods require a response to be sent"]
2323#[derive(Debug)]
2324pub struct ControllerIsStartedResponder {
2325    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2326    tx_id: u32,
2327}
2328
2329/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2330/// if the responder is dropped without sending a response, so that the client
2331/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2332impl std::ops::Drop for ControllerIsStartedResponder {
2333    fn drop(&mut self) {
2334        self.control_handle.shutdown();
2335        // Safety: drops once, never accessed again
2336        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2337    }
2338}
2339
2340impl fidl::endpoints::Responder for ControllerIsStartedResponder {
2341    type ControlHandle = ControllerControlHandle;
2342
2343    fn control_handle(&self) -> &ControllerControlHandle {
2344        &self.control_handle
2345    }
2346
2347    fn drop_without_shutdown(mut self) {
2348        // Safety: drops once, never accessed again due to mem::forget
2349        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2350        // Prevent Drop from running (which would shut down the channel)
2351        std::mem::forget(self);
2352    }
2353}
2354
2355impl ControllerIsStartedResponder {
2356    /// Sends a response to the FIDL transaction.
2357    ///
2358    /// Sets the channel to shutdown if an error occurs.
2359    pub fn send(self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
2360        let _result = self.send_raw(result);
2361        if _result.is_err() {
2362            self.control_handle.shutdown();
2363        }
2364        self.drop_without_shutdown();
2365        _result
2366    }
2367
2368    /// Similar to "send" but does not shutdown the channel if an error occurs.
2369    pub fn send_no_shutdown_on_err(
2370        self,
2371        mut result: Result<bool, Error>,
2372    ) -> Result<(), fidl::Error> {
2373        let _result = self.send_raw(result);
2374        self.drop_without_shutdown();
2375        _result
2376    }
2377
2378    fn send_raw(&self, mut result: Result<bool, Error>) -> Result<(), fidl::Error> {
2379        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2380            ControllerIsStartedResponse,
2381            Error,
2382        >>(
2383            fidl::encoding::FlexibleResult::new(result.map(|is_started| (is_started,))),
2384            self.tx_id,
2385            0x2155e6e1db2083c3,
2386            fidl::encoding::DynamicFlags::FLEXIBLE,
2387        )
2388    }
2389}
2390
2391#[must_use = "FIDL methods require a response to be sent"]
2392#[derive(Debug)]
2393pub struct ControllerOpenExposedDirResponder {
2394    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2395    tx_id: u32,
2396}
2397
2398/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2399/// if the responder is dropped without sending a response, so that the client
2400/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2401impl std::ops::Drop for ControllerOpenExposedDirResponder {
2402    fn drop(&mut self) {
2403        self.control_handle.shutdown();
2404        // Safety: drops once, never accessed again
2405        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2406    }
2407}
2408
2409impl fidl::endpoints::Responder for ControllerOpenExposedDirResponder {
2410    type ControlHandle = ControllerControlHandle;
2411
2412    fn control_handle(&self) -> &ControllerControlHandle {
2413        &self.control_handle
2414    }
2415
2416    fn drop_without_shutdown(mut self) {
2417        // Safety: drops once, never accessed again due to mem::forget
2418        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2419        // Prevent Drop from running (which would shut down the channel)
2420        std::mem::forget(self);
2421    }
2422}
2423
2424impl ControllerOpenExposedDirResponder {
2425    /// Sends a response to the FIDL transaction.
2426    ///
2427    /// Sets the channel to shutdown if an error occurs.
2428    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2429        let _result = self.send_raw(result);
2430        if _result.is_err() {
2431            self.control_handle.shutdown();
2432        }
2433        self.drop_without_shutdown();
2434        _result
2435    }
2436
2437    /// Similar to "send" but does not shutdown the channel if an error occurs.
2438    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2439        let _result = self.send_raw(result);
2440        self.drop_without_shutdown();
2441        _result
2442    }
2443
2444    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2445        self.control_handle
2446            .inner
2447            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
2448                result,
2449                self.tx_id,
2450                0x253cabb9a840ed94,
2451                fidl::encoding::DynamicFlags::empty(),
2452            )
2453    }
2454}
2455
2456#[must_use = "FIDL methods require a response to be sent"]
2457#[derive(Debug)]
2458pub struct ControllerGetExposedDictionaryResponder {
2459    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2460    tx_id: u32,
2461}
2462
2463/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2464/// if the responder is dropped without sending a response, so that the client
2465/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2466impl std::ops::Drop for ControllerGetExposedDictionaryResponder {
2467    fn drop(&mut self) {
2468        self.control_handle.shutdown();
2469        // Safety: drops once, never accessed again
2470        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2471    }
2472}
2473
2474impl fidl::endpoints::Responder for ControllerGetExposedDictionaryResponder {
2475    type ControlHandle = ControllerControlHandle;
2476
2477    fn control_handle(&self) -> &ControllerControlHandle {
2478        &self.control_handle
2479    }
2480
2481    fn drop_without_shutdown(mut self) {
2482        // Safety: drops once, never accessed again due to mem::forget
2483        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2484        // Prevent Drop from running (which would shut down the channel)
2485        std::mem::forget(self);
2486    }
2487}
2488
2489impl ControllerGetExposedDictionaryResponder {
2490    /// Sends a response to the FIDL transaction.
2491    ///
2492    /// Sets the channel to shutdown if an error occurs.
2493    pub fn send(
2494        self,
2495        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2496    ) -> Result<(), fidl::Error> {
2497        let _result = self.send_raw(result);
2498        if _result.is_err() {
2499            self.control_handle.shutdown();
2500        }
2501        self.drop_without_shutdown();
2502        _result
2503    }
2504
2505    /// Similar to "send" but does not shutdown the channel if an error occurs.
2506    pub fn send_no_shutdown_on_err(
2507        self,
2508        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2509    ) -> Result<(), fidl::Error> {
2510        let _result = self.send_raw(result);
2511        self.drop_without_shutdown();
2512        _result
2513    }
2514
2515    fn send_raw(
2516        &self,
2517        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
2518    ) -> Result<(), fidl::Error> {
2519        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2520            ControllerGetExposedDictionaryResponse,
2521            Error,
2522        >>(
2523            fidl::encoding::FlexibleResult::new(
2524                result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
2525            ),
2526            self.tx_id,
2527            0x7e48373e5eda1f9b,
2528            fidl::encoding::DynamicFlags::FLEXIBLE,
2529        )
2530    }
2531}
2532
2533#[must_use = "FIDL methods require a response to be sent"]
2534#[derive(Debug)]
2535pub struct ControllerGetOutputDictionaryResponder {
2536    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2537    tx_id: u32,
2538}
2539
2540/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2541/// if the responder is dropped without sending a response, so that the client
2542/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2543impl std::ops::Drop for ControllerGetOutputDictionaryResponder {
2544    fn drop(&mut self) {
2545        self.control_handle.shutdown();
2546        // Safety: drops once, never accessed again
2547        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2548    }
2549}
2550
2551impl fidl::endpoints::Responder for ControllerGetOutputDictionaryResponder {
2552    type ControlHandle = ControllerControlHandle;
2553
2554    fn control_handle(&self) -> &ControllerControlHandle {
2555        &self.control_handle
2556    }
2557
2558    fn drop_without_shutdown(mut self) {
2559        // Safety: drops once, never accessed again due to mem::forget
2560        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2561        // Prevent Drop from running (which would shut down the channel)
2562        std::mem::forget(self);
2563    }
2564}
2565
2566impl ControllerGetOutputDictionaryResponder {
2567    /// Sends a response to the FIDL transaction.
2568    ///
2569    /// Sets the channel to shutdown if an error occurs.
2570    pub fn send(self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
2571        let _result = self.send_raw(result);
2572        if _result.is_err() {
2573            self.control_handle.shutdown();
2574        }
2575        self.drop_without_shutdown();
2576        _result
2577    }
2578
2579    /// Similar to "send" but does not shutdown the channel if an error occurs.
2580    pub fn send_no_shutdown_on_err(
2581        self,
2582        mut result: Result<fidl::EventPair, Error>,
2583    ) -> Result<(), fidl::Error> {
2584        let _result = self.send_raw(result);
2585        self.drop_without_shutdown();
2586        _result
2587    }
2588
2589    fn send_raw(&self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
2590        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2591            ControllerGetOutputDictionaryResponse,
2592            Error,
2593        >>(
2594            fidl::encoding::FlexibleResult::new(result.map(|dictionary| (dictionary,))),
2595            self.tx_id,
2596            0x3a0c4696620ad221,
2597            fidl::encoding::DynamicFlags::FLEXIBLE,
2598        )
2599    }
2600}
2601
2602#[must_use = "FIDL methods require a response to be sent"]
2603#[derive(Debug)]
2604pub struct ControllerDestroyResponder {
2605    control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
2606    tx_id: u32,
2607}
2608
2609/// Set the the channel to be shutdown (see [`ControllerControlHandle::shutdown`])
2610/// if the responder is dropped without sending a response, so that the client
2611/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2612impl std::ops::Drop for ControllerDestroyResponder {
2613    fn drop(&mut self) {
2614        self.control_handle.shutdown();
2615        // Safety: drops once, never accessed again
2616        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2617    }
2618}
2619
2620impl fidl::endpoints::Responder for ControllerDestroyResponder {
2621    type ControlHandle = ControllerControlHandle;
2622
2623    fn control_handle(&self) -> &ControllerControlHandle {
2624        &self.control_handle
2625    }
2626
2627    fn drop_without_shutdown(mut self) {
2628        // Safety: drops once, never accessed again due to mem::forget
2629        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2630        // Prevent Drop from running (which would shut down the channel)
2631        std::mem::forget(self);
2632    }
2633}
2634
2635impl ControllerDestroyResponder {
2636    /// Sends a response to the FIDL transaction.
2637    ///
2638    /// Sets the channel to shutdown if an error occurs.
2639    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2640        let _result = self.send_raw(result);
2641        if _result.is_err() {
2642            self.control_handle.shutdown();
2643        }
2644        self.drop_without_shutdown();
2645        _result
2646    }
2647
2648    /// Similar to "send" but does not shutdown the channel if an error occurs.
2649    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2650        let _result = self.send_raw(result);
2651        self.drop_without_shutdown();
2652        _result
2653    }
2654
2655    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
2656        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
2657            fidl::encoding::EmptyStruct,
2658            Error,
2659        >>(
2660            fidl::encoding::FlexibleResult::new(result),
2661            self.tx_id,
2662            0x74529fa68b5c1741,
2663            fidl::encoding::DynamicFlags::FLEXIBLE,
2664        )
2665    }
2666}
2667
2668#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2669pub struct EventStreamMarker;
2670
2671impl fidl::endpoints::ProtocolMarker for EventStreamMarker {
2672    type Proxy = EventStreamProxy;
2673    type RequestStream = EventStreamRequestStream;
2674    #[cfg(target_os = "fuchsia")]
2675    type SynchronousProxy = EventStreamSynchronousProxy;
2676
2677    const DEBUG_NAME: &'static str = "fuchsia.component.EventStream";
2678}
2679impl fidl::endpoints::DiscoverableProtocolMarker for EventStreamMarker {}
2680
2681pub trait EventStreamProxyInterface: Send + Sync {
2682    type GetNextResponseFut: std::future::Future<Output = Result<Vec<Event>, fidl::Error>> + Send;
2683    fn r#get_next(&self) -> Self::GetNextResponseFut;
2684    type WaitForReadyResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
2685    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut;
2686}
2687#[derive(Debug)]
2688#[cfg(target_os = "fuchsia")]
2689pub struct EventStreamSynchronousProxy {
2690    client: fidl::client::sync::Client,
2691}
2692
2693#[cfg(target_os = "fuchsia")]
2694impl fidl::endpoints::SynchronousProxy for EventStreamSynchronousProxy {
2695    type Proxy = EventStreamProxy;
2696    type Protocol = EventStreamMarker;
2697
2698    fn from_channel(inner: fidl::Channel) -> Self {
2699        Self::new(inner)
2700    }
2701
2702    fn into_channel(self) -> fidl::Channel {
2703        self.client.into_channel()
2704    }
2705
2706    fn as_channel(&self) -> &fidl::Channel {
2707        self.client.as_channel()
2708    }
2709}
2710
2711#[cfg(target_os = "fuchsia")]
2712impl EventStreamSynchronousProxy {
2713    pub fn new(channel: fidl::Channel) -> Self {
2714        Self { client: fidl::client::sync::Client::new(channel) }
2715    }
2716
2717    pub fn into_channel(self) -> fidl::Channel {
2718        self.client.into_channel()
2719    }
2720
2721    /// Waits until an event arrives and returns it. It is safe for other
2722    /// threads to make concurrent requests while waiting for an event.
2723    pub fn wait_for_event(
2724        &self,
2725        deadline: zx::MonotonicInstant,
2726    ) -> Result<EventStreamEvent, fidl::Error> {
2727        EventStreamEvent::decode(self.client.wait_for_event::<EventStreamMarker>(deadline)?)
2728    }
2729
2730    pub fn r#get_next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<Event>, fidl::Error> {
2731        let _response = self.client.send_query::<
2732            fidl::encoding::EmptyPayload,
2733            EventStreamGetNextResponse,
2734            EventStreamMarker,
2735        >(
2736            (),
2737            0x3f24c9495978eb86,
2738            fidl::encoding::DynamicFlags::empty(),
2739            ___deadline,
2740        )?;
2741        Ok(_response.events)
2742    }
2743
2744    /// Returns immediately. Used to indicate that the FIDL connection
2745    /// completed. This is needed for non-static streams to verify
2746    /// that subscribe has completed before components are started.
2747    pub fn r#wait_for_ready(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
2748        let _response = self.client.send_query::<
2749            fidl::encoding::EmptyPayload,
2750            fidl::encoding::EmptyPayload,
2751            EventStreamMarker,
2752        >(
2753            (),
2754            0x31331f9578d2e682,
2755            fidl::encoding::DynamicFlags::empty(),
2756            ___deadline,
2757        )?;
2758        Ok(_response)
2759    }
2760}
2761
2762#[cfg(target_os = "fuchsia")]
2763impl From<EventStreamSynchronousProxy> for zx::NullableHandle {
2764    fn from(value: EventStreamSynchronousProxy) -> Self {
2765        value.into_channel().into()
2766    }
2767}
2768
2769#[cfg(target_os = "fuchsia")]
2770impl From<fidl::Channel> for EventStreamSynchronousProxy {
2771    fn from(value: fidl::Channel) -> Self {
2772        Self::new(value)
2773    }
2774}
2775
2776#[cfg(target_os = "fuchsia")]
2777impl fidl::endpoints::FromClient for EventStreamSynchronousProxy {
2778    type Protocol = EventStreamMarker;
2779
2780    fn from_client(value: fidl::endpoints::ClientEnd<EventStreamMarker>) -> Self {
2781        Self::new(value.into_channel())
2782    }
2783}
2784
2785#[derive(Debug, Clone)]
2786pub struct EventStreamProxy {
2787    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2788}
2789
2790impl fidl::endpoints::Proxy for EventStreamProxy {
2791    type Protocol = EventStreamMarker;
2792
2793    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2794        Self::new(inner)
2795    }
2796
2797    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2798        self.client.into_channel().map_err(|client| Self { client })
2799    }
2800
2801    fn as_channel(&self) -> &::fidl::AsyncChannel {
2802        self.client.as_channel()
2803    }
2804}
2805
2806impl EventStreamProxy {
2807    /// Create a new Proxy for fuchsia.component/EventStream.
2808    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2809        let protocol_name = <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2810        Self { client: fidl::client::Client::new(channel, protocol_name) }
2811    }
2812
2813    /// Get a Stream of events from the remote end of the protocol.
2814    ///
2815    /// # Panics
2816    ///
2817    /// Panics if the event stream was already taken.
2818    pub fn take_event_stream(&self) -> EventStreamEventStream {
2819        EventStreamEventStream { event_receiver: self.client.take_event_receiver() }
2820    }
2821
2822    pub fn r#get_next(
2823        &self,
2824    ) -> fidl::client::QueryResponseFut<Vec<Event>, fidl::encoding::DefaultFuchsiaResourceDialect>
2825    {
2826        EventStreamProxyInterface::r#get_next(self)
2827    }
2828
2829    /// Returns immediately. Used to indicate that the FIDL connection
2830    /// completed. This is needed for non-static streams to verify
2831    /// that subscribe has completed before components are started.
2832    pub fn r#wait_for_ready(
2833        &self,
2834    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
2835        EventStreamProxyInterface::r#wait_for_ready(self)
2836    }
2837}
2838
2839impl EventStreamProxyInterface for EventStreamProxy {
2840    type GetNextResponseFut =
2841        fidl::client::QueryResponseFut<Vec<Event>, fidl::encoding::DefaultFuchsiaResourceDialect>;
2842    fn r#get_next(&self) -> Self::GetNextResponseFut {
2843        fn _decode(
2844            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2845        ) -> Result<Vec<Event>, fidl::Error> {
2846            let _response = fidl::client::decode_transaction_body::<
2847                EventStreamGetNextResponse,
2848                fidl::encoding::DefaultFuchsiaResourceDialect,
2849                0x3f24c9495978eb86,
2850            >(_buf?)?;
2851            Ok(_response.events)
2852        }
2853        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<Event>>(
2854            (),
2855            0x3f24c9495978eb86,
2856            fidl::encoding::DynamicFlags::empty(),
2857            _decode,
2858        )
2859    }
2860
2861    type WaitForReadyResponseFut =
2862        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
2863    fn r#wait_for_ready(&self) -> Self::WaitForReadyResponseFut {
2864        fn _decode(
2865            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2866        ) -> Result<(), fidl::Error> {
2867            let _response = fidl::client::decode_transaction_body::<
2868                fidl::encoding::EmptyPayload,
2869                fidl::encoding::DefaultFuchsiaResourceDialect,
2870                0x31331f9578d2e682,
2871            >(_buf?)?;
2872            Ok(_response)
2873        }
2874        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
2875            (),
2876            0x31331f9578d2e682,
2877            fidl::encoding::DynamicFlags::empty(),
2878            _decode,
2879        )
2880    }
2881}
2882
2883pub struct EventStreamEventStream {
2884    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2885}
2886
2887impl std::marker::Unpin for EventStreamEventStream {}
2888
2889impl futures::stream::FusedStream for EventStreamEventStream {
2890    fn is_terminated(&self) -> bool {
2891        self.event_receiver.is_terminated()
2892    }
2893}
2894
2895impl futures::Stream for EventStreamEventStream {
2896    type Item = Result<EventStreamEvent, fidl::Error>;
2897
2898    fn poll_next(
2899        mut self: std::pin::Pin<&mut Self>,
2900        cx: &mut std::task::Context<'_>,
2901    ) -> std::task::Poll<Option<Self::Item>> {
2902        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2903            &mut self.event_receiver,
2904            cx
2905        )?) {
2906            Some(buf) => std::task::Poll::Ready(Some(EventStreamEvent::decode(buf))),
2907            None => std::task::Poll::Ready(None),
2908        }
2909    }
2910}
2911
2912#[derive(Debug)]
2913pub enum EventStreamEvent {}
2914
2915impl EventStreamEvent {
2916    /// Decodes a message buffer as a [`EventStreamEvent`].
2917    fn decode(
2918        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2919    ) -> Result<EventStreamEvent, fidl::Error> {
2920        let (bytes, _handles) = buf.split_mut();
2921        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2922        debug_assert_eq!(tx_header.tx_id, 0);
2923        match tx_header.ordinal {
2924            _ => Err(fidl::Error::UnknownOrdinal {
2925                ordinal: tx_header.ordinal,
2926                protocol_name: <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2927            }),
2928        }
2929    }
2930}
2931
2932/// A Stream of incoming requests for fuchsia.component/EventStream.
2933pub struct EventStreamRequestStream {
2934    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2935    is_terminated: bool,
2936}
2937
2938impl std::marker::Unpin for EventStreamRequestStream {}
2939
2940impl futures::stream::FusedStream for EventStreamRequestStream {
2941    fn is_terminated(&self) -> bool {
2942        self.is_terminated
2943    }
2944}
2945
2946impl fidl::endpoints::RequestStream for EventStreamRequestStream {
2947    type Protocol = EventStreamMarker;
2948    type ControlHandle = EventStreamControlHandle;
2949
2950    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2951        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2952    }
2953
2954    fn control_handle(&self) -> Self::ControlHandle {
2955        EventStreamControlHandle { inner: self.inner.clone() }
2956    }
2957
2958    fn into_inner(
2959        self,
2960    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2961    {
2962        (self.inner, self.is_terminated)
2963    }
2964
2965    fn from_inner(
2966        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2967        is_terminated: bool,
2968    ) -> Self {
2969        Self { inner, is_terminated }
2970    }
2971}
2972
2973impl futures::Stream for EventStreamRequestStream {
2974    type Item = Result<EventStreamRequest, fidl::Error>;
2975
2976    fn poll_next(
2977        mut self: std::pin::Pin<&mut Self>,
2978        cx: &mut std::task::Context<'_>,
2979    ) -> std::task::Poll<Option<Self::Item>> {
2980        let this = &mut *self;
2981        if this.inner.check_shutdown(cx) {
2982            this.is_terminated = true;
2983            return std::task::Poll::Ready(None);
2984        }
2985        if this.is_terminated {
2986            panic!("polled EventStreamRequestStream after completion");
2987        }
2988        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2989            |bytes, handles| {
2990                match this.inner.channel().read_etc(cx, bytes, handles) {
2991                    std::task::Poll::Ready(Ok(())) => {}
2992                    std::task::Poll::Pending => return std::task::Poll::Pending,
2993                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2994                        this.is_terminated = true;
2995                        return std::task::Poll::Ready(None);
2996                    }
2997                    std::task::Poll::Ready(Err(e)) => {
2998                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2999                            e.into(),
3000                        ))));
3001                    }
3002                }
3003
3004                // A message has been received from the channel
3005                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3006
3007                std::task::Poll::Ready(Some(match header.ordinal {
3008                    0x3f24c9495978eb86 => {
3009                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3010                        let mut req = fidl::new_empty!(
3011                            fidl::encoding::EmptyPayload,
3012                            fidl::encoding::DefaultFuchsiaResourceDialect
3013                        );
3014                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3015                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
3016                        Ok(EventStreamRequest::GetNext {
3017                            responder: EventStreamGetNextResponder {
3018                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3019                                tx_id: header.tx_id,
3020                            },
3021                        })
3022                    }
3023                    0x31331f9578d2e682 => {
3024                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3025                        let mut req = fidl::new_empty!(
3026                            fidl::encoding::EmptyPayload,
3027                            fidl::encoding::DefaultFuchsiaResourceDialect
3028                        );
3029                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3030                        let control_handle = EventStreamControlHandle { inner: this.inner.clone() };
3031                        Ok(EventStreamRequest::WaitForReady {
3032                            responder: EventStreamWaitForReadyResponder {
3033                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3034                                tx_id: header.tx_id,
3035                            },
3036                        })
3037                    }
3038                    _ => Err(fidl::Error::UnknownOrdinal {
3039                        ordinal: header.ordinal,
3040                        protocol_name:
3041                            <EventStreamMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3042                    }),
3043                }))
3044            },
3045        )
3046    }
3047}
3048
3049/// Listener for events on the component hierarchy.
3050/// Can't be used outside of the platform.
3051#[derive(Debug)]
3052pub enum EventStreamRequest {
3053    GetNext {
3054        responder: EventStreamGetNextResponder,
3055    },
3056    /// Returns immediately. Used to indicate that the FIDL connection
3057    /// completed. This is needed for non-static streams to verify
3058    /// that subscribe has completed before components are started.
3059    WaitForReady {
3060        responder: EventStreamWaitForReadyResponder,
3061    },
3062}
3063
3064impl EventStreamRequest {
3065    #[allow(irrefutable_let_patterns)]
3066    pub fn into_get_next(self) -> Option<(EventStreamGetNextResponder)> {
3067        if let EventStreamRequest::GetNext { responder } = self { Some((responder)) } else { None }
3068    }
3069
3070    #[allow(irrefutable_let_patterns)]
3071    pub fn into_wait_for_ready(self) -> Option<(EventStreamWaitForReadyResponder)> {
3072        if let EventStreamRequest::WaitForReady { responder } = self {
3073            Some((responder))
3074        } else {
3075            None
3076        }
3077    }
3078
3079    /// Name of the method defined in FIDL
3080    pub fn method_name(&self) -> &'static str {
3081        match *self {
3082            EventStreamRequest::GetNext { .. } => "get_next",
3083            EventStreamRequest::WaitForReady { .. } => "wait_for_ready",
3084        }
3085    }
3086}
3087
3088#[derive(Debug, Clone)]
3089pub struct EventStreamControlHandle {
3090    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3091}
3092
3093impl EventStreamControlHandle {
3094    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3095        self.inner.shutdown_with_epitaph(status.into())
3096    }
3097}
3098
3099impl fidl::endpoints::ControlHandle for EventStreamControlHandle {
3100    fn shutdown(&self) {
3101        self.inner.shutdown()
3102    }
3103
3104    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3105        self.inner.shutdown_with_epitaph(status)
3106    }
3107
3108    fn is_closed(&self) -> bool {
3109        self.inner.channel().is_closed()
3110    }
3111    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3112        self.inner.channel().on_closed()
3113    }
3114
3115    #[cfg(target_os = "fuchsia")]
3116    fn signal_peer(
3117        &self,
3118        clear_mask: zx::Signals,
3119        set_mask: zx::Signals,
3120    ) -> Result<(), zx_status::Status> {
3121        use fidl::Peered;
3122        self.inner.channel().signal_peer(clear_mask, set_mask)
3123    }
3124}
3125
3126impl EventStreamControlHandle {}
3127
3128#[must_use = "FIDL methods require a response to be sent"]
3129#[derive(Debug)]
3130pub struct EventStreamGetNextResponder {
3131    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
3132    tx_id: u32,
3133}
3134
3135/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
3136/// if the responder is dropped without sending a response, so that the client
3137/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3138impl std::ops::Drop for EventStreamGetNextResponder {
3139    fn drop(&mut self) {
3140        self.control_handle.shutdown();
3141        // Safety: drops once, never accessed again
3142        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3143    }
3144}
3145
3146impl fidl::endpoints::Responder for EventStreamGetNextResponder {
3147    type ControlHandle = EventStreamControlHandle;
3148
3149    fn control_handle(&self) -> &EventStreamControlHandle {
3150        &self.control_handle
3151    }
3152
3153    fn drop_without_shutdown(mut self) {
3154        // Safety: drops once, never accessed again due to mem::forget
3155        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3156        // Prevent Drop from running (which would shut down the channel)
3157        std::mem::forget(self);
3158    }
3159}
3160
3161impl EventStreamGetNextResponder {
3162    /// Sends a response to the FIDL transaction.
3163    ///
3164    /// Sets the channel to shutdown if an error occurs.
3165    pub fn send(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3166        let _result = self.send_raw(events);
3167        if _result.is_err() {
3168            self.control_handle.shutdown();
3169        }
3170        self.drop_without_shutdown();
3171        _result
3172    }
3173
3174    /// Similar to "send" but does not shutdown the channel if an error occurs.
3175    pub fn send_no_shutdown_on_err(self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3176        let _result = self.send_raw(events);
3177        self.drop_without_shutdown();
3178        _result
3179    }
3180
3181    fn send_raw(&self, mut events: Vec<Event>) -> Result<(), fidl::Error> {
3182        self.control_handle.inner.send::<EventStreamGetNextResponse>(
3183            (events.as_mut(),),
3184            self.tx_id,
3185            0x3f24c9495978eb86,
3186            fidl::encoding::DynamicFlags::empty(),
3187        )
3188    }
3189}
3190
3191#[must_use = "FIDL methods require a response to be sent"]
3192#[derive(Debug)]
3193pub struct EventStreamWaitForReadyResponder {
3194    control_handle: std::mem::ManuallyDrop<EventStreamControlHandle>,
3195    tx_id: u32,
3196}
3197
3198/// Set the the channel to be shutdown (see [`EventStreamControlHandle::shutdown`])
3199/// if the responder is dropped without sending a response, so that the client
3200/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3201impl std::ops::Drop for EventStreamWaitForReadyResponder {
3202    fn drop(&mut self) {
3203        self.control_handle.shutdown();
3204        // Safety: drops once, never accessed again
3205        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3206    }
3207}
3208
3209impl fidl::endpoints::Responder for EventStreamWaitForReadyResponder {
3210    type ControlHandle = EventStreamControlHandle;
3211
3212    fn control_handle(&self) -> &EventStreamControlHandle {
3213        &self.control_handle
3214    }
3215
3216    fn drop_without_shutdown(mut self) {
3217        // Safety: drops once, never accessed again due to mem::forget
3218        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3219        // Prevent Drop from running (which would shut down the channel)
3220        std::mem::forget(self);
3221    }
3222}
3223
3224impl EventStreamWaitForReadyResponder {
3225    /// Sends a response to the FIDL transaction.
3226    ///
3227    /// Sets the channel to shutdown if an error occurs.
3228    pub fn send(self) -> Result<(), fidl::Error> {
3229        let _result = self.send_raw();
3230        if _result.is_err() {
3231            self.control_handle.shutdown();
3232        }
3233        self.drop_without_shutdown();
3234        _result
3235    }
3236
3237    /// Similar to "send" but does not shutdown the channel if an error occurs.
3238    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
3239        let _result = self.send_raw();
3240        self.drop_without_shutdown();
3241        _result
3242    }
3243
3244    fn send_raw(&self) -> Result<(), fidl::Error> {
3245        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
3246            (),
3247            self.tx_id,
3248            0x31331f9578d2e682,
3249            fidl::encoding::DynamicFlags::empty(),
3250        )
3251    }
3252}
3253
3254#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3255pub struct ExecutionControllerMarker;
3256
3257impl fidl::endpoints::ProtocolMarker for ExecutionControllerMarker {
3258    type Proxy = ExecutionControllerProxy;
3259    type RequestStream = ExecutionControllerRequestStream;
3260    #[cfg(target_os = "fuchsia")]
3261    type SynchronousProxy = ExecutionControllerSynchronousProxy;
3262
3263    const DEBUG_NAME: &'static str = "(anonymous) ExecutionController";
3264}
3265
3266pub trait ExecutionControllerProxyInterface: Send + Sync {
3267    fn r#stop(&self) -> Result<(), fidl::Error>;
3268}
3269#[derive(Debug)]
3270#[cfg(target_os = "fuchsia")]
3271pub struct ExecutionControllerSynchronousProxy {
3272    client: fidl::client::sync::Client,
3273}
3274
3275#[cfg(target_os = "fuchsia")]
3276impl fidl::endpoints::SynchronousProxy for ExecutionControllerSynchronousProxy {
3277    type Proxy = ExecutionControllerProxy;
3278    type Protocol = ExecutionControllerMarker;
3279
3280    fn from_channel(inner: fidl::Channel) -> Self {
3281        Self::new(inner)
3282    }
3283
3284    fn into_channel(self) -> fidl::Channel {
3285        self.client.into_channel()
3286    }
3287
3288    fn as_channel(&self) -> &fidl::Channel {
3289        self.client.as_channel()
3290    }
3291}
3292
3293#[cfg(target_os = "fuchsia")]
3294impl ExecutionControllerSynchronousProxy {
3295    pub fn new(channel: fidl::Channel) -> Self {
3296        Self { client: fidl::client::sync::Client::new(channel) }
3297    }
3298
3299    pub fn into_channel(self) -> fidl::Channel {
3300        self.client.into_channel()
3301    }
3302
3303    /// Waits until an event arrives and returns it. It is safe for other
3304    /// threads to make concurrent requests while waiting for an event.
3305    pub fn wait_for_event(
3306        &self,
3307        deadline: zx::MonotonicInstant,
3308    ) -> Result<ExecutionControllerEvent, fidl::Error> {
3309        ExecutionControllerEvent::decode(
3310            self.client.wait_for_event::<ExecutionControllerMarker>(deadline)?,
3311        )
3312    }
3313
3314    /// Initiates a stop action on this component. Once complete, OnStop will be
3315    /// called with the stopped payload and this channel is closed.
3316    ///
3317    /// Note that a component may stop running on its own at any time, so it is
3318    /// possible for `OnStop` to be received before `Stop` is called.
3319    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3320        self.client.send::<fidl::encoding::EmptyPayload>(
3321            (),
3322            0x56d23cec21036117,
3323            fidl::encoding::DynamicFlags::FLEXIBLE,
3324        )
3325    }
3326}
3327
3328#[cfg(target_os = "fuchsia")]
3329impl From<ExecutionControllerSynchronousProxy> for zx::NullableHandle {
3330    fn from(value: ExecutionControllerSynchronousProxy) -> Self {
3331        value.into_channel().into()
3332    }
3333}
3334
3335#[cfg(target_os = "fuchsia")]
3336impl From<fidl::Channel> for ExecutionControllerSynchronousProxy {
3337    fn from(value: fidl::Channel) -> Self {
3338        Self::new(value)
3339    }
3340}
3341
3342#[cfg(target_os = "fuchsia")]
3343impl fidl::endpoints::FromClient for ExecutionControllerSynchronousProxy {
3344    type Protocol = ExecutionControllerMarker;
3345
3346    fn from_client(value: fidl::endpoints::ClientEnd<ExecutionControllerMarker>) -> Self {
3347        Self::new(value.into_channel())
3348    }
3349}
3350
3351#[derive(Debug, Clone)]
3352pub struct ExecutionControllerProxy {
3353    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3354}
3355
3356impl fidl::endpoints::Proxy for ExecutionControllerProxy {
3357    type Protocol = ExecutionControllerMarker;
3358
3359    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3360        Self::new(inner)
3361    }
3362
3363    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3364        self.client.into_channel().map_err(|client| Self { client })
3365    }
3366
3367    fn as_channel(&self) -> &::fidl::AsyncChannel {
3368        self.client.as_channel()
3369    }
3370}
3371
3372impl ExecutionControllerProxy {
3373    /// Create a new Proxy for fuchsia.component/ExecutionController.
3374    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3375        let protocol_name =
3376            <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3377        Self { client: fidl::client::Client::new(channel, protocol_name) }
3378    }
3379
3380    /// Get a Stream of events from the remote end of the protocol.
3381    ///
3382    /// # Panics
3383    ///
3384    /// Panics if the event stream was already taken.
3385    pub fn take_event_stream(&self) -> ExecutionControllerEventStream {
3386        ExecutionControllerEventStream { event_receiver: self.client.take_event_receiver() }
3387    }
3388
3389    /// Initiates a stop action on this component. Once complete, OnStop will be
3390    /// called with the stopped payload and this channel is closed.
3391    ///
3392    /// Note that a component may stop running on its own at any time, so it is
3393    /// possible for `OnStop` to be received before `Stop` is called.
3394    pub fn r#stop(&self) -> Result<(), fidl::Error> {
3395        ExecutionControllerProxyInterface::r#stop(self)
3396    }
3397}
3398
3399impl ExecutionControllerProxyInterface for ExecutionControllerProxy {
3400    fn r#stop(&self) -> Result<(), fidl::Error> {
3401        self.client.send::<fidl::encoding::EmptyPayload>(
3402            (),
3403            0x56d23cec21036117,
3404            fidl::encoding::DynamicFlags::FLEXIBLE,
3405        )
3406    }
3407}
3408
3409pub struct ExecutionControllerEventStream {
3410    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3411}
3412
3413impl std::marker::Unpin for ExecutionControllerEventStream {}
3414
3415impl futures::stream::FusedStream for ExecutionControllerEventStream {
3416    fn is_terminated(&self) -> bool {
3417        self.event_receiver.is_terminated()
3418    }
3419}
3420
3421impl futures::Stream for ExecutionControllerEventStream {
3422    type Item = Result<ExecutionControllerEvent, fidl::Error>;
3423
3424    fn poll_next(
3425        mut self: std::pin::Pin<&mut Self>,
3426        cx: &mut std::task::Context<'_>,
3427    ) -> std::task::Poll<Option<Self::Item>> {
3428        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3429            &mut self.event_receiver,
3430            cx
3431        )?) {
3432            Some(buf) => std::task::Poll::Ready(Some(ExecutionControllerEvent::decode(buf))),
3433            None => std::task::Poll::Ready(None),
3434        }
3435    }
3436}
3437
3438#[derive(Debug)]
3439pub enum ExecutionControllerEvent {
3440    OnStop {
3441        stopped_payload: StoppedPayload,
3442    },
3443    #[non_exhaustive]
3444    _UnknownEvent {
3445        /// Ordinal of the event that was sent.
3446        ordinal: u64,
3447    },
3448}
3449
3450impl ExecutionControllerEvent {
3451    #[allow(irrefutable_let_patterns)]
3452    pub fn into_on_stop(self) -> Option<StoppedPayload> {
3453        if let ExecutionControllerEvent::OnStop { stopped_payload } = self {
3454            Some((stopped_payload))
3455        } else {
3456            None
3457        }
3458    }
3459
3460    /// Decodes a message buffer as a [`ExecutionControllerEvent`].
3461    fn decode(
3462        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3463    ) -> Result<ExecutionControllerEvent, fidl::Error> {
3464        let (bytes, _handles) = buf.split_mut();
3465        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3466        debug_assert_eq!(tx_header.tx_id, 0);
3467        match tx_header.ordinal {
3468            0x62d5018e2174f57f => {
3469                let mut out = fidl::new_empty!(
3470                    ExecutionControllerOnStopRequest,
3471                    fidl::encoding::DefaultFuchsiaResourceDialect
3472                );
3473                fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ExecutionControllerOnStopRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
3474                Ok((ExecutionControllerEvent::OnStop { stopped_payload: out.stopped_payload }))
3475            }
3476            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3477                Ok(ExecutionControllerEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3478            }
3479            _ => Err(fidl::Error::UnknownOrdinal {
3480                ordinal: tx_header.ordinal,
3481                protocol_name:
3482                    <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3483            }),
3484        }
3485    }
3486}
3487
3488/// A Stream of incoming requests for fuchsia.component/ExecutionController.
3489pub struct ExecutionControllerRequestStream {
3490    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3491    is_terminated: bool,
3492}
3493
3494impl std::marker::Unpin for ExecutionControllerRequestStream {}
3495
3496impl futures::stream::FusedStream for ExecutionControllerRequestStream {
3497    fn is_terminated(&self) -> bool {
3498        self.is_terminated
3499    }
3500}
3501
3502impl fidl::endpoints::RequestStream for ExecutionControllerRequestStream {
3503    type Protocol = ExecutionControllerMarker;
3504    type ControlHandle = ExecutionControllerControlHandle;
3505
3506    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3507        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3508    }
3509
3510    fn control_handle(&self) -> Self::ControlHandle {
3511        ExecutionControllerControlHandle { inner: self.inner.clone() }
3512    }
3513
3514    fn into_inner(
3515        self,
3516    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3517    {
3518        (self.inner, self.is_terminated)
3519    }
3520
3521    fn from_inner(
3522        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3523        is_terminated: bool,
3524    ) -> Self {
3525        Self { inner, is_terminated }
3526    }
3527}
3528
3529impl futures::Stream for ExecutionControllerRequestStream {
3530    type Item = Result<ExecutionControllerRequest, fidl::Error>;
3531
3532    fn poll_next(
3533        mut self: std::pin::Pin<&mut Self>,
3534        cx: &mut std::task::Context<'_>,
3535    ) -> std::task::Poll<Option<Self::Item>> {
3536        let this = &mut *self;
3537        if this.inner.check_shutdown(cx) {
3538            this.is_terminated = true;
3539            return std::task::Poll::Ready(None);
3540        }
3541        if this.is_terminated {
3542            panic!("polled ExecutionControllerRequestStream after completion");
3543        }
3544        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3545            |bytes, handles| {
3546                match this.inner.channel().read_etc(cx, bytes, handles) {
3547                    std::task::Poll::Ready(Ok(())) => {}
3548                    std::task::Poll::Pending => return std::task::Poll::Pending,
3549                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3550                        this.is_terminated = true;
3551                        return std::task::Poll::Ready(None);
3552                    }
3553                    std::task::Poll::Ready(Err(e)) => {
3554                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3555                            e.into(),
3556                        ))));
3557                    }
3558                }
3559
3560                // A message has been received from the channel
3561                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3562
3563                std::task::Poll::Ready(Some(match header.ordinal {
3564                0x56d23cec21036117 => {
3565                    header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3566                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
3567                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3568                    let control_handle = ExecutionControllerControlHandle {
3569                        inner: this.inner.clone(),
3570                    };
3571                    Ok(ExecutionControllerRequest::Stop {
3572                        control_handle,
3573                    })
3574                }
3575                _ if header.tx_id == 0 && header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3576                    Ok(ExecutionControllerRequest::_UnknownMethod {
3577                        ordinal: header.ordinal,
3578                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
3579                        method_type: fidl::MethodType::OneWay,
3580                    })
3581                }
3582                _ if header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3583                    this.inner.send_framework_err(
3584                        fidl::encoding::FrameworkErr::UnknownMethod,
3585                        header.tx_id,
3586                        header.ordinal,
3587                        header.dynamic_flags(),
3588                        (bytes, handles),
3589                    )?;
3590                    Ok(ExecutionControllerRequest::_UnknownMethod {
3591                        ordinal: header.ordinal,
3592                        control_handle: ExecutionControllerControlHandle { inner: this.inner.clone() },
3593                        method_type: fidl::MethodType::TwoWay,
3594                    })
3595                }
3596                _ => Err(fidl::Error::UnknownOrdinal {
3597                    ordinal: header.ordinal,
3598                    protocol_name: <ExecutionControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3599                }),
3600            }))
3601            },
3602        )
3603    }
3604}
3605
3606#[derive(Debug)]
3607pub enum ExecutionControllerRequest {
3608    /// Initiates a stop action on this component. Once complete, OnStop will be
3609    /// called with the stopped payload and this channel is closed.
3610    ///
3611    /// Note that a component may stop running on its own at any time, so it is
3612    /// possible for `OnStop` to be received before `Stop` is called.
3613    Stop { control_handle: ExecutionControllerControlHandle },
3614    /// An interaction was received which does not match any known method.
3615    #[non_exhaustive]
3616    _UnknownMethod {
3617        /// Ordinal of the method that was called.
3618        ordinal: u64,
3619        control_handle: ExecutionControllerControlHandle,
3620        method_type: fidl::MethodType,
3621    },
3622}
3623
3624impl ExecutionControllerRequest {
3625    #[allow(irrefutable_let_patterns)]
3626    pub fn into_stop(self) -> Option<(ExecutionControllerControlHandle)> {
3627        if let ExecutionControllerRequest::Stop { control_handle } = self {
3628            Some((control_handle))
3629        } else {
3630            None
3631        }
3632    }
3633
3634    /// Name of the method defined in FIDL
3635    pub fn method_name(&self) -> &'static str {
3636        match *self {
3637            ExecutionControllerRequest::Stop { .. } => "stop",
3638            ExecutionControllerRequest::_UnknownMethod {
3639                method_type: fidl::MethodType::OneWay,
3640                ..
3641            } => "unknown one-way method",
3642            ExecutionControllerRequest::_UnknownMethod {
3643                method_type: fidl::MethodType::TwoWay,
3644                ..
3645            } => "unknown two-way method",
3646        }
3647    }
3648}
3649
3650#[derive(Debug, Clone)]
3651pub struct ExecutionControllerControlHandle {
3652    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3653}
3654
3655impl ExecutionControllerControlHandle {
3656    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
3657        self.inner.shutdown_with_epitaph(status.into())
3658    }
3659}
3660
3661impl fidl::endpoints::ControlHandle for ExecutionControllerControlHandle {
3662    fn shutdown(&self) {
3663        self.inner.shutdown()
3664    }
3665
3666    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
3667        self.inner.shutdown_with_epitaph(status)
3668    }
3669
3670    fn is_closed(&self) -> bool {
3671        self.inner.channel().is_closed()
3672    }
3673    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3674        self.inner.channel().on_closed()
3675    }
3676
3677    #[cfg(target_os = "fuchsia")]
3678    fn signal_peer(
3679        &self,
3680        clear_mask: zx::Signals,
3681        set_mask: zx::Signals,
3682    ) -> Result<(), zx_status::Status> {
3683        use fidl::Peered;
3684        self.inner.channel().signal_peer(clear_mask, set_mask)
3685    }
3686}
3687
3688impl ExecutionControllerControlHandle {
3689    pub fn send_on_stop(&self, mut stopped_payload: &StoppedPayload) -> Result<(), fidl::Error> {
3690        self.inner.send::<ExecutionControllerOnStopRequest>(
3691            (stopped_payload,),
3692            0,
3693            0x62d5018e2174f57f,
3694            fidl::encoding::DynamicFlags::FLEXIBLE,
3695        )
3696    }
3697}
3698
3699#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3700pub struct IntrospectorMarker;
3701
3702impl fidl::endpoints::ProtocolMarker for IntrospectorMarker {
3703    type Proxy = IntrospectorProxy;
3704    type RequestStream = IntrospectorRequestStream;
3705    #[cfg(target_os = "fuchsia")]
3706    type SynchronousProxy = IntrospectorSynchronousProxy;
3707
3708    const DEBUG_NAME: &'static str = "fuchsia.component.Introspector";
3709}
3710impl fidl::endpoints::DiscoverableProtocolMarker for IntrospectorMarker {}
3711pub type IntrospectorGetMonikerResult = Result<String, Error>;
3712
3713pub trait IntrospectorProxyInterface: Send + Sync {
3714    type GetMonikerResponseFut: std::future::Future<Output = Result<IntrospectorGetMonikerResult, fidl::Error>>
3715        + Send;
3716    fn r#get_moniker(&self, component_instance: fidl::Event) -> Self::GetMonikerResponseFut;
3717}
3718#[derive(Debug)]
3719#[cfg(target_os = "fuchsia")]
3720pub struct IntrospectorSynchronousProxy {
3721    client: fidl::client::sync::Client,
3722}
3723
3724#[cfg(target_os = "fuchsia")]
3725impl fidl::endpoints::SynchronousProxy for IntrospectorSynchronousProxy {
3726    type Proxy = IntrospectorProxy;
3727    type Protocol = IntrospectorMarker;
3728
3729    fn from_channel(inner: fidl::Channel) -> Self {
3730        Self::new(inner)
3731    }
3732
3733    fn into_channel(self) -> fidl::Channel {
3734        self.client.into_channel()
3735    }
3736
3737    fn as_channel(&self) -> &fidl::Channel {
3738        self.client.as_channel()
3739    }
3740}
3741
3742#[cfg(target_os = "fuchsia")]
3743impl IntrospectorSynchronousProxy {
3744    pub fn new(channel: fidl::Channel) -> Self {
3745        Self { client: fidl::client::sync::Client::new(channel) }
3746    }
3747
3748    pub fn into_channel(self) -> fidl::Channel {
3749        self.client.into_channel()
3750    }
3751
3752    /// Waits until an event arrives and returns it. It is safe for other
3753    /// threads to make concurrent requests while waiting for an event.
3754    pub fn wait_for_event(
3755        &self,
3756        deadline: zx::MonotonicInstant,
3757    ) -> Result<IntrospectorEvent, fidl::Error> {
3758        IntrospectorEvent::decode(self.client.wait_for_event::<IntrospectorMarker>(deadline)?)
3759    }
3760
3761    /// Obtains the moniker relative to this realm of the component
3762    /// corresponding to the provided token. Runners may obtain the token via
3763    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
3764    ///
3765    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
3766    /// does not correspond to a component under this realm.
3767    pub fn r#get_moniker(
3768        &self,
3769        mut component_instance: fidl::Event,
3770        ___deadline: zx::MonotonicInstant,
3771    ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
3772        let _response = self.client.send_query::<
3773            IntrospectorGetMonikerRequest,
3774            fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
3775            IntrospectorMarker,
3776        >(
3777            (component_instance,),
3778            0x2f980ceb37bf458,
3779            fidl::encoding::DynamicFlags::FLEXIBLE,
3780            ___deadline,
3781        )?
3782        .into_result::<IntrospectorMarker>("get_moniker")?;
3783        Ok(_response.map(|x| x.moniker))
3784    }
3785}
3786
3787#[cfg(target_os = "fuchsia")]
3788impl From<IntrospectorSynchronousProxy> for zx::NullableHandle {
3789    fn from(value: IntrospectorSynchronousProxy) -> Self {
3790        value.into_channel().into()
3791    }
3792}
3793
3794#[cfg(target_os = "fuchsia")]
3795impl From<fidl::Channel> for IntrospectorSynchronousProxy {
3796    fn from(value: fidl::Channel) -> Self {
3797        Self::new(value)
3798    }
3799}
3800
3801#[cfg(target_os = "fuchsia")]
3802impl fidl::endpoints::FromClient for IntrospectorSynchronousProxy {
3803    type Protocol = IntrospectorMarker;
3804
3805    fn from_client(value: fidl::endpoints::ClientEnd<IntrospectorMarker>) -> Self {
3806        Self::new(value.into_channel())
3807    }
3808}
3809
3810#[derive(Debug, Clone)]
3811pub struct IntrospectorProxy {
3812    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3813}
3814
3815impl fidl::endpoints::Proxy for IntrospectorProxy {
3816    type Protocol = IntrospectorMarker;
3817
3818    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3819        Self::new(inner)
3820    }
3821
3822    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3823        self.client.into_channel().map_err(|client| Self { client })
3824    }
3825
3826    fn as_channel(&self) -> &::fidl::AsyncChannel {
3827        self.client.as_channel()
3828    }
3829}
3830
3831impl IntrospectorProxy {
3832    /// Create a new Proxy for fuchsia.component/Introspector.
3833    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3834        let protocol_name = <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3835        Self { client: fidl::client::Client::new(channel, protocol_name) }
3836    }
3837
3838    /// Get a Stream of events from the remote end of the protocol.
3839    ///
3840    /// # Panics
3841    ///
3842    /// Panics if the event stream was already taken.
3843    pub fn take_event_stream(&self) -> IntrospectorEventStream {
3844        IntrospectorEventStream { event_receiver: self.client.take_event_receiver() }
3845    }
3846
3847    /// Obtains the moniker relative to this realm of the component
3848    /// corresponding to the provided token. Runners may obtain the token via
3849    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
3850    ///
3851    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
3852    /// does not correspond to a component under this realm.
3853    pub fn r#get_moniker(
3854        &self,
3855        mut component_instance: fidl::Event,
3856    ) -> fidl::client::QueryResponseFut<
3857        IntrospectorGetMonikerResult,
3858        fidl::encoding::DefaultFuchsiaResourceDialect,
3859    > {
3860        IntrospectorProxyInterface::r#get_moniker(self, component_instance)
3861    }
3862}
3863
3864impl IntrospectorProxyInterface for IntrospectorProxy {
3865    type GetMonikerResponseFut = fidl::client::QueryResponseFut<
3866        IntrospectorGetMonikerResult,
3867        fidl::encoding::DefaultFuchsiaResourceDialect,
3868    >;
3869    fn r#get_moniker(&self, mut component_instance: fidl::Event) -> Self::GetMonikerResponseFut {
3870        fn _decode(
3871            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3872        ) -> Result<IntrospectorGetMonikerResult, fidl::Error> {
3873            let _response = fidl::client::decode_transaction_body::<
3874                fidl::encoding::FlexibleResultType<IntrospectorGetMonikerResponse, Error>,
3875                fidl::encoding::DefaultFuchsiaResourceDialect,
3876                0x2f980ceb37bf458,
3877            >(_buf?)?
3878            .into_result::<IntrospectorMarker>("get_moniker")?;
3879            Ok(_response.map(|x| x.moniker))
3880        }
3881        self.client
3882            .send_query_and_decode::<IntrospectorGetMonikerRequest, IntrospectorGetMonikerResult>(
3883                (component_instance,),
3884                0x2f980ceb37bf458,
3885                fidl::encoding::DynamicFlags::FLEXIBLE,
3886                _decode,
3887            )
3888    }
3889}
3890
3891pub struct IntrospectorEventStream {
3892    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3893}
3894
3895impl std::marker::Unpin for IntrospectorEventStream {}
3896
3897impl futures::stream::FusedStream for IntrospectorEventStream {
3898    fn is_terminated(&self) -> bool {
3899        self.event_receiver.is_terminated()
3900    }
3901}
3902
3903impl futures::Stream for IntrospectorEventStream {
3904    type Item = Result<IntrospectorEvent, fidl::Error>;
3905
3906    fn poll_next(
3907        mut self: std::pin::Pin<&mut Self>,
3908        cx: &mut std::task::Context<'_>,
3909    ) -> std::task::Poll<Option<Self::Item>> {
3910        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3911            &mut self.event_receiver,
3912            cx
3913        )?) {
3914            Some(buf) => std::task::Poll::Ready(Some(IntrospectorEvent::decode(buf))),
3915            None => std::task::Poll::Ready(None),
3916        }
3917    }
3918}
3919
3920#[derive(Debug)]
3921pub enum IntrospectorEvent {
3922    #[non_exhaustive]
3923    _UnknownEvent {
3924        /// Ordinal of the event that was sent.
3925        ordinal: u64,
3926    },
3927}
3928
3929impl IntrospectorEvent {
3930    /// Decodes a message buffer as a [`IntrospectorEvent`].
3931    fn decode(
3932        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3933    ) -> Result<IntrospectorEvent, fidl::Error> {
3934        let (bytes, _handles) = buf.split_mut();
3935        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3936        debug_assert_eq!(tx_header.tx_id, 0);
3937        match tx_header.ordinal {
3938            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
3939                Ok(IntrospectorEvent::_UnknownEvent { ordinal: tx_header.ordinal })
3940            }
3941            _ => Err(fidl::Error::UnknownOrdinal {
3942                ordinal: tx_header.ordinal,
3943                protocol_name: <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3944            }),
3945        }
3946    }
3947}
3948
3949/// A Stream of incoming requests for fuchsia.component/Introspector.
3950pub struct IntrospectorRequestStream {
3951    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3952    is_terminated: bool,
3953}
3954
3955impl std::marker::Unpin for IntrospectorRequestStream {}
3956
3957impl futures::stream::FusedStream for IntrospectorRequestStream {
3958    fn is_terminated(&self) -> bool {
3959        self.is_terminated
3960    }
3961}
3962
3963impl fidl::endpoints::RequestStream for IntrospectorRequestStream {
3964    type Protocol = IntrospectorMarker;
3965    type ControlHandle = IntrospectorControlHandle;
3966
3967    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3968        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3969    }
3970
3971    fn control_handle(&self) -> Self::ControlHandle {
3972        IntrospectorControlHandle { inner: self.inner.clone() }
3973    }
3974
3975    fn into_inner(
3976        self,
3977    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3978    {
3979        (self.inner, self.is_terminated)
3980    }
3981
3982    fn from_inner(
3983        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3984        is_terminated: bool,
3985    ) -> Self {
3986        Self { inner, is_terminated }
3987    }
3988}
3989
3990impl futures::Stream for IntrospectorRequestStream {
3991    type Item = Result<IntrospectorRequest, fidl::Error>;
3992
3993    fn poll_next(
3994        mut self: std::pin::Pin<&mut Self>,
3995        cx: &mut std::task::Context<'_>,
3996    ) -> std::task::Poll<Option<Self::Item>> {
3997        let this = &mut *self;
3998        if this.inner.check_shutdown(cx) {
3999            this.is_terminated = true;
4000            return std::task::Poll::Ready(None);
4001        }
4002        if this.is_terminated {
4003            panic!("polled IntrospectorRequestStream after completion");
4004        }
4005        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4006            |bytes, handles| {
4007                match this.inner.channel().read_etc(cx, bytes, handles) {
4008                    std::task::Poll::Ready(Ok(())) => {}
4009                    std::task::Poll::Pending => return std::task::Poll::Pending,
4010                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4011                        this.is_terminated = true;
4012                        return std::task::Poll::Ready(None);
4013                    }
4014                    std::task::Poll::Ready(Err(e)) => {
4015                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4016                            e.into(),
4017                        ))));
4018                    }
4019                }
4020
4021                // A message has been received from the channel
4022                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4023
4024                std::task::Poll::Ready(Some(match header.ordinal {
4025                    0x2f980ceb37bf458 => {
4026                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4027                        let mut req = fidl::new_empty!(
4028                            IntrospectorGetMonikerRequest,
4029                            fidl::encoding::DefaultFuchsiaResourceDialect
4030                        );
4031                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<IntrospectorGetMonikerRequest>(&header, _body_bytes, handles, &mut req)?;
4032                        let control_handle =
4033                            IntrospectorControlHandle { inner: this.inner.clone() };
4034                        Ok(IntrospectorRequest::GetMoniker {
4035                            component_instance: req.component_instance,
4036
4037                            responder: IntrospectorGetMonikerResponder {
4038                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4039                                tx_id: header.tx_id,
4040                            },
4041                        })
4042                    }
4043                    _ if header.tx_id == 0
4044                        && header
4045                            .dynamic_flags()
4046                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4047                    {
4048                        Ok(IntrospectorRequest::_UnknownMethod {
4049                            ordinal: header.ordinal,
4050                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
4051                            method_type: fidl::MethodType::OneWay,
4052                        })
4053                    }
4054                    _ if header
4055                        .dynamic_flags()
4056                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4057                    {
4058                        this.inner.send_framework_err(
4059                            fidl::encoding::FrameworkErr::UnknownMethod,
4060                            header.tx_id,
4061                            header.ordinal,
4062                            header.dynamic_flags(),
4063                            (bytes, handles),
4064                        )?;
4065                        Ok(IntrospectorRequest::_UnknownMethod {
4066                            ordinal: header.ordinal,
4067                            control_handle: IntrospectorControlHandle { inner: this.inner.clone() },
4068                            method_type: fidl::MethodType::TwoWay,
4069                        })
4070                    }
4071                    _ => Err(fidl::Error::UnknownOrdinal {
4072                        ordinal: header.ordinal,
4073                        protocol_name:
4074                            <IntrospectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4075                    }),
4076                }))
4077            },
4078        )
4079    }
4080}
4081
4082/// A protocol used by a component instance to obtain information about
4083/// components in its own realm.
4084///
4085/// This protocol only supports getting the moniker at the moment but could
4086/// expand to other privileged information such as the URL of a component.
4087///
4088/// The component framework provides this capability to components that use
4089/// `fuchsia.component.Introspector` from framework.
4090#[derive(Debug)]
4091pub enum IntrospectorRequest {
4092    /// Obtains the moniker relative to this realm of the component
4093    /// corresponding to the provided token. Runners may obtain the token via
4094    /// `fuchsia.component.runner/ComponentStartInfo.component_instance`.
4095    ///
4096    /// Returns `Error.INSTANCE_NOT_FOUND` if the token is invalid, or
4097    /// does not correspond to a component under this realm.
4098    GetMoniker { component_instance: fidl::Event, responder: IntrospectorGetMonikerResponder },
4099    /// An interaction was received which does not match any known method.
4100    #[non_exhaustive]
4101    _UnknownMethod {
4102        /// Ordinal of the method that was called.
4103        ordinal: u64,
4104        control_handle: IntrospectorControlHandle,
4105        method_type: fidl::MethodType,
4106    },
4107}
4108
4109impl IntrospectorRequest {
4110    #[allow(irrefutable_let_patterns)]
4111    pub fn into_get_moniker(self) -> Option<(fidl::Event, IntrospectorGetMonikerResponder)> {
4112        if let IntrospectorRequest::GetMoniker { component_instance, responder } = self {
4113            Some((component_instance, responder))
4114        } else {
4115            None
4116        }
4117    }
4118
4119    /// Name of the method defined in FIDL
4120    pub fn method_name(&self) -> &'static str {
4121        match *self {
4122            IntrospectorRequest::GetMoniker { .. } => "get_moniker",
4123            IntrospectorRequest::_UnknownMethod {
4124                method_type: fidl::MethodType::OneWay, ..
4125            } => "unknown one-way method",
4126            IntrospectorRequest::_UnknownMethod {
4127                method_type: fidl::MethodType::TwoWay, ..
4128            } => "unknown two-way method",
4129        }
4130    }
4131}
4132
4133#[derive(Debug, Clone)]
4134pub struct IntrospectorControlHandle {
4135    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4136}
4137
4138impl IntrospectorControlHandle {
4139    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4140        self.inner.shutdown_with_epitaph(status.into())
4141    }
4142}
4143
4144impl fidl::endpoints::ControlHandle for IntrospectorControlHandle {
4145    fn shutdown(&self) {
4146        self.inner.shutdown()
4147    }
4148
4149    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4150        self.inner.shutdown_with_epitaph(status)
4151    }
4152
4153    fn is_closed(&self) -> bool {
4154        self.inner.channel().is_closed()
4155    }
4156    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4157        self.inner.channel().on_closed()
4158    }
4159
4160    #[cfg(target_os = "fuchsia")]
4161    fn signal_peer(
4162        &self,
4163        clear_mask: zx::Signals,
4164        set_mask: zx::Signals,
4165    ) -> Result<(), zx_status::Status> {
4166        use fidl::Peered;
4167        self.inner.channel().signal_peer(clear_mask, set_mask)
4168    }
4169}
4170
4171impl IntrospectorControlHandle {}
4172
4173#[must_use = "FIDL methods require a response to be sent"]
4174#[derive(Debug)]
4175pub struct IntrospectorGetMonikerResponder {
4176    control_handle: std::mem::ManuallyDrop<IntrospectorControlHandle>,
4177    tx_id: u32,
4178}
4179
4180/// Set the the channel to be shutdown (see [`IntrospectorControlHandle::shutdown`])
4181/// if the responder is dropped without sending a response, so that the client
4182/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4183impl std::ops::Drop for IntrospectorGetMonikerResponder {
4184    fn drop(&mut self) {
4185        self.control_handle.shutdown();
4186        // Safety: drops once, never accessed again
4187        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4188    }
4189}
4190
4191impl fidl::endpoints::Responder for IntrospectorGetMonikerResponder {
4192    type ControlHandle = IntrospectorControlHandle;
4193
4194    fn control_handle(&self) -> &IntrospectorControlHandle {
4195        &self.control_handle
4196    }
4197
4198    fn drop_without_shutdown(mut self) {
4199        // Safety: drops once, never accessed again due to mem::forget
4200        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4201        // Prevent Drop from running (which would shut down the channel)
4202        std::mem::forget(self);
4203    }
4204}
4205
4206impl IntrospectorGetMonikerResponder {
4207    /// Sends a response to the FIDL transaction.
4208    ///
4209    /// Sets the channel to shutdown if an error occurs.
4210    pub fn send(self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
4211        let _result = self.send_raw(result);
4212        if _result.is_err() {
4213            self.control_handle.shutdown();
4214        }
4215        self.drop_without_shutdown();
4216        _result
4217    }
4218
4219    /// Similar to "send" but does not shutdown the channel if an error occurs.
4220    pub fn send_no_shutdown_on_err(
4221        self,
4222        mut result: Result<&str, Error>,
4223    ) -> Result<(), fidl::Error> {
4224        let _result = self.send_raw(result);
4225        self.drop_without_shutdown();
4226        _result
4227    }
4228
4229    fn send_raw(&self, mut result: Result<&str, Error>) -> Result<(), fidl::Error> {
4230        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4231            IntrospectorGetMonikerResponse,
4232            Error,
4233        >>(
4234            fidl::encoding::FlexibleResult::new(result.map(|moniker| (moniker,))),
4235            self.tx_id,
4236            0x2f980ceb37bf458,
4237            fidl::encoding::DynamicFlags::FLEXIBLE,
4238        )
4239    }
4240}
4241
4242#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4243pub struct NamespaceMarker;
4244
4245impl fidl::endpoints::ProtocolMarker for NamespaceMarker {
4246    type Proxy = NamespaceProxy;
4247    type RequestStream = NamespaceRequestStream;
4248    #[cfg(target_os = "fuchsia")]
4249    type SynchronousProxy = NamespaceSynchronousProxy;
4250
4251    const DEBUG_NAME: &'static str = "fuchsia.component.Namespace";
4252}
4253impl fidl::endpoints::DiscoverableProtocolMarker for NamespaceMarker {}
4254pub type NamespaceCreateResult = Result<Vec<NamespaceEntry>, NamespaceError>;
4255pub type NamespaceCreate2Result = Result<Vec<NamespaceEntry>, NamespaceError>;
4256
4257pub trait NamespaceProxyInterface: Send + Sync {
4258    type CreateResponseFut: std::future::Future<Output = Result<NamespaceCreateResult, fidl::Error>>
4259        + Send;
4260    fn r#create(&self, entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut;
4261    type Create2ResponseFut: std::future::Future<Output = Result<NamespaceCreate2Result, fidl::Error>>
4262        + Send;
4263    fn r#create2(&self, entries: Vec<NamespaceInputEntry2>) -> Self::Create2ResponseFut;
4264}
4265#[derive(Debug)]
4266#[cfg(target_os = "fuchsia")]
4267pub struct NamespaceSynchronousProxy {
4268    client: fidl::client::sync::Client,
4269}
4270
4271#[cfg(target_os = "fuchsia")]
4272impl fidl::endpoints::SynchronousProxy for NamespaceSynchronousProxy {
4273    type Proxy = NamespaceProxy;
4274    type Protocol = NamespaceMarker;
4275
4276    fn from_channel(inner: fidl::Channel) -> Self {
4277        Self::new(inner)
4278    }
4279
4280    fn into_channel(self) -> fidl::Channel {
4281        self.client.into_channel()
4282    }
4283
4284    fn as_channel(&self) -> &fidl::Channel {
4285        self.client.as_channel()
4286    }
4287}
4288
4289#[cfg(target_os = "fuchsia")]
4290impl NamespaceSynchronousProxy {
4291    pub fn new(channel: fidl::Channel) -> Self {
4292        Self { client: fidl::client::sync::Client::new(channel) }
4293    }
4294
4295    pub fn into_channel(self) -> fidl::Channel {
4296        self.client.into_channel()
4297    }
4298
4299    /// Waits until an event arrives and returns it. It is safe for other
4300    /// threads to make concurrent requests while waiting for an event.
4301    pub fn wait_for_event(
4302        &self,
4303        deadline: zx::MonotonicInstant,
4304    ) -> Result<NamespaceEvent, fidl::Error> {
4305        NamespaceEvent::decode(self.client.wait_for_event::<NamespaceMarker>(deadline)?)
4306    }
4307
4308    pub fn r#create(
4309        &self,
4310        mut entries: Vec<NamespaceInputEntry>,
4311        ___deadline: zx::MonotonicInstant,
4312    ) -> Result<NamespaceCreateResult, fidl::Error> {
4313        let _response = self.client.send_query::<
4314            NamespaceCreateRequest,
4315            fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
4316            NamespaceMarker,
4317        >(
4318            (entries.as_mut(),),
4319            0x4329fe12b2a790f9,
4320            fidl::encoding::DynamicFlags::FLEXIBLE,
4321            ___deadline,
4322        )?
4323        .into_result::<NamespaceMarker>("create")?;
4324        Ok(_response.map(|x| x.entries))
4325    }
4326
4327    pub fn r#create2(
4328        &self,
4329        mut entries: Vec<NamespaceInputEntry2>,
4330        ___deadline: zx::MonotonicInstant,
4331    ) -> Result<NamespaceCreate2Result, fidl::Error> {
4332        let _response = self.client.send_query::<
4333            NamespaceCreate2Request,
4334            fidl::encoding::FlexibleResultType<NamespaceCreate2Response, NamespaceError>,
4335            NamespaceMarker,
4336        >(
4337            (entries.as_mut(),),
4338            0x665aa4bb3773b351,
4339            fidl::encoding::DynamicFlags::FLEXIBLE,
4340            ___deadline,
4341        )?
4342        .into_result::<NamespaceMarker>("create2")?;
4343        Ok(_response.map(|x| x.entries))
4344    }
4345}
4346
4347#[cfg(target_os = "fuchsia")]
4348impl From<NamespaceSynchronousProxy> for zx::NullableHandle {
4349    fn from(value: NamespaceSynchronousProxy) -> Self {
4350        value.into_channel().into()
4351    }
4352}
4353
4354#[cfg(target_os = "fuchsia")]
4355impl From<fidl::Channel> for NamespaceSynchronousProxy {
4356    fn from(value: fidl::Channel) -> Self {
4357        Self::new(value)
4358    }
4359}
4360
4361#[cfg(target_os = "fuchsia")]
4362impl fidl::endpoints::FromClient for NamespaceSynchronousProxy {
4363    type Protocol = NamespaceMarker;
4364
4365    fn from_client(value: fidl::endpoints::ClientEnd<NamespaceMarker>) -> Self {
4366        Self::new(value.into_channel())
4367    }
4368}
4369
4370#[derive(Debug, Clone)]
4371pub struct NamespaceProxy {
4372    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4373}
4374
4375impl fidl::endpoints::Proxy for NamespaceProxy {
4376    type Protocol = NamespaceMarker;
4377
4378    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4379        Self::new(inner)
4380    }
4381
4382    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4383        self.client.into_channel().map_err(|client| Self { client })
4384    }
4385
4386    fn as_channel(&self) -> &::fidl::AsyncChannel {
4387        self.client.as_channel()
4388    }
4389}
4390
4391impl NamespaceProxy {
4392    /// Create a new Proxy for fuchsia.component/Namespace.
4393    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4394        let protocol_name = <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4395        Self { client: fidl::client::Client::new(channel, protocol_name) }
4396    }
4397
4398    /// Get a Stream of events from the remote end of the protocol.
4399    ///
4400    /// # Panics
4401    ///
4402    /// Panics if the event stream was already taken.
4403    pub fn take_event_stream(&self) -> NamespaceEventStream {
4404        NamespaceEventStream { event_receiver: self.client.take_event_receiver() }
4405    }
4406
4407    pub fn r#create(
4408        &self,
4409        mut entries: Vec<NamespaceInputEntry>,
4410    ) -> fidl::client::QueryResponseFut<
4411        NamespaceCreateResult,
4412        fidl::encoding::DefaultFuchsiaResourceDialect,
4413    > {
4414        NamespaceProxyInterface::r#create(self, entries)
4415    }
4416
4417    pub fn r#create2(
4418        &self,
4419        mut entries: Vec<NamespaceInputEntry2>,
4420    ) -> fidl::client::QueryResponseFut<
4421        NamespaceCreate2Result,
4422        fidl::encoding::DefaultFuchsiaResourceDialect,
4423    > {
4424        NamespaceProxyInterface::r#create2(self, entries)
4425    }
4426}
4427
4428impl NamespaceProxyInterface for NamespaceProxy {
4429    type CreateResponseFut = fidl::client::QueryResponseFut<
4430        NamespaceCreateResult,
4431        fidl::encoding::DefaultFuchsiaResourceDialect,
4432    >;
4433    fn r#create(&self, mut entries: Vec<NamespaceInputEntry>) -> Self::CreateResponseFut {
4434        fn _decode(
4435            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4436        ) -> Result<NamespaceCreateResult, fidl::Error> {
4437            let _response = fidl::client::decode_transaction_body::<
4438                fidl::encoding::FlexibleResultType<NamespaceCreateResponse, NamespaceError>,
4439                fidl::encoding::DefaultFuchsiaResourceDialect,
4440                0x4329fe12b2a790f9,
4441            >(_buf?)?
4442            .into_result::<NamespaceMarker>("create")?;
4443            Ok(_response.map(|x| x.entries))
4444        }
4445        self.client.send_query_and_decode::<NamespaceCreateRequest, NamespaceCreateResult>(
4446            (entries.as_mut(),),
4447            0x4329fe12b2a790f9,
4448            fidl::encoding::DynamicFlags::FLEXIBLE,
4449            _decode,
4450        )
4451    }
4452
4453    type Create2ResponseFut = fidl::client::QueryResponseFut<
4454        NamespaceCreate2Result,
4455        fidl::encoding::DefaultFuchsiaResourceDialect,
4456    >;
4457    fn r#create2(&self, mut entries: Vec<NamespaceInputEntry2>) -> Self::Create2ResponseFut {
4458        fn _decode(
4459            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4460        ) -> Result<NamespaceCreate2Result, fidl::Error> {
4461            let _response = fidl::client::decode_transaction_body::<
4462                fidl::encoding::FlexibleResultType<NamespaceCreate2Response, NamespaceError>,
4463                fidl::encoding::DefaultFuchsiaResourceDialect,
4464                0x665aa4bb3773b351,
4465            >(_buf?)?
4466            .into_result::<NamespaceMarker>("create2")?;
4467            Ok(_response.map(|x| x.entries))
4468        }
4469        self.client.send_query_and_decode::<NamespaceCreate2Request, NamespaceCreate2Result>(
4470            (entries.as_mut(),),
4471            0x665aa4bb3773b351,
4472            fidl::encoding::DynamicFlags::FLEXIBLE,
4473            _decode,
4474        )
4475    }
4476}
4477
4478pub struct NamespaceEventStream {
4479    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4480}
4481
4482impl std::marker::Unpin for NamespaceEventStream {}
4483
4484impl futures::stream::FusedStream for NamespaceEventStream {
4485    fn is_terminated(&self) -> bool {
4486        self.event_receiver.is_terminated()
4487    }
4488}
4489
4490impl futures::Stream for NamespaceEventStream {
4491    type Item = Result<NamespaceEvent, fidl::Error>;
4492
4493    fn poll_next(
4494        mut self: std::pin::Pin<&mut Self>,
4495        cx: &mut std::task::Context<'_>,
4496    ) -> std::task::Poll<Option<Self::Item>> {
4497        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4498            &mut self.event_receiver,
4499            cx
4500        )?) {
4501            Some(buf) => std::task::Poll::Ready(Some(NamespaceEvent::decode(buf))),
4502            None => std::task::Poll::Ready(None),
4503        }
4504    }
4505}
4506
4507#[derive(Debug)]
4508pub enum NamespaceEvent {
4509    #[non_exhaustive]
4510    _UnknownEvent {
4511        /// Ordinal of the event that was sent.
4512        ordinal: u64,
4513    },
4514}
4515
4516impl NamespaceEvent {
4517    /// Decodes a message buffer as a [`NamespaceEvent`].
4518    fn decode(
4519        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4520    ) -> Result<NamespaceEvent, fidl::Error> {
4521        let (bytes, _handles) = buf.split_mut();
4522        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4523        debug_assert_eq!(tx_header.tx_id, 0);
4524        match tx_header.ordinal {
4525            _ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
4526                Ok(NamespaceEvent::_UnknownEvent { ordinal: tx_header.ordinal })
4527            }
4528            _ => Err(fidl::Error::UnknownOrdinal {
4529                ordinal: tx_header.ordinal,
4530                protocol_name: <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4531            }),
4532        }
4533    }
4534}
4535
4536/// A Stream of incoming requests for fuchsia.component/Namespace.
4537pub struct NamespaceRequestStream {
4538    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4539    is_terminated: bool,
4540}
4541
4542impl std::marker::Unpin for NamespaceRequestStream {}
4543
4544impl futures::stream::FusedStream for NamespaceRequestStream {
4545    fn is_terminated(&self) -> bool {
4546        self.is_terminated
4547    }
4548}
4549
4550impl fidl::endpoints::RequestStream for NamespaceRequestStream {
4551    type Protocol = NamespaceMarker;
4552    type ControlHandle = NamespaceControlHandle;
4553
4554    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4555        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4556    }
4557
4558    fn control_handle(&self) -> Self::ControlHandle {
4559        NamespaceControlHandle { inner: self.inner.clone() }
4560    }
4561
4562    fn into_inner(
4563        self,
4564    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4565    {
4566        (self.inner, self.is_terminated)
4567    }
4568
4569    fn from_inner(
4570        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4571        is_terminated: bool,
4572    ) -> Self {
4573        Self { inner, is_terminated }
4574    }
4575}
4576
4577impl futures::Stream for NamespaceRequestStream {
4578    type Item = Result<NamespaceRequest, fidl::Error>;
4579
4580    fn poll_next(
4581        mut self: std::pin::Pin<&mut Self>,
4582        cx: &mut std::task::Context<'_>,
4583    ) -> std::task::Poll<Option<Self::Item>> {
4584        let this = &mut *self;
4585        if this.inner.check_shutdown(cx) {
4586            this.is_terminated = true;
4587            return std::task::Poll::Ready(None);
4588        }
4589        if this.is_terminated {
4590            panic!("polled NamespaceRequestStream after completion");
4591        }
4592        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4593            |bytes, handles| {
4594                match this.inner.channel().read_etc(cx, bytes, handles) {
4595                    std::task::Poll::Ready(Ok(())) => {}
4596                    std::task::Poll::Pending => return std::task::Poll::Pending,
4597                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4598                        this.is_terminated = true;
4599                        return std::task::Poll::Ready(None);
4600                    }
4601                    std::task::Poll::Ready(Err(e)) => {
4602                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4603                            e.into(),
4604                        ))));
4605                    }
4606                }
4607
4608                // A message has been received from the channel
4609                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4610
4611                std::task::Poll::Ready(Some(match header.ordinal {
4612                    0x4329fe12b2a790f9 => {
4613                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4614                        let mut req = fidl::new_empty!(
4615                            NamespaceCreateRequest,
4616                            fidl::encoding::DefaultFuchsiaResourceDialect
4617                        );
4618                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NamespaceCreateRequest>(&header, _body_bytes, handles, &mut req)?;
4619                        let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
4620                        Ok(NamespaceRequest::Create {
4621                            entries: req.entries,
4622
4623                            responder: NamespaceCreateResponder {
4624                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4625                                tx_id: header.tx_id,
4626                            },
4627                        })
4628                    }
4629                    0x665aa4bb3773b351 => {
4630                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4631                        let mut req = fidl::new_empty!(
4632                            NamespaceCreate2Request,
4633                            fidl::encoding::DefaultFuchsiaResourceDialect
4634                        );
4635                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<NamespaceCreate2Request>(&header, _body_bytes, handles, &mut req)?;
4636                        let control_handle = NamespaceControlHandle { inner: this.inner.clone() };
4637                        Ok(NamespaceRequest::Create2 {
4638                            entries: req.entries,
4639
4640                            responder: NamespaceCreate2Responder {
4641                                control_handle: std::mem::ManuallyDrop::new(control_handle),
4642                                tx_id: header.tx_id,
4643                            },
4644                        })
4645                    }
4646                    _ if header.tx_id == 0
4647                        && header
4648                            .dynamic_flags()
4649                            .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4650                    {
4651                        Ok(NamespaceRequest::_UnknownMethod {
4652                            ordinal: header.ordinal,
4653                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
4654                            method_type: fidl::MethodType::OneWay,
4655                        })
4656                    }
4657                    _ if header
4658                        .dynamic_flags()
4659                        .contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
4660                    {
4661                        this.inner.send_framework_err(
4662                            fidl::encoding::FrameworkErr::UnknownMethod,
4663                            header.tx_id,
4664                            header.ordinal,
4665                            header.dynamic_flags(),
4666                            (bytes, handles),
4667                        )?;
4668                        Ok(NamespaceRequest::_UnknownMethod {
4669                            ordinal: header.ordinal,
4670                            control_handle: NamespaceControlHandle { inner: this.inner.clone() },
4671                            method_type: fidl::MethodType::TwoWay,
4672                        })
4673                    }
4674                    _ => Err(fidl::Error::UnknownOrdinal {
4675                        ordinal: header.ordinal,
4676                        protocol_name:
4677                            <NamespaceMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4678                    }),
4679                }))
4680            },
4681        )
4682    }
4683}
4684
4685/// Protocol for performing namespace operations.
4686#[derive(Debug)]
4687pub enum NamespaceRequest {
4688    Create {
4689        entries: Vec<NamespaceInputEntry>,
4690        responder: NamespaceCreateResponder,
4691    },
4692    Create2 {
4693        entries: Vec<NamespaceInputEntry2>,
4694        responder: NamespaceCreate2Responder,
4695    },
4696    /// An interaction was received which does not match any known method.
4697    #[non_exhaustive]
4698    _UnknownMethod {
4699        /// Ordinal of the method that was called.
4700        ordinal: u64,
4701        control_handle: NamespaceControlHandle,
4702        method_type: fidl::MethodType,
4703    },
4704}
4705
4706impl NamespaceRequest {
4707    #[allow(irrefutable_let_patterns)]
4708    pub fn into_create(self) -> Option<(Vec<NamespaceInputEntry>, NamespaceCreateResponder)> {
4709        if let NamespaceRequest::Create { entries, responder } = self {
4710            Some((entries, responder))
4711        } else {
4712            None
4713        }
4714    }
4715
4716    #[allow(irrefutable_let_patterns)]
4717    pub fn into_create2(self) -> Option<(Vec<NamespaceInputEntry2>, NamespaceCreate2Responder)> {
4718        if let NamespaceRequest::Create2 { entries, responder } = self {
4719            Some((entries, responder))
4720        } else {
4721            None
4722        }
4723    }
4724
4725    /// Name of the method defined in FIDL
4726    pub fn method_name(&self) -> &'static str {
4727        match *self {
4728            NamespaceRequest::Create { .. } => "create",
4729            NamespaceRequest::Create2 { .. } => "create2",
4730            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
4731                "unknown one-way method"
4732            }
4733            NamespaceRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
4734                "unknown two-way method"
4735            }
4736        }
4737    }
4738}
4739
4740#[derive(Debug, Clone)]
4741pub struct NamespaceControlHandle {
4742    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4743}
4744
4745impl NamespaceControlHandle {
4746    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
4747        self.inner.shutdown_with_epitaph(status.into())
4748    }
4749}
4750
4751impl fidl::endpoints::ControlHandle for NamespaceControlHandle {
4752    fn shutdown(&self) {
4753        self.inner.shutdown()
4754    }
4755
4756    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
4757        self.inner.shutdown_with_epitaph(status)
4758    }
4759
4760    fn is_closed(&self) -> bool {
4761        self.inner.channel().is_closed()
4762    }
4763    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4764        self.inner.channel().on_closed()
4765    }
4766
4767    #[cfg(target_os = "fuchsia")]
4768    fn signal_peer(
4769        &self,
4770        clear_mask: zx::Signals,
4771        set_mask: zx::Signals,
4772    ) -> Result<(), zx_status::Status> {
4773        use fidl::Peered;
4774        self.inner.channel().signal_peer(clear_mask, set_mask)
4775    }
4776}
4777
4778impl NamespaceControlHandle {}
4779
4780#[must_use = "FIDL methods require a response to be sent"]
4781#[derive(Debug)]
4782pub struct NamespaceCreateResponder {
4783    control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
4784    tx_id: u32,
4785}
4786
4787/// Set the the channel to be shutdown (see [`NamespaceControlHandle::shutdown`])
4788/// if the responder is dropped without sending a response, so that the client
4789/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4790impl std::ops::Drop for NamespaceCreateResponder {
4791    fn drop(&mut self) {
4792        self.control_handle.shutdown();
4793        // Safety: drops once, never accessed again
4794        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4795    }
4796}
4797
4798impl fidl::endpoints::Responder for NamespaceCreateResponder {
4799    type ControlHandle = NamespaceControlHandle;
4800
4801    fn control_handle(&self) -> &NamespaceControlHandle {
4802        &self.control_handle
4803    }
4804
4805    fn drop_without_shutdown(mut self) {
4806        // Safety: drops once, never accessed again due to mem::forget
4807        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4808        // Prevent Drop from running (which would shut down the channel)
4809        std::mem::forget(self);
4810    }
4811}
4812
4813impl NamespaceCreateResponder {
4814    /// Sends a response to the FIDL transaction.
4815    ///
4816    /// Sets the channel to shutdown if an error occurs.
4817    pub fn send(
4818        self,
4819        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4820    ) -> Result<(), fidl::Error> {
4821        let _result = self.send_raw(result);
4822        if _result.is_err() {
4823            self.control_handle.shutdown();
4824        }
4825        self.drop_without_shutdown();
4826        _result
4827    }
4828
4829    /// Similar to "send" but does not shutdown the channel if an error occurs.
4830    pub fn send_no_shutdown_on_err(
4831        self,
4832        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4833    ) -> Result<(), fidl::Error> {
4834        let _result = self.send_raw(result);
4835        self.drop_without_shutdown();
4836        _result
4837    }
4838
4839    fn send_raw(
4840        &self,
4841        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4842    ) -> Result<(), fidl::Error> {
4843        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4844            NamespaceCreateResponse,
4845            NamespaceError,
4846        >>(
4847            fidl::encoding::FlexibleResult::new(
4848                result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
4849            ),
4850            self.tx_id,
4851            0x4329fe12b2a790f9,
4852            fidl::encoding::DynamicFlags::FLEXIBLE,
4853        )
4854    }
4855}
4856
4857#[must_use = "FIDL methods require a response to be sent"]
4858#[derive(Debug)]
4859pub struct NamespaceCreate2Responder {
4860    control_handle: std::mem::ManuallyDrop<NamespaceControlHandle>,
4861    tx_id: u32,
4862}
4863
4864/// Set the the channel to be shutdown (see [`NamespaceControlHandle::shutdown`])
4865/// if the responder is dropped without sending a response, so that the client
4866/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4867impl std::ops::Drop for NamespaceCreate2Responder {
4868    fn drop(&mut self) {
4869        self.control_handle.shutdown();
4870        // Safety: drops once, never accessed again
4871        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4872    }
4873}
4874
4875impl fidl::endpoints::Responder for NamespaceCreate2Responder {
4876    type ControlHandle = NamespaceControlHandle;
4877
4878    fn control_handle(&self) -> &NamespaceControlHandle {
4879        &self.control_handle
4880    }
4881
4882    fn drop_without_shutdown(mut self) {
4883        // Safety: drops once, never accessed again due to mem::forget
4884        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4885        // Prevent Drop from running (which would shut down the channel)
4886        std::mem::forget(self);
4887    }
4888}
4889
4890impl NamespaceCreate2Responder {
4891    /// Sends a response to the FIDL transaction.
4892    ///
4893    /// Sets the channel to shutdown if an error occurs.
4894    pub fn send(
4895        self,
4896        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4897    ) -> Result<(), fidl::Error> {
4898        let _result = self.send_raw(result);
4899        if _result.is_err() {
4900            self.control_handle.shutdown();
4901        }
4902        self.drop_without_shutdown();
4903        _result
4904    }
4905
4906    /// Similar to "send" but does not shutdown the channel if an error occurs.
4907    pub fn send_no_shutdown_on_err(
4908        self,
4909        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4910    ) -> Result<(), fidl::Error> {
4911        let _result = self.send_raw(result);
4912        self.drop_without_shutdown();
4913        _result
4914    }
4915
4916    fn send_raw(
4917        &self,
4918        mut result: Result<Vec<NamespaceEntry>, NamespaceError>,
4919    ) -> Result<(), fidl::Error> {
4920        self.control_handle.inner.send::<fidl::encoding::FlexibleResultType<
4921            NamespaceCreate2Response,
4922            NamespaceError,
4923        >>(
4924            fidl::encoding::FlexibleResult::new(
4925                result.as_mut().map_err(|e| *e).map(|entries| (entries.as_mut_slice(),)),
4926            ),
4927            self.tx_id,
4928            0x665aa4bb3773b351,
4929            fidl::encoding::DynamicFlags::FLEXIBLE,
4930        )
4931    }
4932}
4933
4934#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
4935pub struct RealmMarker;
4936
4937impl fidl::endpoints::ProtocolMarker for RealmMarker {
4938    type Proxy = RealmProxy;
4939    type RequestStream = RealmRequestStream;
4940    #[cfg(target_os = "fuchsia")]
4941    type SynchronousProxy = RealmSynchronousProxy;
4942
4943    const DEBUG_NAME: &'static str = "fuchsia.component.Realm";
4944}
4945impl fidl::endpoints::DiscoverableProtocolMarker for RealmMarker {}
4946pub type RealmOpenControllerResult = Result<(), Error>;
4947pub type RealmOpenExposedDirResult = Result<(), Error>;
4948pub type RealmCreateChildResult = Result<(), Error>;
4949pub type RealmDestroyChildResult = Result<(), Error>;
4950pub type RealmListChildrenResult = Result<(), Error>;
4951pub type RealmGetResolvedInfoResult = Result<fidl_fuchsia_component_resolution::Component, Error>;
4952pub type RealmGetChildOutputDictionaryDeprecatedResult =
4953    Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>;
4954pub type RealmGetChildOutputDictionaryResult = Result<fidl::EventPair, Error>;
4955
4956pub trait RealmProxyInterface: Send + Sync {
4957    type OpenControllerResponseFut: std::future::Future<Output = Result<RealmOpenControllerResult, fidl::Error>>
4958        + Send;
4959    fn r#open_controller(
4960        &self,
4961        child: &fidl_fuchsia_component_decl::ChildRef,
4962        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
4963    ) -> Self::OpenControllerResponseFut;
4964    type OpenExposedDirResponseFut: std::future::Future<Output = Result<RealmOpenExposedDirResult, fidl::Error>>
4965        + Send;
4966    fn r#open_exposed_dir(
4967        &self,
4968        child: &fidl_fuchsia_component_decl::ChildRef,
4969        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4970    ) -> Self::OpenExposedDirResponseFut;
4971    type CreateChildResponseFut: std::future::Future<Output = Result<RealmCreateChildResult, fidl::Error>>
4972        + Send;
4973    fn r#create_child(
4974        &self,
4975        collection: &fidl_fuchsia_component_decl::CollectionRef,
4976        decl: &fidl_fuchsia_component_decl::Child,
4977        args: CreateChildArgs,
4978    ) -> Self::CreateChildResponseFut;
4979    type DestroyChildResponseFut: std::future::Future<Output = Result<RealmDestroyChildResult, fidl::Error>>
4980        + Send;
4981    fn r#destroy_child(
4982        &self,
4983        child: &fidl_fuchsia_component_decl::ChildRef,
4984    ) -> Self::DestroyChildResponseFut;
4985    type ListChildrenResponseFut: std::future::Future<Output = Result<RealmListChildrenResult, fidl::Error>>
4986        + Send;
4987    fn r#list_children(
4988        &self,
4989        collection: &fidl_fuchsia_component_decl::CollectionRef,
4990        iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
4991    ) -> Self::ListChildrenResponseFut;
4992    type GetResolvedInfoResponseFut: std::future::Future<Output = Result<RealmGetResolvedInfoResult, fidl::Error>>
4993        + Send;
4994    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut;
4995    type GetChildOutputDictionaryDeprecatedResponseFut: std::future::Future<
4996            Output = Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error>,
4997        > + Send;
4998    fn r#get_child_output_dictionary_deprecated(
4999        &self,
5000        child: &fidl_fuchsia_component_decl::ChildRef,
5001    ) -> Self::GetChildOutputDictionaryDeprecatedResponseFut;
5002    type GetChildOutputDictionaryResponseFut: std::future::Future<Output = Result<RealmGetChildOutputDictionaryResult, fidl::Error>>
5003        + Send;
5004    fn r#get_child_output_dictionary(
5005        &self,
5006        child: &fidl_fuchsia_component_decl::ChildRef,
5007    ) -> Self::GetChildOutputDictionaryResponseFut;
5008}
5009#[derive(Debug)]
5010#[cfg(target_os = "fuchsia")]
5011pub struct RealmSynchronousProxy {
5012    client: fidl::client::sync::Client,
5013}
5014
5015#[cfg(target_os = "fuchsia")]
5016impl fidl::endpoints::SynchronousProxy for RealmSynchronousProxy {
5017    type Proxy = RealmProxy;
5018    type Protocol = RealmMarker;
5019
5020    fn from_channel(inner: fidl::Channel) -> Self {
5021        Self::new(inner)
5022    }
5023
5024    fn into_channel(self) -> fidl::Channel {
5025        self.client.into_channel()
5026    }
5027
5028    fn as_channel(&self) -> &fidl::Channel {
5029        self.client.as_channel()
5030    }
5031}
5032
5033#[cfg(target_os = "fuchsia")]
5034impl RealmSynchronousProxy {
5035    pub fn new(channel: fidl::Channel) -> Self {
5036        Self { client: fidl::client::sync::Client::new(channel) }
5037    }
5038
5039    pub fn into_channel(self) -> fidl::Channel {
5040        self.client.into_channel()
5041    }
5042
5043    /// Waits until an event arrives and returns it. It is safe for other
5044    /// threads to make concurrent requests while waiting for an event.
5045    pub fn wait_for_event(
5046        &self,
5047        deadline: zx::MonotonicInstant,
5048    ) -> Result<RealmEvent, fidl::Error> {
5049        RealmEvent::decode(self.client.wait_for_event::<RealmMarker>(deadline)?)
5050    }
5051
5052    /// Operate on a child component. See documentation for [`Controller`].
5053    ///
5054    /// Errors:
5055    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5056    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5057    /// - `INSTANCE_DIED`: This realm no longer exists.
5058    pub fn r#open_controller(
5059        &self,
5060        mut child: &fidl_fuchsia_component_decl::ChildRef,
5061        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5062        ___deadline: zx::MonotonicInstant,
5063    ) -> Result<RealmOpenControllerResult, fidl::Error> {
5064        let _response = self.client.send_query::<
5065            RealmOpenControllerRequest,
5066            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5067            RealmMarker,
5068        >(
5069            (child, controller,),
5070            0x7150b7898d1b1180,
5071            fidl::encoding::DynamicFlags::empty(),
5072            ___deadline,
5073        )?;
5074        Ok(_response.map(|x| x))
5075    }
5076
5077    /// Opens the exposed directory of a child component. When this function
5078    /// successfully returns, `exposed_dir` is bound to a directory that
5079    /// contains the capabilities which the child exposed to its realm via
5080    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
5081    /// component's manifest). The child component will not start as a result of
5082    /// this call.
5083    ///
5084    /// `exposed_dir` is open as long as `child` exists.
5085    ///
5086    /// Errors:
5087    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5088    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5089    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
5090    /// - `INSTANCE_DIED`: This realm no longer exists.
5091    pub fn r#open_exposed_dir(
5092        &self,
5093        mut child: &fidl_fuchsia_component_decl::ChildRef,
5094        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5095        ___deadline: zx::MonotonicInstant,
5096    ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
5097        let _response = self.client.send_query::<
5098            RealmOpenExposedDirRequest,
5099            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5100            RealmMarker,
5101        >(
5102            (child, exposed_dir,),
5103            0x7f993235ca59f92c,
5104            fidl::encoding::DynamicFlags::empty(),
5105            ___deadline,
5106        )?;
5107        Ok(_response.map(|x| x))
5108    }
5109
5110    /// Creates a child component instance dynamically. When this function
5111    /// returns successfully, the instance exists, but it may not be running.
5112    ///
5113    /// The environment of the child instance is determined by the environment
5114    /// of the collection. `decl` must not set `environment`.
5115    ///
5116    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
5117    /// [CreateChild] will start the component and return once the component is
5118    /// started. Otherwise, [CreateChild] will return immediately after creating
5119    /// the component and will not start or resolve it.
5120    ///
5121    /// Errors:
5122    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
5123    ///   is not a valid declaration.
5124    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5125    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
5126    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
5127    ///   in a `SingleRun` collection.
5128    /// - `NO_SPACE`: Could not allocate storage for the new instance.
5129    /// - `INSTANCE_DIED`: This realm no longer exists.
5130    pub fn r#create_child(
5131        &self,
5132        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5133        mut decl: &fidl_fuchsia_component_decl::Child,
5134        mut args: CreateChildArgs,
5135        ___deadline: zx::MonotonicInstant,
5136    ) -> Result<RealmCreateChildResult, fidl::Error> {
5137        let _response = self.client.send_query::<
5138            RealmCreateChildRequest,
5139            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5140            RealmMarker,
5141        >(
5142            (collection, decl, &mut args,),
5143            0x43e48ce8483d7560,
5144            fidl::encoding::DynamicFlags::empty(),
5145            ___deadline,
5146        )?;
5147        Ok(_response.map(|x| x))
5148    }
5149
5150    /// Destroys a dynamically-created component instance. When this function
5151    /// returns, the instance is destroyed and has stopped running.  However,
5152    /// cleanup of the component's resources (such as its isolated storage) may
5153    /// happen in the background after this function returns.
5154    ///
5155    /// Errors:
5156    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
5157    ///   to a dynamic instance.
5158    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5159    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5160    /// - `INSTANCE_DIED`: This realm no longer exists.
5161    pub fn r#destroy_child(
5162        &self,
5163        mut child: &fidl_fuchsia_component_decl::ChildRef,
5164        ___deadline: zx::MonotonicInstant,
5165    ) -> Result<RealmDestroyChildResult, fidl::Error> {
5166        let _response = self.client.send_query::<
5167            RealmDestroyChildRequest,
5168            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5169            RealmMarker,
5170        >(
5171            (child,),
5172            0x71d8caf8850c9222,
5173            fidl::encoding::DynamicFlags::empty(),
5174            ___deadline,
5175        )?;
5176        Ok(_response.map(|x| x))
5177    }
5178
5179    /// Returns an iterator that lists all instances in a collection.
5180    ///
5181    /// NOTE: The results are not guaranteed to be consistent. Instances may be
5182    /// created or destroyed while the iterator is live, but those changes
5183    /// won't be observed by the iterator after this method returns.
5184    ///
5185    /// Errors:
5186    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
5187    /// does not have `ZX_RIGHT_WAIT`.
5188    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5189    /// - `INSTANCE_DIED`: This realm no longer exists.
5190    /// - If `iter` does not have standard channel rights, this function may
5191    ///   return `ACCESS_DENIED` or component manager may close `iter`.
5192    pub fn r#list_children(
5193        &self,
5194        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5195        mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5196        ___deadline: zx::MonotonicInstant,
5197    ) -> Result<RealmListChildrenResult, fidl::Error> {
5198        let _response = self.client.send_query::<
5199            RealmListChildrenRequest,
5200            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5201            RealmMarker,
5202        >(
5203            (collection, iter,),
5204            0x6888a76683efc0a1,
5205            fidl::encoding::DynamicFlags::empty(),
5206            ___deadline,
5207        )?;
5208        Ok(_response.map(|x| x))
5209    }
5210
5211    /// Returns the set of information that was given to the component framework
5212    /// by this component's resolver.
5213    pub fn r#get_resolved_info(
5214        &self,
5215        ___deadline: zx::MonotonicInstant,
5216    ) -> Result<RealmGetResolvedInfoResult, fidl::Error> {
5217        let _response = self.client.send_query::<
5218            fidl::encoding::EmptyPayload,
5219            fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>,
5220            RealmMarker,
5221        >(
5222            (),
5223            0x734f744cb7d210a2,
5224            fidl::encoding::DynamicFlags::empty(),
5225            ___deadline,
5226        )?;
5227        Ok(_response.map(|x| x.resolved_info))
5228    }
5229
5230    pub fn r#get_child_output_dictionary_deprecated(
5231        &self,
5232        mut child: &fidl_fuchsia_component_decl::ChildRef,
5233        ___deadline: zx::MonotonicInstant,
5234    ) -> Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error> {
5235        let _response = self.client.send_query::<
5236            RealmGetChildOutputDictionaryDeprecatedRequest,
5237            fidl::encoding::ResultType<RealmGetChildOutputDictionaryDeprecatedResponse, Error>,
5238            RealmMarker,
5239        >(
5240            (child,),
5241            0x39245b02aba94364,
5242            fidl::encoding::DynamicFlags::empty(),
5243            ___deadline,
5244        )?;
5245        Ok(_response.map(|x| x.dictionary))
5246    }
5247
5248    /// Returns a reference to a child's output dictionary, which may be
5249    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
5250    pub fn r#get_child_output_dictionary(
5251        &self,
5252        mut child: &fidl_fuchsia_component_decl::ChildRef,
5253        ___deadline: zx::MonotonicInstant,
5254    ) -> Result<RealmGetChildOutputDictionaryResult, fidl::Error> {
5255        let _response = self.client.send_query::<
5256            RealmGetChildOutputDictionaryRequest,
5257            fidl::encoding::ResultType<RealmGetChildOutputDictionaryResponse, Error>,
5258            RealmMarker,
5259        >(
5260            (child,),
5261            0x4259d08d261d5610,
5262            fidl::encoding::DynamicFlags::empty(),
5263            ___deadline,
5264        )?;
5265        Ok(_response.map(|x| x.dictionary))
5266    }
5267}
5268
5269#[cfg(target_os = "fuchsia")]
5270impl From<RealmSynchronousProxy> for zx::NullableHandle {
5271    fn from(value: RealmSynchronousProxy) -> Self {
5272        value.into_channel().into()
5273    }
5274}
5275
5276#[cfg(target_os = "fuchsia")]
5277impl From<fidl::Channel> for RealmSynchronousProxy {
5278    fn from(value: fidl::Channel) -> Self {
5279        Self::new(value)
5280    }
5281}
5282
5283#[cfg(target_os = "fuchsia")]
5284impl fidl::endpoints::FromClient for RealmSynchronousProxy {
5285    type Protocol = RealmMarker;
5286
5287    fn from_client(value: fidl::endpoints::ClientEnd<RealmMarker>) -> Self {
5288        Self::new(value.into_channel())
5289    }
5290}
5291
5292#[derive(Debug, Clone)]
5293pub struct RealmProxy {
5294    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5295}
5296
5297impl fidl::endpoints::Proxy for RealmProxy {
5298    type Protocol = RealmMarker;
5299
5300    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5301        Self::new(inner)
5302    }
5303
5304    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5305        self.client.into_channel().map_err(|client| Self { client })
5306    }
5307
5308    fn as_channel(&self) -> &::fidl::AsyncChannel {
5309        self.client.as_channel()
5310    }
5311}
5312
5313impl RealmProxy {
5314    /// Create a new Proxy for fuchsia.component/Realm.
5315    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5316        let protocol_name = <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5317        Self { client: fidl::client::Client::new(channel, protocol_name) }
5318    }
5319
5320    /// Get a Stream of events from the remote end of the protocol.
5321    ///
5322    /// # Panics
5323    ///
5324    /// Panics if the event stream was already taken.
5325    pub fn take_event_stream(&self) -> RealmEventStream {
5326        RealmEventStream { event_receiver: self.client.take_event_receiver() }
5327    }
5328
5329    /// Operate on a child component. See documentation for [`Controller`].
5330    ///
5331    /// Errors:
5332    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5333    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5334    /// - `INSTANCE_DIED`: This realm no longer exists.
5335    pub fn r#open_controller(
5336        &self,
5337        mut child: &fidl_fuchsia_component_decl::ChildRef,
5338        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5339    ) -> fidl::client::QueryResponseFut<
5340        RealmOpenControllerResult,
5341        fidl::encoding::DefaultFuchsiaResourceDialect,
5342    > {
5343        RealmProxyInterface::r#open_controller(self, child, controller)
5344    }
5345
5346    /// Opens the exposed directory of a child component. When this function
5347    /// successfully returns, `exposed_dir` is bound to a directory that
5348    /// contains the capabilities which the child exposed to its realm via
5349    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
5350    /// component's manifest). The child component will not start as a result of
5351    /// this call.
5352    ///
5353    /// `exposed_dir` is open as long as `child` exists.
5354    ///
5355    /// Errors:
5356    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5357    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5358    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
5359    /// - `INSTANCE_DIED`: This realm no longer exists.
5360    pub fn r#open_exposed_dir(
5361        &self,
5362        mut child: &fidl_fuchsia_component_decl::ChildRef,
5363        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5364    ) -> fidl::client::QueryResponseFut<
5365        RealmOpenExposedDirResult,
5366        fidl::encoding::DefaultFuchsiaResourceDialect,
5367    > {
5368        RealmProxyInterface::r#open_exposed_dir(self, child, exposed_dir)
5369    }
5370
5371    /// Creates a child component instance dynamically. When this function
5372    /// returns successfully, the instance exists, but it may not be running.
5373    ///
5374    /// The environment of the child instance is determined by the environment
5375    /// of the collection. `decl` must not set `environment`.
5376    ///
5377    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
5378    /// [CreateChild] will start the component and return once the component is
5379    /// started. Otherwise, [CreateChild] will return immediately after creating
5380    /// the component and will not start or resolve it.
5381    ///
5382    /// Errors:
5383    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
5384    ///   is not a valid declaration.
5385    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5386    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
5387    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
5388    ///   in a `SingleRun` collection.
5389    /// - `NO_SPACE`: Could not allocate storage for the new instance.
5390    /// - `INSTANCE_DIED`: This realm no longer exists.
5391    pub fn r#create_child(
5392        &self,
5393        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5394        mut decl: &fidl_fuchsia_component_decl::Child,
5395        mut args: CreateChildArgs,
5396    ) -> fidl::client::QueryResponseFut<
5397        RealmCreateChildResult,
5398        fidl::encoding::DefaultFuchsiaResourceDialect,
5399    > {
5400        RealmProxyInterface::r#create_child(self, collection, decl, args)
5401    }
5402
5403    /// Destroys a dynamically-created component instance. When this function
5404    /// returns, the instance is destroyed and has stopped running.  However,
5405    /// cleanup of the component's resources (such as its isolated storage) may
5406    /// happen in the background after this function returns.
5407    ///
5408    /// Errors:
5409    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
5410    ///   to a dynamic instance.
5411    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5412    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5413    /// - `INSTANCE_DIED`: This realm no longer exists.
5414    pub fn r#destroy_child(
5415        &self,
5416        mut child: &fidl_fuchsia_component_decl::ChildRef,
5417    ) -> fidl::client::QueryResponseFut<
5418        RealmDestroyChildResult,
5419        fidl::encoding::DefaultFuchsiaResourceDialect,
5420    > {
5421        RealmProxyInterface::r#destroy_child(self, child)
5422    }
5423
5424    /// Returns an iterator that lists all instances in a collection.
5425    ///
5426    /// NOTE: The results are not guaranteed to be consistent. Instances may be
5427    /// created or destroyed while the iterator is live, but those changes
5428    /// won't be observed by the iterator after this method returns.
5429    ///
5430    /// Errors:
5431    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
5432    /// does not have `ZX_RIGHT_WAIT`.
5433    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
5434    /// - `INSTANCE_DIED`: This realm no longer exists.
5435    /// - If `iter` does not have standard channel rights, this function may
5436    ///   return `ACCESS_DENIED` or component manager may close `iter`.
5437    pub fn r#list_children(
5438        &self,
5439        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5440        mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5441    ) -> fidl::client::QueryResponseFut<
5442        RealmListChildrenResult,
5443        fidl::encoding::DefaultFuchsiaResourceDialect,
5444    > {
5445        RealmProxyInterface::r#list_children(self, collection, iter)
5446    }
5447
5448    /// Returns the set of information that was given to the component framework
5449    /// by this component's resolver.
5450    pub fn r#get_resolved_info(
5451        &self,
5452    ) -> fidl::client::QueryResponseFut<
5453        RealmGetResolvedInfoResult,
5454        fidl::encoding::DefaultFuchsiaResourceDialect,
5455    > {
5456        RealmProxyInterface::r#get_resolved_info(self)
5457    }
5458
5459    pub fn r#get_child_output_dictionary_deprecated(
5460        &self,
5461        mut child: &fidl_fuchsia_component_decl::ChildRef,
5462    ) -> fidl::client::QueryResponseFut<
5463        RealmGetChildOutputDictionaryDeprecatedResult,
5464        fidl::encoding::DefaultFuchsiaResourceDialect,
5465    > {
5466        RealmProxyInterface::r#get_child_output_dictionary_deprecated(self, child)
5467    }
5468
5469    /// Returns a reference to a child's output dictionary, which may be
5470    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
5471    pub fn r#get_child_output_dictionary(
5472        &self,
5473        mut child: &fidl_fuchsia_component_decl::ChildRef,
5474    ) -> fidl::client::QueryResponseFut<
5475        RealmGetChildOutputDictionaryResult,
5476        fidl::encoding::DefaultFuchsiaResourceDialect,
5477    > {
5478        RealmProxyInterface::r#get_child_output_dictionary(self, child)
5479    }
5480}
5481
5482impl RealmProxyInterface for RealmProxy {
5483    type OpenControllerResponseFut = fidl::client::QueryResponseFut<
5484        RealmOpenControllerResult,
5485        fidl::encoding::DefaultFuchsiaResourceDialect,
5486    >;
5487    fn r#open_controller(
5488        &self,
5489        mut child: &fidl_fuchsia_component_decl::ChildRef,
5490        mut controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5491    ) -> Self::OpenControllerResponseFut {
5492        fn _decode(
5493            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5494        ) -> Result<RealmOpenControllerResult, fidl::Error> {
5495            let _response = fidl::client::decode_transaction_body::<
5496                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5497                fidl::encoding::DefaultFuchsiaResourceDialect,
5498                0x7150b7898d1b1180,
5499            >(_buf?)?;
5500            Ok(_response.map(|x| x))
5501        }
5502        self.client.send_query_and_decode::<RealmOpenControllerRequest, RealmOpenControllerResult>(
5503            (child, controller),
5504            0x7150b7898d1b1180,
5505            fidl::encoding::DynamicFlags::empty(),
5506            _decode,
5507        )
5508    }
5509
5510    type OpenExposedDirResponseFut = fidl::client::QueryResponseFut<
5511        RealmOpenExposedDirResult,
5512        fidl::encoding::DefaultFuchsiaResourceDialect,
5513    >;
5514    fn r#open_exposed_dir(
5515        &self,
5516        mut child: &fidl_fuchsia_component_decl::ChildRef,
5517        mut exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
5518    ) -> Self::OpenExposedDirResponseFut {
5519        fn _decode(
5520            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5521        ) -> Result<RealmOpenExposedDirResult, fidl::Error> {
5522            let _response = fidl::client::decode_transaction_body::<
5523                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5524                fidl::encoding::DefaultFuchsiaResourceDialect,
5525                0x7f993235ca59f92c,
5526            >(_buf?)?;
5527            Ok(_response.map(|x| x))
5528        }
5529        self.client.send_query_and_decode::<RealmOpenExposedDirRequest, RealmOpenExposedDirResult>(
5530            (child, exposed_dir),
5531            0x7f993235ca59f92c,
5532            fidl::encoding::DynamicFlags::empty(),
5533            _decode,
5534        )
5535    }
5536
5537    type CreateChildResponseFut = fidl::client::QueryResponseFut<
5538        RealmCreateChildResult,
5539        fidl::encoding::DefaultFuchsiaResourceDialect,
5540    >;
5541    fn r#create_child(
5542        &self,
5543        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5544        mut decl: &fidl_fuchsia_component_decl::Child,
5545        mut args: CreateChildArgs,
5546    ) -> Self::CreateChildResponseFut {
5547        fn _decode(
5548            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5549        ) -> Result<RealmCreateChildResult, fidl::Error> {
5550            let _response = fidl::client::decode_transaction_body::<
5551                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5552                fidl::encoding::DefaultFuchsiaResourceDialect,
5553                0x43e48ce8483d7560,
5554            >(_buf?)?;
5555            Ok(_response.map(|x| x))
5556        }
5557        self.client.send_query_and_decode::<RealmCreateChildRequest, RealmCreateChildResult>(
5558            (collection, decl, &mut args),
5559            0x43e48ce8483d7560,
5560            fidl::encoding::DynamicFlags::empty(),
5561            _decode,
5562        )
5563    }
5564
5565    type DestroyChildResponseFut = fidl::client::QueryResponseFut<
5566        RealmDestroyChildResult,
5567        fidl::encoding::DefaultFuchsiaResourceDialect,
5568    >;
5569    fn r#destroy_child(
5570        &self,
5571        mut child: &fidl_fuchsia_component_decl::ChildRef,
5572    ) -> Self::DestroyChildResponseFut {
5573        fn _decode(
5574            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5575        ) -> Result<RealmDestroyChildResult, fidl::Error> {
5576            let _response = fidl::client::decode_transaction_body::<
5577                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5578                fidl::encoding::DefaultFuchsiaResourceDialect,
5579                0x71d8caf8850c9222,
5580            >(_buf?)?;
5581            Ok(_response.map(|x| x))
5582        }
5583        self.client.send_query_and_decode::<RealmDestroyChildRequest, RealmDestroyChildResult>(
5584            (child,),
5585            0x71d8caf8850c9222,
5586            fidl::encoding::DynamicFlags::empty(),
5587            _decode,
5588        )
5589    }
5590
5591    type ListChildrenResponseFut = fidl::client::QueryResponseFut<
5592        RealmListChildrenResult,
5593        fidl::encoding::DefaultFuchsiaResourceDialect,
5594    >;
5595    fn r#list_children(
5596        &self,
5597        mut collection: &fidl_fuchsia_component_decl::CollectionRef,
5598        mut iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
5599    ) -> Self::ListChildrenResponseFut {
5600        fn _decode(
5601            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5602        ) -> Result<RealmListChildrenResult, fidl::Error> {
5603            let _response = fidl::client::decode_transaction_body::<
5604                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
5605                fidl::encoding::DefaultFuchsiaResourceDialect,
5606                0x6888a76683efc0a1,
5607            >(_buf?)?;
5608            Ok(_response.map(|x| x))
5609        }
5610        self.client.send_query_and_decode::<RealmListChildrenRequest, RealmListChildrenResult>(
5611            (collection, iter),
5612            0x6888a76683efc0a1,
5613            fidl::encoding::DynamicFlags::empty(),
5614            _decode,
5615        )
5616    }
5617
5618    type GetResolvedInfoResponseFut = fidl::client::QueryResponseFut<
5619        RealmGetResolvedInfoResult,
5620        fidl::encoding::DefaultFuchsiaResourceDialect,
5621    >;
5622    fn r#get_resolved_info(&self) -> Self::GetResolvedInfoResponseFut {
5623        fn _decode(
5624            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5625        ) -> Result<RealmGetResolvedInfoResult, fidl::Error> {
5626            let _response = fidl::client::decode_transaction_body::<
5627                fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>,
5628                fidl::encoding::DefaultFuchsiaResourceDialect,
5629                0x734f744cb7d210a2,
5630            >(_buf?)?;
5631            Ok(_response.map(|x| x.resolved_info))
5632        }
5633        self.client
5634            .send_query_and_decode::<fidl::encoding::EmptyPayload, RealmGetResolvedInfoResult>(
5635                (),
5636                0x734f744cb7d210a2,
5637                fidl::encoding::DynamicFlags::empty(),
5638                _decode,
5639            )
5640    }
5641
5642    type GetChildOutputDictionaryDeprecatedResponseFut = fidl::client::QueryResponseFut<
5643        RealmGetChildOutputDictionaryDeprecatedResult,
5644        fidl::encoding::DefaultFuchsiaResourceDialect,
5645    >;
5646    fn r#get_child_output_dictionary_deprecated(
5647        &self,
5648        mut child: &fidl_fuchsia_component_decl::ChildRef,
5649    ) -> Self::GetChildOutputDictionaryDeprecatedResponseFut {
5650        fn _decode(
5651            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5652        ) -> Result<RealmGetChildOutputDictionaryDeprecatedResult, fidl::Error> {
5653            let _response = fidl::client::decode_transaction_body::<
5654                fidl::encoding::ResultType<RealmGetChildOutputDictionaryDeprecatedResponse, Error>,
5655                fidl::encoding::DefaultFuchsiaResourceDialect,
5656                0x39245b02aba94364,
5657            >(_buf?)?;
5658            Ok(_response.map(|x| x.dictionary))
5659        }
5660        self.client.send_query_and_decode::<
5661            RealmGetChildOutputDictionaryDeprecatedRequest,
5662            RealmGetChildOutputDictionaryDeprecatedResult,
5663        >(
5664            (child,),
5665            0x39245b02aba94364,
5666            fidl::encoding::DynamicFlags::empty(),
5667            _decode,
5668        )
5669    }
5670
5671    type GetChildOutputDictionaryResponseFut = fidl::client::QueryResponseFut<
5672        RealmGetChildOutputDictionaryResult,
5673        fidl::encoding::DefaultFuchsiaResourceDialect,
5674    >;
5675    fn r#get_child_output_dictionary(
5676        &self,
5677        mut child: &fidl_fuchsia_component_decl::ChildRef,
5678    ) -> Self::GetChildOutputDictionaryResponseFut {
5679        fn _decode(
5680            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
5681        ) -> Result<RealmGetChildOutputDictionaryResult, fidl::Error> {
5682            let _response = fidl::client::decode_transaction_body::<
5683                fidl::encoding::ResultType<RealmGetChildOutputDictionaryResponse, Error>,
5684                fidl::encoding::DefaultFuchsiaResourceDialect,
5685                0x4259d08d261d5610,
5686            >(_buf?)?;
5687            Ok(_response.map(|x| x.dictionary))
5688        }
5689        self.client.send_query_and_decode::<
5690            RealmGetChildOutputDictionaryRequest,
5691            RealmGetChildOutputDictionaryResult,
5692        >(
5693            (child,),
5694            0x4259d08d261d5610,
5695            fidl::encoding::DynamicFlags::empty(),
5696            _decode,
5697        )
5698    }
5699}
5700
5701pub struct RealmEventStream {
5702    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
5703}
5704
5705impl std::marker::Unpin for RealmEventStream {}
5706
5707impl futures::stream::FusedStream for RealmEventStream {
5708    fn is_terminated(&self) -> bool {
5709        self.event_receiver.is_terminated()
5710    }
5711}
5712
5713impl futures::Stream for RealmEventStream {
5714    type Item = Result<RealmEvent, fidl::Error>;
5715
5716    fn poll_next(
5717        mut self: std::pin::Pin<&mut Self>,
5718        cx: &mut std::task::Context<'_>,
5719    ) -> std::task::Poll<Option<Self::Item>> {
5720        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
5721            &mut self.event_receiver,
5722            cx
5723        )?) {
5724            Some(buf) => std::task::Poll::Ready(Some(RealmEvent::decode(buf))),
5725            None => std::task::Poll::Ready(None),
5726        }
5727    }
5728}
5729
5730#[derive(Debug)]
5731pub enum RealmEvent {}
5732
5733impl RealmEvent {
5734    /// Decodes a message buffer as a [`RealmEvent`].
5735    fn decode(
5736        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
5737    ) -> Result<RealmEvent, fidl::Error> {
5738        let (bytes, _handles) = buf.split_mut();
5739        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5740        debug_assert_eq!(tx_header.tx_id, 0);
5741        match tx_header.ordinal {
5742            _ => Err(fidl::Error::UnknownOrdinal {
5743                ordinal: tx_header.ordinal,
5744                protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5745            }),
5746        }
5747    }
5748}
5749
5750/// A Stream of incoming requests for fuchsia.component/Realm.
5751pub struct RealmRequestStream {
5752    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5753    is_terminated: bool,
5754}
5755
5756impl std::marker::Unpin for RealmRequestStream {}
5757
5758impl futures::stream::FusedStream for RealmRequestStream {
5759    fn is_terminated(&self) -> bool {
5760        self.is_terminated
5761    }
5762}
5763
5764impl fidl::endpoints::RequestStream for RealmRequestStream {
5765    type Protocol = RealmMarker;
5766    type ControlHandle = RealmControlHandle;
5767
5768    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
5769        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
5770    }
5771
5772    fn control_handle(&self) -> Self::ControlHandle {
5773        RealmControlHandle { inner: self.inner.clone() }
5774    }
5775
5776    fn into_inner(
5777        self,
5778    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
5779    {
5780        (self.inner, self.is_terminated)
5781    }
5782
5783    fn from_inner(
5784        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5785        is_terminated: bool,
5786    ) -> Self {
5787        Self { inner, is_terminated }
5788    }
5789}
5790
5791impl futures::Stream for RealmRequestStream {
5792    type Item = Result<RealmRequest, fidl::Error>;
5793
5794    fn poll_next(
5795        mut self: std::pin::Pin<&mut Self>,
5796        cx: &mut std::task::Context<'_>,
5797    ) -> std::task::Poll<Option<Self::Item>> {
5798        let this = &mut *self;
5799        if this.inner.check_shutdown(cx) {
5800            this.is_terminated = true;
5801            return std::task::Poll::Ready(None);
5802        }
5803        if this.is_terminated {
5804            panic!("polled RealmRequestStream after completion");
5805        }
5806        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
5807            |bytes, handles| {
5808                match this.inner.channel().read_etc(cx, bytes, handles) {
5809                    std::task::Poll::Ready(Ok(())) => {}
5810                    std::task::Poll::Pending => return std::task::Poll::Pending,
5811                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
5812                        this.is_terminated = true;
5813                        return std::task::Poll::Ready(None);
5814                    }
5815                    std::task::Poll::Ready(Err(e)) => {
5816                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
5817                            e.into(),
5818                        ))));
5819                    }
5820                }
5821
5822                // A message has been received from the channel
5823                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
5824
5825                std::task::Poll::Ready(Some(match header.ordinal {
5826                    0x7150b7898d1b1180 => {
5827                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5828                        let mut req = fidl::new_empty!(
5829                            RealmOpenControllerRequest,
5830                            fidl::encoding::DefaultFuchsiaResourceDialect
5831                        );
5832                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmOpenControllerRequest>(&header, _body_bytes, handles, &mut req)?;
5833                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5834                        Ok(RealmRequest::OpenController {
5835                            child: req.child,
5836                            controller: req.controller,
5837
5838                            responder: RealmOpenControllerResponder {
5839                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5840                                tx_id: header.tx_id,
5841                            },
5842                        })
5843                    }
5844                    0x7f993235ca59f92c => {
5845                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5846                        let mut req = fidl::new_empty!(
5847                            RealmOpenExposedDirRequest,
5848                            fidl::encoding::DefaultFuchsiaResourceDialect
5849                        );
5850                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmOpenExposedDirRequest>(&header, _body_bytes, handles, &mut req)?;
5851                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5852                        Ok(RealmRequest::OpenExposedDir {
5853                            child: req.child,
5854                            exposed_dir: req.exposed_dir,
5855
5856                            responder: RealmOpenExposedDirResponder {
5857                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5858                                tx_id: header.tx_id,
5859                            },
5860                        })
5861                    }
5862                    0x43e48ce8483d7560 => {
5863                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5864                        let mut req = fidl::new_empty!(
5865                            RealmCreateChildRequest,
5866                            fidl::encoding::DefaultFuchsiaResourceDialect
5867                        );
5868                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmCreateChildRequest>(&header, _body_bytes, handles, &mut req)?;
5869                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5870                        Ok(RealmRequest::CreateChild {
5871                            collection: req.collection,
5872                            decl: req.decl,
5873                            args: req.args,
5874
5875                            responder: RealmCreateChildResponder {
5876                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5877                                tx_id: header.tx_id,
5878                            },
5879                        })
5880                    }
5881                    0x71d8caf8850c9222 => {
5882                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5883                        let mut req = fidl::new_empty!(
5884                            RealmDestroyChildRequest,
5885                            fidl::encoding::DefaultFuchsiaResourceDialect
5886                        );
5887                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmDestroyChildRequest>(&header, _body_bytes, handles, &mut req)?;
5888                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5889                        Ok(RealmRequest::DestroyChild {
5890                            child: req.child,
5891
5892                            responder: RealmDestroyChildResponder {
5893                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5894                                tx_id: header.tx_id,
5895                            },
5896                        })
5897                    }
5898                    0x6888a76683efc0a1 => {
5899                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5900                        let mut req = fidl::new_empty!(
5901                            RealmListChildrenRequest,
5902                            fidl::encoding::DefaultFuchsiaResourceDialect
5903                        );
5904                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmListChildrenRequest>(&header, _body_bytes, handles, &mut req)?;
5905                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5906                        Ok(RealmRequest::ListChildren {
5907                            collection: req.collection,
5908                            iter: req.iter,
5909
5910                            responder: RealmListChildrenResponder {
5911                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5912                                tx_id: header.tx_id,
5913                            },
5914                        })
5915                    }
5916                    0x734f744cb7d210a2 => {
5917                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5918                        let mut req = fidl::new_empty!(
5919                            fidl::encoding::EmptyPayload,
5920                            fidl::encoding::DefaultFuchsiaResourceDialect
5921                        );
5922                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
5923                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5924                        Ok(RealmRequest::GetResolvedInfo {
5925                            responder: RealmGetResolvedInfoResponder {
5926                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5927                                tx_id: header.tx_id,
5928                            },
5929                        })
5930                    }
5931                    0x39245b02aba94364 => {
5932                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5933                        let mut req = fidl::new_empty!(
5934                            RealmGetChildOutputDictionaryDeprecatedRequest,
5935                            fidl::encoding::DefaultFuchsiaResourceDialect
5936                        );
5937                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmGetChildOutputDictionaryDeprecatedRequest>(&header, _body_bytes, handles, &mut req)?;
5938                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5939                        Ok(RealmRequest::GetChildOutputDictionaryDeprecated {
5940                            child: req.child,
5941
5942                            responder: RealmGetChildOutputDictionaryDeprecatedResponder {
5943                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5944                                tx_id: header.tx_id,
5945                            },
5946                        })
5947                    }
5948                    0x4259d08d261d5610 => {
5949                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
5950                        let mut req = fidl::new_empty!(
5951                            RealmGetChildOutputDictionaryRequest,
5952                            fidl::encoding::DefaultFuchsiaResourceDialect
5953                        );
5954                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RealmGetChildOutputDictionaryRequest>(&header, _body_bytes, handles, &mut req)?;
5955                        let control_handle = RealmControlHandle { inner: this.inner.clone() };
5956                        Ok(RealmRequest::GetChildOutputDictionary {
5957                            child: req.child,
5958
5959                            responder: RealmGetChildOutputDictionaryResponder {
5960                                control_handle: std::mem::ManuallyDrop::new(control_handle),
5961                                tx_id: header.tx_id,
5962                            },
5963                        })
5964                    }
5965                    _ => Err(fidl::Error::UnknownOrdinal {
5966                        ordinal: header.ordinal,
5967                        protocol_name: <RealmMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
5968                    }),
5969                }))
5970            },
5971        )
5972    }
5973}
5974
5975/// A protocol used by a component instance to manage its own realm, such as for
5976/// binding to its children.
5977///
5978/// Requests to this protocol are processed in the order they are received.
5979/// Clients that wish to send requests in parallel should open multiple
5980/// connections.
5981///
5982/// The component framework provides this service to components that use
5983/// `fuchsia.component.Realm`.
5984#[derive(Debug)]
5985pub enum RealmRequest {
5986    /// Operate on a child component. See documentation for [`Controller`].
5987    ///
5988    /// Errors:
5989    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
5990    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
5991    /// - `INSTANCE_DIED`: This realm no longer exists.
5992    OpenController {
5993        child: fidl_fuchsia_component_decl::ChildRef,
5994        controller: fidl::endpoints::ServerEnd<ControllerMarker>,
5995        responder: RealmOpenControllerResponder,
5996    },
5997    /// Opens the exposed directory of a child component. When this function
5998    /// successfully returns, `exposed_dir` is bound to a directory that
5999    /// contains the capabilities which the child exposed to its realm via
6000    /// `ComponentDecl.exposes` (specified via "expose" declarations in the
6001    /// component's manifest). The child component will not start as a result of
6002    /// this call.
6003    ///
6004    /// `exposed_dir` is open as long as `child` exists.
6005    ///
6006    /// Errors:
6007    /// - `INVALID_ARGUMENTS`: `child` is not a valid child reference.
6008    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
6009    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve.
6010    /// - `INSTANCE_DIED`: This realm no longer exists.
6011    OpenExposedDir {
6012        child: fidl_fuchsia_component_decl::ChildRef,
6013        exposed_dir: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
6014        responder: RealmOpenExposedDirResponder,
6015    },
6016    /// Creates a child component instance dynamically. When this function
6017    /// returns successfully, the instance exists, but it may not be running.
6018    ///
6019    /// The environment of the child instance is determined by the environment
6020    /// of the collection. `decl` must not set `environment`.
6021    ///
6022    /// If `decl.startup == EAGER`, or `collection.durability == SINGLE_RUN`,
6023    /// [CreateChild] will start the component and return once the component is
6024    /// started. Otherwise, [CreateChild] will return immediately after creating
6025    /// the component and will not start or resolve it.
6026    ///
6027    /// Errors:
6028    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `child`
6029    ///   is not a valid declaration.
6030    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
6031    /// - `INSTANCE_ALREADY_EXISTS`: `decl.name` already exists in `collection`.
6032    /// - `INSTANCE_CANNOT_RESOLVE`: `child`'s component declaration failed to resolve
6033    ///   in a `SingleRun` collection.
6034    /// - `NO_SPACE`: Could not allocate storage for the new instance.
6035    /// - `INSTANCE_DIED`: This realm no longer exists.
6036    CreateChild {
6037        collection: fidl_fuchsia_component_decl::CollectionRef,
6038        decl: fidl_fuchsia_component_decl::Child,
6039        args: CreateChildArgs,
6040        responder: RealmCreateChildResponder,
6041    },
6042    /// Destroys a dynamically-created component instance. When this function
6043    /// returns, the instance is destroyed and has stopped running.  However,
6044    /// cleanup of the component's resources (such as its isolated storage) may
6045    /// happen in the background after this function returns.
6046    ///
6047    /// Errors:
6048    /// - `INVALID_ARGUMENTS`: `child` is not a valid reference or does not refer
6049    ///   to a dynamic instance.
6050    /// - `INSTANCE_NOT_FOUND`: `child` does not exist.
6051    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
6052    /// - `INSTANCE_DIED`: This realm no longer exists.
6053    DestroyChild {
6054        child: fidl_fuchsia_component_decl::ChildRef,
6055        responder: RealmDestroyChildResponder,
6056    },
6057    /// Returns an iterator that lists all instances in a collection.
6058    ///
6059    /// NOTE: The results are not guaranteed to be consistent. Instances may be
6060    /// created or destroyed while the iterator is live, but those changes
6061    /// won't be observed by the iterator after this method returns.
6062    ///
6063    /// Errors:
6064    /// - `INVALID_ARGUMENTS`: `collection` is not a valid reference or `iter`
6065    /// does not have `ZX_RIGHT_WAIT`.
6066    /// - `COLLECTION_NOT_FOUND`: `collection` does not exist.
6067    /// - `INSTANCE_DIED`: This realm no longer exists.
6068    /// - If `iter` does not have standard channel rights, this function may
6069    ///   return `ACCESS_DENIED` or component manager may close `iter`.
6070    ListChildren {
6071        collection: fidl_fuchsia_component_decl::CollectionRef,
6072        iter: fidl::endpoints::ServerEnd<ChildIteratorMarker>,
6073        responder: RealmListChildrenResponder,
6074    },
6075    /// Returns the set of information that was given to the component framework
6076    /// by this component's resolver.
6077    GetResolvedInfo { responder: RealmGetResolvedInfoResponder },
6078    GetChildOutputDictionaryDeprecated {
6079        child: fidl_fuchsia_component_decl::ChildRef,
6080        responder: RealmGetChildOutputDictionaryDeprecatedResponder,
6081    },
6082    /// Returns a reference to a child's output dictionary, which may be
6083    /// interacted with by using the fuchsia.component.runtime.Capabilities API.
6084    GetChildOutputDictionary {
6085        child: fidl_fuchsia_component_decl::ChildRef,
6086        responder: RealmGetChildOutputDictionaryResponder,
6087    },
6088}
6089
6090impl RealmRequest {
6091    #[allow(irrefutable_let_patterns)]
6092    pub fn into_open_controller(
6093        self,
6094    ) -> Option<(
6095        fidl_fuchsia_component_decl::ChildRef,
6096        fidl::endpoints::ServerEnd<ControllerMarker>,
6097        RealmOpenControllerResponder,
6098    )> {
6099        if let RealmRequest::OpenController { child, controller, responder } = self {
6100            Some((child, controller, responder))
6101        } else {
6102            None
6103        }
6104    }
6105
6106    #[allow(irrefutable_let_patterns)]
6107    pub fn into_open_exposed_dir(
6108        self,
6109    ) -> Option<(
6110        fidl_fuchsia_component_decl::ChildRef,
6111        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
6112        RealmOpenExposedDirResponder,
6113    )> {
6114        if let RealmRequest::OpenExposedDir { child, exposed_dir, responder } = self {
6115            Some((child, exposed_dir, responder))
6116        } else {
6117            None
6118        }
6119    }
6120
6121    #[allow(irrefutable_let_patterns)]
6122    pub fn into_create_child(
6123        self,
6124    ) -> Option<(
6125        fidl_fuchsia_component_decl::CollectionRef,
6126        fidl_fuchsia_component_decl::Child,
6127        CreateChildArgs,
6128        RealmCreateChildResponder,
6129    )> {
6130        if let RealmRequest::CreateChild { collection, decl, args, responder } = self {
6131            Some((collection, decl, args, responder))
6132        } else {
6133            None
6134        }
6135    }
6136
6137    #[allow(irrefutable_let_patterns)]
6138    pub fn into_destroy_child(
6139        self,
6140    ) -> Option<(fidl_fuchsia_component_decl::ChildRef, RealmDestroyChildResponder)> {
6141        if let RealmRequest::DestroyChild { child, responder } = self {
6142            Some((child, responder))
6143        } else {
6144            None
6145        }
6146    }
6147
6148    #[allow(irrefutable_let_patterns)]
6149    pub fn into_list_children(
6150        self,
6151    ) -> Option<(
6152        fidl_fuchsia_component_decl::CollectionRef,
6153        fidl::endpoints::ServerEnd<ChildIteratorMarker>,
6154        RealmListChildrenResponder,
6155    )> {
6156        if let RealmRequest::ListChildren { collection, iter, responder } = self {
6157            Some((collection, iter, responder))
6158        } else {
6159            None
6160        }
6161    }
6162
6163    #[allow(irrefutable_let_patterns)]
6164    pub fn into_get_resolved_info(self) -> Option<(RealmGetResolvedInfoResponder)> {
6165        if let RealmRequest::GetResolvedInfo { responder } = self {
6166            Some((responder))
6167        } else {
6168            None
6169        }
6170    }
6171
6172    #[allow(irrefutable_let_patterns)]
6173    pub fn into_get_child_output_dictionary_deprecated(
6174        self,
6175    ) -> Option<(
6176        fidl_fuchsia_component_decl::ChildRef,
6177        RealmGetChildOutputDictionaryDeprecatedResponder,
6178    )> {
6179        if let RealmRequest::GetChildOutputDictionaryDeprecated { child, responder } = self {
6180            Some((child, responder))
6181        } else {
6182            None
6183        }
6184    }
6185
6186    #[allow(irrefutable_let_patterns)]
6187    pub fn into_get_child_output_dictionary(
6188        self,
6189    ) -> Option<(fidl_fuchsia_component_decl::ChildRef, RealmGetChildOutputDictionaryResponder)>
6190    {
6191        if let RealmRequest::GetChildOutputDictionary { child, responder } = self {
6192            Some((child, responder))
6193        } else {
6194            None
6195        }
6196    }
6197
6198    /// Name of the method defined in FIDL
6199    pub fn method_name(&self) -> &'static str {
6200        match *self {
6201            RealmRequest::OpenController { .. } => "open_controller",
6202            RealmRequest::OpenExposedDir { .. } => "open_exposed_dir",
6203            RealmRequest::CreateChild { .. } => "create_child",
6204            RealmRequest::DestroyChild { .. } => "destroy_child",
6205            RealmRequest::ListChildren { .. } => "list_children",
6206            RealmRequest::GetResolvedInfo { .. } => "get_resolved_info",
6207            RealmRequest::GetChildOutputDictionaryDeprecated { .. } => {
6208                "get_child_output_dictionary_deprecated"
6209            }
6210            RealmRequest::GetChildOutputDictionary { .. } => "get_child_output_dictionary",
6211        }
6212    }
6213}
6214
6215#[derive(Debug, Clone)]
6216pub struct RealmControlHandle {
6217    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6218}
6219
6220impl RealmControlHandle {
6221    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
6222        self.inner.shutdown_with_epitaph(status.into())
6223    }
6224}
6225
6226impl fidl::endpoints::ControlHandle for RealmControlHandle {
6227    fn shutdown(&self) {
6228        self.inner.shutdown()
6229    }
6230
6231    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
6232        self.inner.shutdown_with_epitaph(status)
6233    }
6234
6235    fn is_closed(&self) -> bool {
6236        self.inner.channel().is_closed()
6237    }
6238    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6239        self.inner.channel().on_closed()
6240    }
6241
6242    #[cfg(target_os = "fuchsia")]
6243    fn signal_peer(
6244        &self,
6245        clear_mask: zx::Signals,
6246        set_mask: zx::Signals,
6247    ) -> Result<(), zx_status::Status> {
6248        use fidl::Peered;
6249        self.inner.channel().signal_peer(clear_mask, set_mask)
6250    }
6251}
6252
6253impl RealmControlHandle {}
6254
6255#[must_use = "FIDL methods require a response to be sent"]
6256#[derive(Debug)]
6257pub struct RealmOpenControllerResponder {
6258    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6259    tx_id: u32,
6260}
6261
6262/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6263/// if the responder is dropped without sending a response, so that the client
6264/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6265impl std::ops::Drop for RealmOpenControllerResponder {
6266    fn drop(&mut self) {
6267        self.control_handle.shutdown();
6268        // Safety: drops once, never accessed again
6269        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6270    }
6271}
6272
6273impl fidl::endpoints::Responder for RealmOpenControllerResponder {
6274    type ControlHandle = RealmControlHandle;
6275
6276    fn control_handle(&self) -> &RealmControlHandle {
6277        &self.control_handle
6278    }
6279
6280    fn drop_without_shutdown(mut self) {
6281        // Safety: drops once, never accessed again due to mem::forget
6282        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6283        // Prevent Drop from running (which would shut down the channel)
6284        std::mem::forget(self);
6285    }
6286}
6287
6288impl RealmOpenControllerResponder {
6289    /// Sends a response to the FIDL transaction.
6290    ///
6291    /// Sets the channel to shutdown if an error occurs.
6292    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6293        let _result = self.send_raw(result);
6294        if _result.is_err() {
6295            self.control_handle.shutdown();
6296        }
6297        self.drop_without_shutdown();
6298        _result
6299    }
6300
6301    /// Similar to "send" but does not shutdown the channel if an error occurs.
6302    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6303        let _result = self.send_raw(result);
6304        self.drop_without_shutdown();
6305        _result
6306    }
6307
6308    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6309        self.control_handle
6310            .inner
6311            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6312                result,
6313                self.tx_id,
6314                0x7150b7898d1b1180,
6315                fidl::encoding::DynamicFlags::empty(),
6316            )
6317    }
6318}
6319
6320#[must_use = "FIDL methods require a response to be sent"]
6321#[derive(Debug)]
6322pub struct RealmOpenExposedDirResponder {
6323    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6324    tx_id: u32,
6325}
6326
6327/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6328/// if the responder is dropped without sending a response, so that the client
6329/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6330impl std::ops::Drop for RealmOpenExposedDirResponder {
6331    fn drop(&mut self) {
6332        self.control_handle.shutdown();
6333        // Safety: drops once, never accessed again
6334        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6335    }
6336}
6337
6338impl fidl::endpoints::Responder for RealmOpenExposedDirResponder {
6339    type ControlHandle = RealmControlHandle;
6340
6341    fn control_handle(&self) -> &RealmControlHandle {
6342        &self.control_handle
6343    }
6344
6345    fn drop_without_shutdown(mut self) {
6346        // Safety: drops once, never accessed again due to mem::forget
6347        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6348        // Prevent Drop from running (which would shut down the channel)
6349        std::mem::forget(self);
6350    }
6351}
6352
6353impl RealmOpenExposedDirResponder {
6354    /// Sends a response to the FIDL transaction.
6355    ///
6356    /// Sets the channel to shutdown if an error occurs.
6357    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6358        let _result = self.send_raw(result);
6359        if _result.is_err() {
6360            self.control_handle.shutdown();
6361        }
6362        self.drop_without_shutdown();
6363        _result
6364    }
6365
6366    /// Similar to "send" but does not shutdown the channel if an error occurs.
6367    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6368        let _result = self.send_raw(result);
6369        self.drop_without_shutdown();
6370        _result
6371    }
6372
6373    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6374        self.control_handle
6375            .inner
6376            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6377                result,
6378                self.tx_id,
6379                0x7f993235ca59f92c,
6380                fidl::encoding::DynamicFlags::empty(),
6381            )
6382    }
6383}
6384
6385#[must_use = "FIDL methods require a response to be sent"]
6386#[derive(Debug)]
6387pub struct RealmCreateChildResponder {
6388    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6389    tx_id: u32,
6390}
6391
6392/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6393/// if the responder is dropped without sending a response, so that the client
6394/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6395impl std::ops::Drop for RealmCreateChildResponder {
6396    fn drop(&mut self) {
6397        self.control_handle.shutdown();
6398        // Safety: drops once, never accessed again
6399        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6400    }
6401}
6402
6403impl fidl::endpoints::Responder for RealmCreateChildResponder {
6404    type ControlHandle = RealmControlHandle;
6405
6406    fn control_handle(&self) -> &RealmControlHandle {
6407        &self.control_handle
6408    }
6409
6410    fn drop_without_shutdown(mut self) {
6411        // Safety: drops once, never accessed again due to mem::forget
6412        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6413        // Prevent Drop from running (which would shut down the channel)
6414        std::mem::forget(self);
6415    }
6416}
6417
6418impl RealmCreateChildResponder {
6419    /// Sends a response to the FIDL transaction.
6420    ///
6421    /// Sets the channel to shutdown if an error occurs.
6422    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6423        let _result = self.send_raw(result);
6424        if _result.is_err() {
6425            self.control_handle.shutdown();
6426        }
6427        self.drop_without_shutdown();
6428        _result
6429    }
6430
6431    /// Similar to "send" but does not shutdown the channel if an error occurs.
6432    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6433        let _result = self.send_raw(result);
6434        self.drop_without_shutdown();
6435        _result
6436    }
6437
6438    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6439        self.control_handle
6440            .inner
6441            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6442                result,
6443                self.tx_id,
6444                0x43e48ce8483d7560,
6445                fidl::encoding::DynamicFlags::empty(),
6446            )
6447    }
6448}
6449
6450#[must_use = "FIDL methods require a response to be sent"]
6451#[derive(Debug)]
6452pub struct RealmDestroyChildResponder {
6453    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6454    tx_id: u32,
6455}
6456
6457/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6458/// if the responder is dropped without sending a response, so that the client
6459/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6460impl std::ops::Drop for RealmDestroyChildResponder {
6461    fn drop(&mut self) {
6462        self.control_handle.shutdown();
6463        // Safety: drops once, never accessed again
6464        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6465    }
6466}
6467
6468impl fidl::endpoints::Responder for RealmDestroyChildResponder {
6469    type ControlHandle = RealmControlHandle;
6470
6471    fn control_handle(&self) -> &RealmControlHandle {
6472        &self.control_handle
6473    }
6474
6475    fn drop_without_shutdown(mut self) {
6476        // Safety: drops once, never accessed again due to mem::forget
6477        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6478        // Prevent Drop from running (which would shut down the channel)
6479        std::mem::forget(self);
6480    }
6481}
6482
6483impl RealmDestroyChildResponder {
6484    /// Sends a response to the FIDL transaction.
6485    ///
6486    /// Sets the channel to shutdown if an error occurs.
6487    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6488        let _result = self.send_raw(result);
6489        if _result.is_err() {
6490            self.control_handle.shutdown();
6491        }
6492        self.drop_without_shutdown();
6493        _result
6494    }
6495
6496    /// Similar to "send" but does not shutdown the channel if an error occurs.
6497    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6498        let _result = self.send_raw(result);
6499        self.drop_without_shutdown();
6500        _result
6501    }
6502
6503    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6504        self.control_handle
6505            .inner
6506            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6507                result,
6508                self.tx_id,
6509                0x71d8caf8850c9222,
6510                fidl::encoding::DynamicFlags::empty(),
6511            )
6512    }
6513}
6514
6515#[must_use = "FIDL methods require a response to be sent"]
6516#[derive(Debug)]
6517pub struct RealmListChildrenResponder {
6518    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6519    tx_id: u32,
6520}
6521
6522/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6523/// if the responder is dropped without sending a response, so that the client
6524/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6525impl std::ops::Drop for RealmListChildrenResponder {
6526    fn drop(&mut self) {
6527        self.control_handle.shutdown();
6528        // Safety: drops once, never accessed again
6529        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6530    }
6531}
6532
6533impl fidl::endpoints::Responder for RealmListChildrenResponder {
6534    type ControlHandle = RealmControlHandle;
6535
6536    fn control_handle(&self) -> &RealmControlHandle {
6537        &self.control_handle
6538    }
6539
6540    fn drop_without_shutdown(mut self) {
6541        // Safety: drops once, never accessed again due to mem::forget
6542        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6543        // Prevent Drop from running (which would shut down the channel)
6544        std::mem::forget(self);
6545    }
6546}
6547
6548impl RealmListChildrenResponder {
6549    /// Sends a response to the FIDL transaction.
6550    ///
6551    /// Sets the channel to shutdown if an error occurs.
6552    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6553        let _result = self.send_raw(result);
6554        if _result.is_err() {
6555            self.control_handle.shutdown();
6556        }
6557        self.drop_without_shutdown();
6558        _result
6559    }
6560
6561    /// Similar to "send" but does not shutdown the channel if an error occurs.
6562    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6563        let _result = self.send_raw(result);
6564        self.drop_without_shutdown();
6565        _result
6566    }
6567
6568    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
6569        self.control_handle
6570            .inner
6571            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
6572                result,
6573                self.tx_id,
6574                0x6888a76683efc0a1,
6575                fidl::encoding::DynamicFlags::empty(),
6576            )
6577    }
6578}
6579
6580#[must_use = "FIDL methods require a response to be sent"]
6581#[derive(Debug)]
6582pub struct RealmGetResolvedInfoResponder {
6583    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6584    tx_id: u32,
6585}
6586
6587/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6588/// if the responder is dropped without sending a response, so that the client
6589/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6590impl std::ops::Drop for RealmGetResolvedInfoResponder {
6591    fn drop(&mut self) {
6592        self.control_handle.shutdown();
6593        // Safety: drops once, never accessed again
6594        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6595    }
6596}
6597
6598impl fidl::endpoints::Responder for RealmGetResolvedInfoResponder {
6599    type ControlHandle = RealmControlHandle;
6600
6601    fn control_handle(&self) -> &RealmControlHandle {
6602        &self.control_handle
6603    }
6604
6605    fn drop_without_shutdown(mut self) {
6606        // Safety: drops once, never accessed again due to mem::forget
6607        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6608        // Prevent Drop from running (which would shut down the channel)
6609        std::mem::forget(self);
6610    }
6611}
6612
6613impl RealmGetResolvedInfoResponder {
6614    /// Sends a response to the FIDL transaction.
6615    ///
6616    /// Sets the channel to shutdown if an error occurs.
6617    pub fn send(
6618        self,
6619        mut result: Result<fidl_fuchsia_component_resolution::Component, Error>,
6620    ) -> Result<(), fidl::Error> {
6621        let _result = self.send_raw(result);
6622        if _result.is_err() {
6623            self.control_handle.shutdown();
6624        }
6625        self.drop_without_shutdown();
6626        _result
6627    }
6628
6629    /// Similar to "send" but does not shutdown the channel if an error occurs.
6630    pub fn send_no_shutdown_on_err(
6631        self,
6632        mut result: Result<fidl_fuchsia_component_resolution::Component, Error>,
6633    ) -> Result<(), fidl::Error> {
6634        let _result = self.send_raw(result);
6635        self.drop_without_shutdown();
6636        _result
6637    }
6638
6639    fn send_raw(
6640        &self,
6641        mut result: Result<fidl_fuchsia_component_resolution::Component, Error>,
6642    ) -> Result<(), fidl::Error> {
6643        self.control_handle
6644            .inner
6645            .send::<fidl::encoding::ResultType<RealmGetResolvedInfoResponse, Error>>(
6646                result.as_mut().map_err(|e| *e).map(|resolved_info| (resolved_info,)),
6647                self.tx_id,
6648                0x734f744cb7d210a2,
6649                fidl::encoding::DynamicFlags::empty(),
6650            )
6651    }
6652}
6653
6654#[must_use = "FIDL methods require a response to be sent"]
6655#[derive(Debug)]
6656pub struct RealmGetChildOutputDictionaryDeprecatedResponder {
6657    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6658    tx_id: u32,
6659}
6660
6661/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6662/// if the responder is dropped without sending a response, so that the client
6663/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6664impl std::ops::Drop for RealmGetChildOutputDictionaryDeprecatedResponder {
6665    fn drop(&mut self) {
6666        self.control_handle.shutdown();
6667        // Safety: drops once, never accessed again
6668        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6669    }
6670}
6671
6672impl fidl::endpoints::Responder for RealmGetChildOutputDictionaryDeprecatedResponder {
6673    type ControlHandle = RealmControlHandle;
6674
6675    fn control_handle(&self) -> &RealmControlHandle {
6676        &self.control_handle
6677    }
6678
6679    fn drop_without_shutdown(mut self) {
6680        // Safety: drops once, never accessed again due to mem::forget
6681        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6682        // Prevent Drop from running (which would shut down the channel)
6683        std::mem::forget(self);
6684    }
6685}
6686
6687impl RealmGetChildOutputDictionaryDeprecatedResponder {
6688    /// Sends a response to the FIDL transaction.
6689    ///
6690    /// Sets the channel to shutdown if an error occurs.
6691    pub fn send(
6692        self,
6693        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
6694    ) -> Result<(), fidl::Error> {
6695        let _result = self.send_raw(result);
6696        if _result.is_err() {
6697            self.control_handle.shutdown();
6698        }
6699        self.drop_without_shutdown();
6700        _result
6701    }
6702
6703    /// Similar to "send" but does not shutdown the channel if an error occurs.
6704    pub fn send_no_shutdown_on_err(
6705        self,
6706        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
6707    ) -> Result<(), fidl::Error> {
6708        let _result = self.send_raw(result);
6709        self.drop_without_shutdown();
6710        _result
6711    }
6712
6713    fn send_raw(
6714        &self,
6715        mut result: Result<fidl_fuchsia_component_sandbox::DictionaryRef, Error>,
6716    ) -> Result<(), fidl::Error> {
6717        self.control_handle.inner.send::<fidl::encoding::ResultType<
6718            RealmGetChildOutputDictionaryDeprecatedResponse,
6719            Error,
6720        >>(
6721            result.as_mut().map_err(|e| *e).map(|dictionary| (dictionary,)),
6722            self.tx_id,
6723            0x39245b02aba94364,
6724            fidl::encoding::DynamicFlags::empty(),
6725        )
6726    }
6727}
6728
6729#[must_use = "FIDL methods require a response to be sent"]
6730#[derive(Debug)]
6731pub struct RealmGetChildOutputDictionaryResponder {
6732    control_handle: std::mem::ManuallyDrop<RealmControlHandle>,
6733    tx_id: u32,
6734}
6735
6736/// Set the the channel to be shutdown (see [`RealmControlHandle::shutdown`])
6737/// if the responder is dropped without sending a response, so that the client
6738/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
6739impl std::ops::Drop for RealmGetChildOutputDictionaryResponder {
6740    fn drop(&mut self) {
6741        self.control_handle.shutdown();
6742        // Safety: drops once, never accessed again
6743        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6744    }
6745}
6746
6747impl fidl::endpoints::Responder for RealmGetChildOutputDictionaryResponder {
6748    type ControlHandle = RealmControlHandle;
6749
6750    fn control_handle(&self) -> &RealmControlHandle {
6751        &self.control_handle
6752    }
6753
6754    fn drop_without_shutdown(mut self) {
6755        // Safety: drops once, never accessed again due to mem::forget
6756        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6757        // Prevent Drop from running (which would shut down the channel)
6758        std::mem::forget(self);
6759    }
6760}
6761
6762impl RealmGetChildOutputDictionaryResponder {
6763    /// Sends a response to the FIDL transaction.
6764    ///
6765    /// Sets the channel to shutdown if an error occurs.
6766    pub fn send(self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
6767        let _result = self.send_raw(result);
6768        if _result.is_err() {
6769            self.control_handle.shutdown();
6770        }
6771        self.drop_without_shutdown();
6772        _result
6773    }
6774
6775    /// Similar to "send" but does not shutdown the channel if an error occurs.
6776    pub fn send_no_shutdown_on_err(
6777        self,
6778        mut result: Result<fidl::EventPair, Error>,
6779    ) -> Result<(), fidl::Error> {
6780        let _result = self.send_raw(result);
6781        self.drop_without_shutdown();
6782        _result
6783    }
6784
6785    fn send_raw(&self, mut result: Result<fidl::EventPair, Error>) -> Result<(), fidl::Error> {
6786        self.control_handle.inner.send::<fidl::encoding::ResultType<
6787            RealmGetChildOutputDictionaryResponse,
6788            Error,
6789        >>(
6790            result.map(|dictionary| (dictionary,)),
6791            self.tx_id,
6792            0x4259d08d261d5610,
6793            fidl::encoding::DynamicFlags::empty(),
6794        )
6795    }
6796}
6797
6798#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6799pub struct StorageAdminMarker;
6800
6801impl fidl::endpoints::ProtocolMarker for StorageAdminMarker {
6802    type Proxy = StorageAdminProxy;
6803    type RequestStream = StorageAdminRequestStream;
6804    #[cfg(target_os = "fuchsia")]
6805    type SynchronousProxy = StorageAdminSynchronousProxy;
6806
6807    const DEBUG_NAME: &'static str = "fuchsia.component.StorageAdmin";
6808}
6809impl fidl::endpoints::DiscoverableProtocolMarker for StorageAdminMarker {}
6810pub type StorageAdminOpenStorageResult = Result<(), Error>;
6811pub type StorageAdminListStorageInRealmResult = Result<(), Error>;
6812pub type StorageAdminOpenComponentStorageByIdResult = Result<(), Error>;
6813pub type StorageAdminDeleteComponentStorageResult = Result<(), Error>;
6814pub type StorageAdminGetStatusResult = Result<StorageStatus, StatusError>;
6815pub type StorageAdminDeleteAllStorageContentsResult = Result<(), DeletionError>;
6816
6817pub trait StorageAdminProxyInterface: Send + Sync {
6818    type OpenStorageResponseFut: std::future::Future<Output = Result<StorageAdminOpenStorageResult, fidl::Error>>
6819        + Send;
6820    fn r#open_storage(
6821        &self,
6822        relative_moniker: &str,
6823        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6824    ) -> Self::OpenStorageResponseFut;
6825    type ListStorageInRealmResponseFut: std::future::Future<Output = Result<StorageAdminListStorageInRealmResult, fidl::Error>>
6826        + Send;
6827    fn r#list_storage_in_realm(
6828        &self,
6829        relative_moniker: &str,
6830        iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
6831    ) -> Self::ListStorageInRealmResponseFut;
6832    type OpenComponentStorageByIdResponseFut: std::future::Future<
6833            Output = Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error>,
6834        > + Send;
6835    fn r#open_component_storage_by_id(
6836        &self,
6837        id: &str,
6838        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6839    ) -> Self::OpenComponentStorageByIdResponseFut;
6840    type DeleteComponentStorageResponseFut: std::future::Future<Output = Result<StorageAdminDeleteComponentStorageResult, fidl::Error>>
6841        + Send;
6842    fn r#delete_component_storage(
6843        &self,
6844        relative_moniker: &str,
6845    ) -> Self::DeleteComponentStorageResponseFut;
6846    type GetStatusResponseFut: std::future::Future<Output = Result<StorageAdminGetStatusResult, fidl::Error>>
6847        + Send;
6848    fn r#get_status(&self) -> Self::GetStatusResponseFut;
6849    type DeleteAllStorageContentsResponseFut: std::future::Future<
6850            Output = Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error>,
6851        > + Send;
6852    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut;
6853}
6854#[derive(Debug)]
6855#[cfg(target_os = "fuchsia")]
6856pub struct StorageAdminSynchronousProxy {
6857    client: fidl::client::sync::Client,
6858}
6859
6860#[cfg(target_os = "fuchsia")]
6861impl fidl::endpoints::SynchronousProxy for StorageAdminSynchronousProxy {
6862    type Proxy = StorageAdminProxy;
6863    type Protocol = StorageAdminMarker;
6864
6865    fn from_channel(inner: fidl::Channel) -> Self {
6866        Self::new(inner)
6867    }
6868
6869    fn into_channel(self) -> fidl::Channel {
6870        self.client.into_channel()
6871    }
6872
6873    fn as_channel(&self) -> &fidl::Channel {
6874        self.client.as_channel()
6875    }
6876}
6877
6878#[cfg(target_os = "fuchsia")]
6879impl StorageAdminSynchronousProxy {
6880    pub fn new(channel: fidl::Channel) -> Self {
6881        Self { client: fidl::client::sync::Client::new(channel) }
6882    }
6883
6884    pub fn into_channel(self) -> fidl::Channel {
6885        self.client.into_channel()
6886    }
6887
6888    /// Waits until an event arrives and returns it. It is safe for other
6889    /// threads to make concurrent requests while waiting for an event.
6890    pub fn wait_for_event(
6891        &self,
6892        deadline: zx::MonotonicInstant,
6893    ) -> Result<StorageAdminEvent, fidl::Error> {
6894        StorageAdminEvent::decode(self.client.wait_for_event::<StorageAdminMarker>(deadline)?)
6895    }
6896
6897    /// Opens the isolated directory for the given component. The provided
6898    /// moniker is relative to the component that declares the storage
6899    /// capability. Creates the backing sub-directory for this storage if it
6900    /// hasn't yet been created.
6901    pub fn r#open_storage(
6902        &self,
6903        mut relative_moniker: &str,
6904        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6905        ___deadline: zx::MonotonicInstant,
6906    ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
6907        let _response = self.client.send_query::<
6908            StorageAdminOpenStorageRequest,
6909            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6910            StorageAdminMarker,
6911        >(
6912            (relative_moniker, object,),
6913            0x6ceaa5904cfe4377,
6914            fidl::encoding::DynamicFlags::empty(),
6915            ___deadline,
6916        )?;
6917        Ok(_response.map(|x| x))
6918    }
6919
6920    /// Lists the descendant components under the specified realm that use the
6921    /// storage capability. The provided moniker is relative to the component
6922    /// that declares the storage capability.
6923    ///
6924    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
6925    /// if |relative_moniker| is malformed.
6926    pub fn r#list_storage_in_realm(
6927        &self,
6928        mut relative_moniker: &str,
6929        mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
6930        ___deadline: zx::MonotonicInstant,
6931    ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
6932        let _response = self.client.send_query::<
6933            StorageAdminListStorageInRealmRequest,
6934            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6935            StorageAdminMarker,
6936        >(
6937            (relative_moniker, iterator,),
6938            0x764f6d1f083e8bfb,
6939            fidl::encoding::DynamicFlags::empty(),
6940            ___deadline,
6941        )?;
6942        Ok(_response.map(|x| x))
6943    }
6944
6945    /// Opens the isolated directory for the given storage ID. Creates the
6946    /// backing sub-directory for this storage if it hasn't yet been created.
6947    pub fn r#open_component_storage_by_id(
6948        &self,
6949        mut id: &str,
6950        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
6951        ___deadline: zx::MonotonicInstant,
6952    ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
6953        let _response = self.client.send_query::<
6954            StorageAdminOpenComponentStorageByIdRequest,
6955            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6956            StorageAdminMarker,
6957        >(
6958            (id, object,),
6959            0x4802102cc55d5df1,
6960            fidl::encoding::DynamicFlags::empty(),
6961            ___deadline,
6962        )?;
6963        Ok(_response.map(|x| x))
6964    }
6965
6966    /// Deletes the contents of the storage for this component. Preserves the
6967    /// component's subdirectory itself within the storage backing directory.
6968    /// The provided moniker is relative to the component that declares the
6969    /// storage capability.
6970    pub fn r#delete_component_storage(
6971        &self,
6972        mut relative_moniker: &str,
6973        ___deadline: zx::MonotonicInstant,
6974    ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
6975        let _response = self.client.send_query::<
6976            StorageAdminDeleteComponentStorageRequest,
6977            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
6978            StorageAdminMarker,
6979        >(
6980            (relative_moniker,),
6981            0x1677c1cdfcdbf45a,
6982            fidl::encoding::DynamicFlags::empty(),
6983            ___deadline,
6984        )?;
6985        Ok(_response.map(|x| x))
6986    }
6987
6988    /// Get the current status of the storage.
6989    pub fn r#get_status(
6990        &self,
6991        ___deadline: zx::MonotonicInstant,
6992    ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
6993        let _response = self.client.send_query::<
6994            fidl::encoding::EmptyPayload,
6995            fidl::encoding::ResultType<StorageStatus, StatusError>,
6996            StorageAdminMarker,
6997        >(
6998            (),
6999            0x7729e325a6c526c8,
7000            fidl::encoding::DynamicFlags::empty(),
7001            ___deadline,
7002        )?;
7003        Ok(_response.map(|x| x))
7004    }
7005
7006    /// Deletes the contents of all the storage. Storage directories are
7007    /// retained so any components using storage will be able to continue using
7008    /// it to create new files and directories.
7009    ///
7010    /// Returns Error::INTERNAL only if no storage at all could be cleared.
7011    /// Returns successfully even if some errors happen during the deletion
7012    /// progress.
7013    pub fn r#delete_all_storage_contents(
7014        &self,
7015        ___deadline: zx::MonotonicInstant,
7016    ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
7017        let _response = self.client.send_query::<
7018            fidl::encoding::EmptyPayload,
7019            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
7020            StorageAdminMarker,
7021        >(
7022            (),
7023            0x2ee980b4b2d24adb,
7024            fidl::encoding::DynamicFlags::empty(),
7025            ___deadline,
7026        )?;
7027        Ok(_response.map(|x| x))
7028    }
7029}
7030
7031#[cfg(target_os = "fuchsia")]
7032impl From<StorageAdminSynchronousProxy> for zx::NullableHandle {
7033    fn from(value: StorageAdminSynchronousProxy) -> Self {
7034        value.into_channel().into()
7035    }
7036}
7037
7038#[cfg(target_os = "fuchsia")]
7039impl From<fidl::Channel> for StorageAdminSynchronousProxy {
7040    fn from(value: fidl::Channel) -> Self {
7041        Self::new(value)
7042    }
7043}
7044
7045#[cfg(target_os = "fuchsia")]
7046impl fidl::endpoints::FromClient for StorageAdminSynchronousProxy {
7047    type Protocol = StorageAdminMarker;
7048
7049    fn from_client(value: fidl::endpoints::ClientEnd<StorageAdminMarker>) -> Self {
7050        Self::new(value.into_channel())
7051    }
7052}
7053
7054#[derive(Debug, Clone)]
7055pub struct StorageAdminProxy {
7056    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7057}
7058
7059impl fidl::endpoints::Proxy for StorageAdminProxy {
7060    type Protocol = StorageAdminMarker;
7061
7062    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7063        Self::new(inner)
7064    }
7065
7066    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7067        self.client.into_channel().map_err(|client| Self { client })
7068    }
7069
7070    fn as_channel(&self) -> &::fidl::AsyncChannel {
7071        self.client.as_channel()
7072    }
7073}
7074
7075impl StorageAdminProxy {
7076    /// Create a new Proxy for fuchsia.component/StorageAdmin.
7077    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7078        let protocol_name = <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7079        Self { client: fidl::client::Client::new(channel, protocol_name) }
7080    }
7081
7082    /// Get a Stream of events from the remote end of the protocol.
7083    ///
7084    /// # Panics
7085    ///
7086    /// Panics if the event stream was already taken.
7087    pub fn take_event_stream(&self) -> StorageAdminEventStream {
7088        StorageAdminEventStream { event_receiver: self.client.take_event_receiver() }
7089    }
7090
7091    /// Opens the isolated directory for the given component. The provided
7092    /// moniker is relative to the component that declares the storage
7093    /// capability. Creates the backing sub-directory for this storage if it
7094    /// hasn't yet been created.
7095    pub fn r#open_storage(
7096        &self,
7097        mut relative_moniker: &str,
7098        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7099    ) -> fidl::client::QueryResponseFut<
7100        StorageAdminOpenStorageResult,
7101        fidl::encoding::DefaultFuchsiaResourceDialect,
7102    > {
7103        StorageAdminProxyInterface::r#open_storage(self, relative_moniker, object)
7104    }
7105
7106    /// Lists the descendant components under the specified realm that use the
7107    /// storage capability. The provided moniker is relative to the component
7108    /// that declares the storage capability.
7109    ///
7110    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
7111    /// if |relative_moniker| is malformed.
7112    pub fn r#list_storage_in_realm(
7113        &self,
7114        mut relative_moniker: &str,
7115        mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7116    ) -> fidl::client::QueryResponseFut<
7117        StorageAdminListStorageInRealmResult,
7118        fidl::encoding::DefaultFuchsiaResourceDialect,
7119    > {
7120        StorageAdminProxyInterface::r#list_storage_in_realm(self, relative_moniker, iterator)
7121    }
7122
7123    /// Opens the isolated directory for the given storage ID. Creates the
7124    /// backing sub-directory for this storage if it hasn't yet been created.
7125    pub fn r#open_component_storage_by_id(
7126        &self,
7127        mut id: &str,
7128        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7129    ) -> fidl::client::QueryResponseFut<
7130        StorageAdminOpenComponentStorageByIdResult,
7131        fidl::encoding::DefaultFuchsiaResourceDialect,
7132    > {
7133        StorageAdminProxyInterface::r#open_component_storage_by_id(self, id, object)
7134    }
7135
7136    /// Deletes the contents of the storage for this component. Preserves the
7137    /// component's subdirectory itself within the storage backing directory.
7138    /// The provided moniker is relative to the component that declares the
7139    /// storage capability.
7140    pub fn r#delete_component_storage(
7141        &self,
7142        mut relative_moniker: &str,
7143    ) -> fidl::client::QueryResponseFut<
7144        StorageAdminDeleteComponentStorageResult,
7145        fidl::encoding::DefaultFuchsiaResourceDialect,
7146    > {
7147        StorageAdminProxyInterface::r#delete_component_storage(self, relative_moniker)
7148    }
7149
7150    /// Get the current status of the storage.
7151    pub fn r#get_status(
7152        &self,
7153    ) -> fidl::client::QueryResponseFut<
7154        StorageAdminGetStatusResult,
7155        fidl::encoding::DefaultFuchsiaResourceDialect,
7156    > {
7157        StorageAdminProxyInterface::r#get_status(self)
7158    }
7159
7160    /// Deletes the contents of all the storage. Storage directories are
7161    /// retained so any components using storage will be able to continue using
7162    /// it to create new files and directories.
7163    ///
7164    /// Returns Error::INTERNAL only if no storage at all could be cleared.
7165    /// Returns successfully even if some errors happen during the deletion
7166    /// progress.
7167    pub fn r#delete_all_storage_contents(
7168        &self,
7169    ) -> fidl::client::QueryResponseFut<
7170        StorageAdminDeleteAllStorageContentsResult,
7171        fidl::encoding::DefaultFuchsiaResourceDialect,
7172    > {
7173        StorageAdminProxyInterface::r#delete_all_storage_contents(self)
7174    }
7175}
7176
7177impl StorageAdminProxyInterface for StorageAdminProxy {
7178    type OpenStorageResponseFut = fidl::client::QueryResponseFut<
7179        StorageAdminOpenStorageResult,
7180        fidl::encoding::DefaultFuchsiaResourceDialect,
7181    >;
7182    fn r#open_storage(
7183        &self,
7184        mut relative_moniker: &str,
7185        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7186    ) -> Self::OpenStorageResponseFut {
7187        fn _decode(
7188            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7189        ) -> Result<StorageAdminOpenStorageResult, fidl::Error> {
7190            let _response = fidl::client::decode_transaction_body::<
7191                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
7192                fidl::encoding::DefaultFuchsiaResourceDialect,
7193                0x6ceaa5904cfe4377,
7194            >(_buf?)?;
7195            Ok(_response.map(|x| x))
7196        }
7197        self.client
7198            .send_query_and_decode::<StorageAdminOpenStorageRequest, StorageAdminOpenStorageResult>(
7199                (relative_moniker, object),
7200                0x6ceaa5904cfe4377,
7201                fidl::encoding::DynamicFlags::empty(),
7202                _decode,
7203            )
7204    }
7205
7206    type ListStorageInRealmResponseFut = fidl::client::QueryResponseFut<
7207        StorageAdminListStorageInRealmResult,
7208        fidl::encoding::DefaultFuchsiaResourceDialect,
7209    >;
7210    fn r#list_storage_in_realm(
7211        &self,
7212        mut relative_moniker: &str,
7213        mut iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7214    ) -> Self::ListStorageInRealmResponseFut {
7215        fn _decode(
7216            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7217        ) -> Result<StorageAdminListStorageInRealmResult, fidl::Error> {
7218            let _response = fidl::client::decode_transaction_body::<
7219                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
7220                fidl::encoding::DefaultFuchsiaResourceDialect,
7221                0x764f6d1f083e8bfb,
7222            >(_buf?)?;
7223            Ok(_response.map(|x| x))
7224        }
7225        self.client.send_query_and_decode::<
7226            StorageAdminListStorageInRealmRequest,
7227            StorageAdminListStorageInRealmResult,
7228        >(
7229            (relative_moniker, iterator,),
7230            0x764f6d1f083e8bfb,
7231            fidl::encoding::DynamicFlags::empty(),
7232            _decode,
7233        )
7234    }
7235
7236    type OpenComponentStorageByIdResponseFut = fidl::client::QueryResponseFut<
7237        StorageAdminOpenComponentStorageByIdResult,
7238        fidl::encoding::DefaultFuchsiaResourceDialect,
7239    >;
7240    fn r#open_component_storage_by_id(
7241        &self,
7242        mut id: &str,
7243        mut object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7244    ) -> Self::OpenComponentStorageByIdResponseFut {
7245        fn _decode(
7246            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7247        ) -> Result<StorageAdminOpenComponentStorageByIdResult, fidl::Error> {
7248            let _response = fidl::client::decode_transaction_body::<
7249                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
7250                fidl::encoding::DefaultFuchsiaResourceDialect,
7251                0x4802102cc55d5df1,
7252            >(_buf?)?;
7253            Ok(_response.map(|x| x))
7254        }
7255        self.client.send_query_and_decode::<
7256            StorageAdminOpenComponentStorageByIdRequest,
7257            StorageAdminOpenComponentStorageByIdResult,
7258        >(
7259            (id, object,),
7260            0x4802102cc55d5df1,
7261            fidl::encoding::DynamicFlags::empty(),
7262            _decode,
7263        )
7264    }
7265
7266    type DeleteComponentStorageResponseFut = fidl::client::QueryResponseFut<
7267        StorageAdminDeleteComponentStorageResult,
7268        fidl::encoding::DefaultFuchsiaResourceDialect,
7269    >;
7270    fn r#delete_component_storage(
7271        &self,
7272        mut relative_moniker: &str,
7273    ) -> Self::DeleteComponentStorageResponseFut {
7274        fn _decode(
7275            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7276        ) -> Result<StorageAdminDeleteComponentStorageResult, fidl::Error> {
7277            let _response = fidl::client::decode_transaction_body::<
7278                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>,
7279                fidl::encoding::DefaultFuchsiaResourceDialect,
7280                0x1677c1cdfcdbf45a,
7281            >(_buf?)?;
7282            Ok(_response.map(|x| x))
7283        }
7284        self.client.send_query_and_decode::<
7285            StorageAdminDeleteComponentStorageRequest,
7286            StorageAdminDeleteComponentStorageResult,
7287        >(
7288            (relative_moniker,),
7289            0x1677c1cdfcdbf45a,
7290            fidl::encoding::DynamicFlags::empty(),
7291            _decode,
7292        )
7293    }
7294
7295    type GetStatusResponseFut = fidl::client::QueryResponseFut<
7296        StorageAdminGetStatusResult,
7297        fidl::encoding::DefaultFuchsiaResourceDialect,
7298    >;
7299    fn r#get_status(&self) -> Self::GetStatusResponseFut {
7300        fn _decode(
7301            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7302        ) -> Result<StorageAdminGetStatusResult, fidl::Error> {
7303            let _response = fidl::client::decode_transaction_body::<
7304                fidl::encoding::ResultType<StorageStatus, StatusError>,
7305                fidl::encoding::DefaultFuchsiaResourceDialect,
7306                0x7729e325a6c526c8,
7307            >(_buf?)?;
7308            Ok(_response.map(|x| x))
7309        }
7310        self.client
7311            .send_query_and_decode::<fidl::encoding::EmptyPayload, StorageAdminGetStatusResult>(
7312                (),
7313                0x7729e325a6c526c8,
7314                fidl::encoding::DynamicFlags::empty(),
7315                _decode,
7316            )
7317    }
7318
7319    type DeleteAllStorageContentsResponseFut = fidl::client::QueryResponseFut<
7320        StorageAdminDeleteAllStorageContentsResult,
7321        fidl::encoding::DefaultFuchsiaResourceDialect,
7322    >;
7323    fn r#delete_all_storage_contents(&self) -> Self::DeleteAllStorageContentsResponseFut {
7324        fn _decode(
7325            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7326        ) -> Result<StorageAdminDeleteAllStorageContentsResult, fidl::Error> {
7327            let _response = fidl::client::decode_transaction_body::<
7328                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DeletionError>,
7329                fidl::encoding::DefaultFuchsiaResourceDialect,
7330                0x2ee980b4b2d24adb,
7331            >(_buf?)?;
7332            Ok(_response.map(|x| x))
7333        }
7334        self.client.send_query_and_decode::<
7335            fidl::encoding::EmptyPayload,
7336            StorageAdminDeleteAllStorageContentsResult,
7337        >(
7338            (),
7339            0x2ee980b4b2d24adb,
7340            fidl::encoding::DynamicFlags::empty(),
7341            _decode,
7342        )
7343    }
7344}
7345
7346pub struct StorageAdminEventStream {
7347    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7348}
7349
7350impl std::marker::Unpin for StorageAdminEventStream {}
7351
7352impl futures::stream::FusedStream for StorageAdminEventStream {
7353    fn is_terminated(&self) -> bool {
7354        self.event_receiver.is_terminated()
7355    }
7356}
7357
7358impl futures::Stream for StorageAdminEventStream {
7359    type Item = Result<StorageAdminEvent, fidl::Error>;
7360
7361    fn poll_next(
7362        mut self: std::pin::Pin<&mut Self>,
7363        cx: &mut std::task::Context<'_>,
7364    ) -> std::task::Poll<Option<Self::Item>> {
7365        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7366            &mut self.event_receiver,
7367            cx
7368        )?) {
7369            Some(buf) => std::task::Poll::Ready(Some(StorageAdminEvent::decode(buf))),
7370            None => std::task::Poll::Ready(None),
7371        }
7372    }
7373}
7374
7375#[derive(Debug)]
7376pub enum StorageAdminEvent {}
7377
7378impl StorageAdminEvent {
7379    /// Decodes a message buffer as a [`StorageAdminEvent`].
7380    fn decode(
7381        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7382    ) -> Result<StorageAdminEvent, fidl::Error> {
7383        let (bytes, _handles) = buf.split_mut();
7384        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7385        debug_assert_eq!(tx_header.tx_id, 0);
7386        match tx_header.ordinal {
7387            _ => Err(fidl::Error::UnknownOrdinal {
7388                ordinal: tx_header.ordinal,
7389                protocol_name: <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7390            }),
7391        }
7392    }
7393}
7394
7395/// A Stream of incoming requests for fuchsia.component/StorageAdmin.
7396pub struct StorageAdminRequestStream {
7397    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7398    is_terminated: bool,
7399}
7400
7401impl std::marker::Unpin for StorageAdminRequestStream {}
7402
7403impl futures::stream::FusedStream for StorageAdminRequestStream {
7404    fn is_terminated(&self) -> bool {
7405        self.is_terminated
7406    }
7407}
7408
7409impl fidl::endpoints::RequestStream for StorageAdminRequestStream {
7410    type Protocol = StorageAdminMarker;
7411    type ControlHandle = StorageAdminControlHandle;
7412
7413    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7414        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7415    }
7416
7417    fn control_handle(&self) -> Self::ControlHandle {
7418        StorageAdminControlHandle { inner: self.inner.clone() }
7419    }
7420
7421    fn into_inner(
7422        self,
7423    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7424    {
7425        (self.inner, self.is_terminated)
7426    }
7427
7428    fn from_inner(
7429        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7430        is_terminated: bool,
7431    ) -> Self {
7432        Self { inner, is_terminated }
7433    }
7434}
7435
7436impl futures::Stream for StorageAdminRequestStream {
7437    type Item = Result<StorageAdminRequest, fidl::Error>;
7438
7439    fn poll_next(
7440        mut self: std::pin::Pin<&mut Self>,
7441        cx: &mut std::task::Context<'_>,
7442    ) -> std::task::Poll<Option<Self::Item>> {
7443        let this = &mut *self;
7444        if this.inner.check_shutdown(cx) {
7445            this.is_terminated = true;
7446            return std::task::Poll::Ready(None);
7447        }
7448        if this.is_terminated {
7449            panic!("polled StorageAdminRequestStream after completion");
7450        }
7451        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7452            |bytes, handles| {
7453                match this.inner.channel().read_etc(cx, bytes, handles) {
7454                    std::task::Poll::Ready(Ok(())) => {}
7455                    std::task::Poll::Pending => return std::task::Poll::Pending,
7456                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7457                        this.is_terminated = true;
7458                        return std::task::Poll::Ready(None);
7459                    }
7460                    std::task::Poll::Ready(Err(e)) => {
7461                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7462                            e.into(),
7463                        ))));
7464                    }
7465                }
7466
7467                // A message has been received from the channel
7468                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7469
7470                std::task::Poll::Ready(Some(match header.ordinal {
7471                    0x6ceaa5904cfe4377 => {
7472                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7473                        let mut req = fidl::new_empty!(
7474                            StorageAdminOpenStorageRequest,
7475                            fidl::encoding::DefaultFuchsiaResourceDialect
7476                        );
7477                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminOpenStorageRequest>(&header, _body_bytes, handles, &mut req)?;
7478                        let control_handle =
7479                            StorageAdminControlHandle { inner: this.inner.clone() };
7480                        Ok(StorageAdminRequest::OpenStorage {
7481                            relative_moniker: req.relative_moniker,
7482                            object: req.object,
7483
7484                            responder: StorageAdminOpenStorageResponder {
7485                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7486                                tx_id: header.tx_id,
7487                            },
7488                        })
7489                    }
7490                    0x764f6d1f083e8bfb => {
7491                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7492                        let mut req = fidl::new_empty!(
7493                            StorageAdminListStorageInRealmRequest,
7494                            fidl::encoding::DefaultFuchsiaResourceDialect
7495                        );
7496                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminListStorageInRealmRequest>(&header, _body_bytes, handles, &mut req)?;
7497                        let control_handle =
7498                            StorageAdminControlHandle { inner: this.inner.clone() };
7499                        Ok(StorageAdminRequest::ListStorageInRealm {
7500                            relative_moniker: req.relative_moniker,
7501                            iterator: req.iterator,
7502
7503                            responder: StorageAdminListStorageInRealmResponder {
7504                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7505                                tx_id: header.tx_id,
7506                            },
7507                        })
7508                    }
7509                    0x4802102cc55d5df1 => {
7510                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7511                        let mut req = fidl::new_empty!(
7512                            StorageAdminOpenComponentStorageByIdRequest,
7513                            fidl::encoding::DefaultFuchsiaResourceDialect
7514                        );
7515                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminOpenComponentStorageByIdRequest>(&header, _body_bytes, handles, &mut req)?;
7516                        let control_handle =
7517                            StorageAdminControlHandle { inner: this.inner.clone() };
7518                        Ok(StorageAdminRequest::OpenComponentStorageById {
7519                            id: req.id,
7520                            object: req.object,
7521
7522                            responder: StorageAdminOpenComponentStorageByIdResponder {
7523                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7524                                tx_id: header.tx_id,
7525                            },
7526                        })
7527                    }
7528                    0x1677c1cdfcdbf45a => {
7529                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7530                        let mut req = fidl::new_empty!(
7531                            StorageAdminDeleteComponentStorageRequest,
7532                            fidl::encoding::DefaultFuchsiaResourceDialect
7533                        );
7534                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StorageAdminDeleteComponentStorageRequest>(&header, _body_bytes, handles, &mut req)?;
7535                        let control_handle =
7536                            StorageAdminControlHandle { inner: this.inner.clone() };
7537                        Ok(StorageAdminRequest::DeleteComponentStorage {
7538                            relative_moniker: req.relative_moniker,
7539
7540                            responder: StorageAdminDeleteComponentStorageResponder {
7541                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7542                                tx_id: header.tx_id,
7543                            },
7544                        })
7545                    }
7546                    0x7729e325a6c526c8 => {
7547                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7548                        let mut req = fidl::new_empty!(
7549                            fidl::encoding::EmptyPayload,
7550                            fidl::encoding::DefaultFuchsiaResourceDialect
7551                        );
7552                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7553                        let control_handle =
7554                            StorageAdminControlHandle { inner: this.inner.clone() };
7555                        Ok(StorageAdminRequest::GetStatus {
7556                            responder: StorageAdminGetStatusResponder {
7557                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7558                                tx_id: header.tx_id,
7559                            },
7560                        })
7561                    }
7562                    0x2ee980b4b2d24adb => {
7563                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7564                        let mut req = fidl::new_empty!(
7565                            fidl::encoding::EmptyPayload,
7566                            fidl::encoding::DefaultFuchsiaResourceDialect
7567                        );
7568                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7569                        let control_handle =
7570                            StorageAdminControlHandle { inner: this.inner.clone() };
7571                        Ok(StorageAdminRequest::DeleteAllStorageContents {
7572                            responder: StorageAdminDeleteAllStorageContentsResponder {
7573                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7574                                tx_id: header.tx_id,
7575                            },
7576                        })
7577                    }
7578                    _ => Err(fidl::Error::UnknownOrdinal {
7579                        ordinal: header.ordinal,
7580                        protocol_name:
7581                            <StorageAdminMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7582                    }),
7583                }))
7584            },
7585        )
7586    }
7587}
7588
7589#[derive(Debug)]
7590pub enum StorageAdminRequest {
7591    /// Opens the isolated directory for the given component. The provided
7592    /// moniker is relative to the component that declares the storage
7593    /// capability. Creates the backing sub-directory for this storage if it
7594    /// hasn't yet been created.
7595    OpenStorage {
7596        relative_moniker: String,
7597        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7598        responder: StorageAdminOpenStorageResponder,
7599    },
7600    /// Lists the descendant components under the specified realm that use the
7601    /// storage capability. The provided moniker is relative to the component
7602    /// that declares the storage capability.
7603    ///
7604    /// Returns INSTANCE_NOT_FOUND if the realm does not exist, and INVALID_ARGS
7605    /// if |relative_moniker| is malformed.
7606    ListStorageInRealm {
7607        relative_moniker: String,
7608        iterator: fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7609        responder: StorageAdminListStorageInRealmResponder,
7610    },
7611    /// Opens the isolated directory for the given storage ID. Creates the
7612    /// backing sub-directory for this storage if it hasn't yet been created.
7613    OpenComponentStorageById {
7614        id: String,
7615        object: fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7616        responder: StorageAdminOpenComponentStorageByIdResponder,
7617    },
7618    /// Deletes the contents of the storage for this component. Preserves the
7619    /// component's subdirectory itself within the storage backing directory.
7620    /// The provided moniker is relative to the component that declares the
7621    /// storage capability.
7622    DeleteComponentStorage {
7623        relative_moniker: String,
7624        responder: StorageAdminDeleteComponentStorageResponder,
7625    },
7626    /// Get the current status of the storage.
7627    GetStatus { responder: StorageAdminGetStatusResponder },
7628    /// Deletes the contents of all the storage. Storage directories are
7629    /// retained so any components using storage will be able to continue using
7630    /// it to create new files and directories.
7631    ///
7632    /// Returns Error::INTERNAL only if no storage at all could be cleared.
7633    /// Returns successfully even if some errors happen during the deletion
7634    /// progress.
7635    DeleteAllStorageContents { responder: StorageAdminDeleteAllStorageContentsResponder },
7636}
7637
7638impl StorageAdminRequest {
7639    #[allow(irrefutable_let_patterns)]
7640    pub fn into_open_storage(
7641        self,
7642    ) -> Option<(
7643        String,
7644        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7645        StorageAdminOpenStorageResponder,
7646    )> {
7647        if let StorageAdminRequest::OpenStorage { relative_moniker, object, responder } = self {
7648            Some((relative_moniker, object, responder))
7649        } else {
7650            None
7651        }
7652    }
7653
7654    #[allow(irrefutable_let_patterns)]
7655    pub fn into_list_storage_in_realm(
7656        self,
7657    ) -> Option<(
7658        String,
7659        fidl::endpoints::ServerEnd<StorageIteratorMarker>,
7660        StorageAdminListStorageInRealmResponder,
7661    )> {
7662        if let StorageAdminRequest::ListStorageInRealm { relative_moniker, iterator, responder } =
7663            self
7664        {
7665            Some((relative_moniker, iterator, responder))
7666        } else {
7667            None
7668        }
7669    }
7670
7671    #[allow(irrefutable_let_patterns)]
7672    pub fn into_open_component_storage_by_id(
7673        self,
7674    ) -> Option<(
7675        String,
7676        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
7677        StorageAdminOpenComponentStorageByIdResponder,
7678    )> {
7679        if let StorageAdminRequest::OpenComponentStorageById { id, object, responder } = self {
7680            Some((id, object, responder))
7681        } else {
7682            None
7683        }
7684    }
7685
7686    #[allow(irrefutable_let_patterns)]
7687    pub fn into_delete_component_storage(
7688        self,
7689    ) -> Option<(String, StorageAdminDeleteComponentStorageResponder)> {
7690        if let StorageAdminRequest::DeleteComponentStorage { relative_moniker, responder } = self {
7691            Some((relative_moniker, responder))
7692        } else {
7693            None
7694        }
7695    }
7696
7697    #[allow(irrefutable_let_patterns)]
7698    pub fn into_get_status(self) -> Option<(StorageAdminGetStatusResponder)> {
7699        if let StorageAdminRequest::GetStatus { responder } = self {
7700            Some((responder))
7701        } else {
7702            None
7703        }
7704    }
7705
7706    #[allow(irrefutable_let_patterns)]
7707    pub fn into_delete_all_storage_contents(
7708        self,
7709    ) -> Option<(StorageAdminDeleteAllStorageContentsResponder)> {
7710        if let StorageAdminRequest::DeleteAllStorageContents { responder } = self {
7711            Some((responder))
7712        } else {
7713            None
7714        }
7715    }
7716
7717    /// Name of the method defined in FIDL
7718    pub fn method_name(&self) -> &'static str {
7719        match *self {
7720            StorageAdminRequest::OpenStorage { .. } => "open_storage",
7721            StorageAdminRequest::ListStorageInRealm { .. } => "list_storage_in_realm",
7722            StorageAdminRequest::OpenComponentStorageById { .. } => "open_component_storage_by_id",
7723            StorageAdminRequest::DeleteComponentStorage { .. } => "delete_component_storage",
7724            StorageAdminRequest::GetStatus { .. } => "get_status",
7725            StorageAdminRequest::DeleteAllStorageContents { .. } => "delete_all_storage_contents",
7726        }
7727    }
7728}
7729
7730#[derive(Debug, Clone)]
7731pub struct StorageAdminControlHandle {
7732    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7733}
7734
7735impl StorageAdminControlHandle {
7736    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
7737        self.inner.shutdown_with_epitaph(status.into())
7738    }
7739}
7740
7741impl fidl::endpoints::ControlHandle for StorageAdminControlHandle {
7742    fn shutdown(&self) {
7743        self.inner.shutdown()
7744    }
7745
7746    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
7747        self.inner.shutdown_with_epitaph(status)
7748    }
7749
7750    fn is_closed(&self) -> bool {
7751        self.inner.channel().is_closed()
7752    }
7753    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7754        self.inner.channel().on_closed()
7755    }
7756
7757    #[cfg(target_os = "fuchsia")]
7758    fn signal_peer(
7759        &self,
7760        clear_mask: zx::Signals,
7761        set_mask: zx::Signals,
7762    ) -> Result<(), zx_status::Status> {
7763        use fidl::Peered;
7764        self.inner.channel().signal_peer(clear_mask, set_mask)
7765    }
7766}
7767
7768impl StorageAdminControlHandle {}
7769
7770#[must_use = "FIDL methods require a response to be sent"]
7771#[derive(Debug)]
7772pub struct StorageAdminOpenStorageResponder {
7773    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7774    tx_id: u32,
7775}
7776
7777/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7778/// if the responder is dropped without sending a response, so that the client
7779/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7780impl std::ops::Drop for StorageAdminOpenStorageResponder {
7781    fn drop(&mut self) {
7782        self.control_handle.shutdown();
7783        // Safety: drops once, never accessed again
7784        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7785    }
7786}
7787
7788impl fidl::endpoints::Responder for StorageAdminOpenStorageResponder {
7789    type ControlHandle = StorageAdminControlHandle;
7790
7791    fn control_handle(&self) -> &StorageAdminControlHandle {
7792        &self.control_handle
7793    }
7794
7795    fn drop_without_shutdown(mut self) {
7796        // Safety: drops once, never accessed again due to mem::forget
7797        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7798        // Prevent Drop from running (which would shut down the channel)
7799        std::mem::forget(self);
7800    }
7801}
7802
7803impl StorageAdminOpenStorageResponder {
7804    /// Sends a response to the FIDL transaction.
7805    ///
7806    /// Sets the channel to shutdown if an error occurs.
7807    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7808        let _result = self.send_raw(result);
7809        if _result.is_err() {
7810            self.control_handle.shutdown();
7811        }
7812        self.drop_without_shutdown();
7813        _result
7814    }
7815
7816    /// Similar to "send" but does not shutdown the channel if an error occurs.
7817    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7818        let _result = self.send_raw(result);
7819        self.drop_without_shutdown();
7820        _result
7821    }
7822
7823    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7824        self.control_handle
7825            .inner
7826            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
7827                result,
7828                self.tx_id,
7829                0x6ceaa5904cfe4377,
7830                fidl::encoding::DynamicFlags::empty(),
7831            )
7832    }
7833}
7834
7835#[must_use = "FIDL methods require a response to be sent"]
7836#[derive(Debug)]
7837pub struct StorageAdminListStorageInRealmResponder {
7838    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7839    tx_id: u32,
7840}
7841
7842/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7843/// if the responder is dropped without sending a response, so that the client
7844/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7845impl std::ops::Drop for StorageAdminListStorageInRealmResponder {
7846    fn drop(&mut self) {
7847        self.control_handle.shutdown();
7848        // Safety: drops once, never accessed again
7849        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7850    }
7851}
7852
7853impl fidl::endpoints::Responder for StorageAdminListStorageInRealmResponder {
7854    type ControlHandle = StorageAdminControlHandle;
7855
7856    fn control_handle(&self) -> &StorageAdminControlHandle {
7857        &self.control_handle
7858    }
7859
7860    fn drop_without_shutdown(mut self) {
7861        // Safety: drops once, never accessed again due to mem::forget
7862        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7863        // Prevent Drop from running (which would shut down the channel)
7864        std::mem::forget(self);
7865    }
7866}
7867
7868impl StorageAdminListStorageInRealmResponder {
7869    /// Sends a response to the FIDL transaction.
7870    ///
7871    /// Sets the channel to shutdown if an error occurs.
7872    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7873        let _result = self.send_raw(result);
7874        if _result.is_err() {
7875            self.control_handle.shutdown();
7876        }
7877        self.drop_without_shutdown();
7878        _result
7879    }
7880
7881    /// Similar to "send" but does not shutdown the channel if an error occurs.
7882    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7883        let _result = self.send_raw(result);
7884        self.drop_without_shutdown();
7885        _result
7886    }
7887
7888    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7889        self.control_handle
7890            .inner
7891            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
7892                result,
7893                self.tx_id,
7894                0x764f6d1f083e8bfb,
7895                fidl::encoding::DynamicFlags::empty(),
7896            )
7897    }
7898}
7899
7900#[must_use = "FIDL methods require a response to be sent"]
7901#[derive(Debug)]
7902pub struct StorageAdminOpenComponentStorageByIdResponder {
7903    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7904    tx_id: u32,
7905}
7906
7907/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7908/// if the responder is dropped without sending a response, so that the client
7909/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7910impl std::ops::Drop for StorageAdminOpenComponentStorageByIdResponder {
7911    fn drop(&mut self) {
7912        self.control_handle.shutdown();
7913        // Safety: drops once, never accessed again
7914        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7915    }
7916}
7917
7918impl fidl::endpoints::Responder for StorageAdminOpenComponentStorageByIdResponder {
7919    type ControlHandle = StorageAdminControlHandle;
7920
7921    fn control_handle(&self) -> &StorageAdminControlHandle {
7922        &self.control_handle
7923    }
7924
7925    fn drop_without_shutdown(mut self) {
7926        // Safety: drops once, never accessed again due to mem::forget
7927        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7928        // Prevent Drop from running (which would shut down the channel)
7929        std::mem::forget(self);
7930    }
7931}
7932
7933impl StorageAdminOpenComponentStorageByIdResponder {
7934    /// Sends a response to the FIDL transaction.
7935    ///
7936    /// Sets the channel to shutdown if an error occurs.
7937    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7938        let _result = self.send_raw(result);
7939        if _result.is_err() {
7940            self.control_handle.shutdown();
7941        }
7942        self.drop_without_shutdown();
7943        _result
7944    }
7945
7946    /// Similar to "send" but does not shutdown the channel if an error occurs.
7947    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7948        let _result = self.send_raw(result);
7949        self.drop_without_shutdown();
7950        _result
7951    }
7952
7953    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
7954        self.control_handle
7955            .inner
7956            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
7957                result,
7958                self.tx_id,
7959                0x4802102cc55d5df1,
7960                fidl::encoding::DynamicFlags::empty(),
7961            )
7962    }
7963}
7964
7965#[must_use = "FIDL methods require a response to be sent"]
7966#[derive(Debug)]
7967pub struct StorageAdminDeleteComponentStorageResponder {
7968    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
7969    tx_id: u32,
7970}
7971
7972/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
7973/// if the responder is dropped without sending a response, so that the client
7974/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7975impl std::ops::Drop for StorageAdminDeleteComponentStorageResponder {
7976    fn drop(&mut self) {
7977        self.control_handle.shutdown();
7978        // Safety: drops once, never accessed again
7979        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7980    }
7981}
7982
7983impl fidl::endpoints::Responder for StorageAdminDeleteComponentStorageResponder {
7984    type ControlHandle = StorageAdminControlHandle;
7985
7986    fn control_handle(&self) -> &StorageAdminControlHandle {
7987        &self.control_handle
7988    }
7989
7990    fn drop_without_shutdown(mut self) {
7991        // Safety: drops once, never accessed again due to mem::forget
7992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7993        // Prevent Drop from running (which would shut down the channel)
7994        std::mem::forget(self);
7995    }
7996}
7997
7998impl StorageAdminDeleteComponentStorageResponder {
7999    /// Sends a response to the FIDL transaction.
8000    ///
8001    /// Sets the channel to shutdown if an error occurs.
8002    pub fn send(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
8003        let _result = self.send_raw(result);
8004        if _result.is_err() {
8005            self.control_handle.shutdown();
8006        }
8007        self.drop_without_shutdown();
8008        _result
8009    }
8010
8011    /// Similar to "send" but does not shutdown the channel if an error occurs.
8012    pub fn send_no_shutdown_on_err(self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
8013        let _result = self.send_raw(result);
8014        self.drop_without_shutdown();
8015        _result
8016    }
8017
8018    fn send_raw(&self, mut result: Result<(), Error>) -> Result<(), fidl::Error> {
8019        self.control_handle
8020            .inner
8021            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, Error>>(
8022                result,
8023                self.tx_id,
8024                0x1677c1cdfcdbf45a,
8025                fidl::encoding::DynamicFlags::empty(),
8026            )
8027    }
8028}
8029
8030#[must_use = "FIDL methods require a response to be sent"]
8031#[derive(Debug)]
8032pub struct StorageAdminGetStatusResponder {
8033    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8034    tx_id: u32,
8035}
8036
8037/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
8038/// if the responder is dropped without sending a response, so that the client
8039/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8040impl std::ops::Drop for StorageAdminGetStatusResponder {
8041    fn drop(&mut self) {
8042        self.control_handle.shutdown();
8043        // Safety: drops once, never accessed again
8044        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8045    }
8046}
8047
8048impl fidl::endpoints::Responder for StorageAdminGetStatusResponder {
8049    type ControlHandle = StorageAdminControlHandle;
8050
8051    fn control_handle(&self) -> &StorageAdminControlHandle {
8052        &self.control_handle
8053    }
8054
8055    fn drop_without_shutdown(mut self) {
8056        // Safety: drops once, never accessed again due to mem::forget
8057        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8058        // Prevent Drop from running (which would shut down the channel)
8059        std::mem::forget(self);
8060    }
8061}
8062
8063impl StorageAdminGetStatusResponder {
8064    /// Sends a response to the FIDL transaction.
8065    ///
8066    /// Sets the channel to shutdown if an error occurs.
8067    pub fn send(self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
8068        let _result = self.send_raw(result);
8069        if _result.is_err() {
8070            self.control_handle.shutdown();
8071        }
8072        self.drop_without_shutdown();
8073        _result
8074    }
8075
8076    /// Similar to "send" but does not shutdown the channel if an error occurs.
8077    pub fn send_no_shutdown_on_err(
8078        self,
8079        mut result: Result<&StorageStatus, StatusError>,
8080    ) -> Result<(), fidl::Error> {
8081        let _result = self.send_raw(result);
8082        self.drop_without_shutdown();
8083        _result
8084    }
8085
8086    fn send_raw(&self, mut result: Result<&StorageStatus, StatusError>) -> Result<(), fidl::Error> {
8087        self.control_handle.inner.send::<fidl::encoding::ResultType<StorageStatus, StatusError>>(
8088            result,
8089            self.tx_id,
8090            0x7729e325a6c526c8,
8091            fidl::encoding::DynamicFlags::empty(),
8092        )
8093    }
8094}
8095
8096#[must_use = "FIDL methods require a response to be sent"]
8097#[derive(Debug)]
8098pub struct StorageAdminDeleteAllStorageContentsResponder {
8099    control_handle: std::mem::ManuallyDrop<StorageAdminControlHandle>,
8100    tx_id: u32,
8101}
8102
8103/// Set the the channel to be shutdown (see [`StorageAdminControlHandle::shutdown`])
8104/// if the responder is dropped without sending a response, so that the client
8105/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8106impl std::ops::Drop for StorageAdminDeleteAllStorageContentsResponder {
8107    fn drop(&mut self) {
8108        self.control_handle.shutdown();
8109        // Safety: drops once, never accessed again
8110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8111    }
8112}
8113
8114impl fidl::endpoints::Responder for StorageAdminDeleteAllStorageContentsResponder {
8115    type ControlHandle = StorageAdminControlHandle;
8116
8117    fn control_handle(&self) -> &StorageAdminControlHandle {
8118        &self.control_handle
8119    }
8120
8121    fn drop_without_shutdown(mut self) {
8122        // Safety: drops once, never accessed again due to mem::forget
8123        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8124        // Prevent Drop from running (which would shut down the channel)
8125        std::mem::forget(self);
8126    }
8127}
8128
8129impl StorageAdminDeleteAllStorageContentsResponder {
8130    /// Sends a response to the FIDL transaction.
8131    ///
8132    /// Sets the channel to shutdown if an error occurs.
8133    pub fn send(self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
8134        let _result = self.send_raw(result);
8135        if _result.is_err() {
8136            self.control_handle.shutdown();
8137        }
8138        self.drop_without_shutdown();
8139        _result
8140    }
8141
8142    /// Similar to "send" but does not shutdown the channel if an error occurs.
8143    pub fn send_no_shutdown_on_err(
8144        self,
8145        mut result: Result<(), DeletionError>,
8146    ) -> Result<(), fidl::Error> {
8147        let _result = self.send_raw(result);
8148        self.drop_without_shutdown();
8149        _result
8150    }
8151
8152    fn send_raw(&self, mut result: Result<(), DeletionError>) -> Result<(), fidl::Error> {
8153        self.control_handle.inner.send::<fidl::encoding::ResultType<
8154            fidl::encoding::EmptyStruct,
8155            DeletionError,
8156        >>(
8157            result,
8158            self.tx_id,
8159            0x2ee980b4b2d24adb,
8160            fidl::encoding::DynamicFlags::empty(),
8161        )
8162    }
8163}
8164
8165#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8166pub struct StorageIteratorMarker;
8167
8168impl fidl::endpoints::ProtocolMarker for StorageIteratorMarker {
8169    type Proxy = StorageIteratorProxy;
8170    type RequestStream = StorageIteratorRequestStream;
8171    #[cfg(target_os = "fuchsia")]
8172    type SynchronousProxy = StorageIteratorSynchronousProxy;
8173
8174    const DEBUG_NAME: &'static str = "(anonymous) StorageIterator";
8175}
8176
8177pub trait StorageIteratorProxyInterface: Send + Sync {
8178    type NextResponseFut: std::future::Future<Output = Result<Vec<String>, fidl::Error>> + Send;
8179    fn r#next(&self) -> Self::NextResponseFut;
8180}
8181#[derive(Debug)]
8182#[cfg(target_os = "fuchsia")]
8183pub struct StorageIteratorSynchronousProxy {
8184    client: fidl::client::sync::Client,
8185}
8186
8187#[cfg(target_os = "fuchsia")]
8188impl fidl::endpoints::SynchronousProxy for StorageIteratorSynchronousProxy {
8189    type Proxy = StorageIteratorProxy;
8190    type Protocol = StorageIteratorMarker;
8191
8192    fn from_channel(inner: fidl::Channel) -> Self {
8193        Self::new(inner)
8194    }
8195
8196    fn into_channel(self) -> fidl::Channel {
8197        self.client.into_channel()
8198    }
8199
8200    fn as_channel(&self) -> &fidl::Channel {
8201        self.client.as_channel()
8202    }
8203}
8204
8205#[cfg(target_os = "fuchsia")]
8206impl StorageIteratorSynchronousProxy {
8207    pub fn new(channel: fidl::Channel) -> Self {
8208        Self { client: fidl::client::sync::Client::new(channel) }
8209    }
8210
8211    pub fn into_channel(self) -> fidl::Channel {
8212        self.client.into_channel()
8213    }
8214
8215    /// Waits until an event arrives and returns it. It is safe for other
8216    /// threads to make concurrent requests while waiting for an event.
8217    pub fn wait_for_event(
8218        &self,
8219        deadline: zx::MonotonicInstant,
8220    ) -> Result<StorageIteratorEvent, fidl::Error> {
8221        StorageIteratorEvent::decode(self.client.wait_for_event::<StorageIteratorMarker>(deadline)?)
8222    }
8223
8224    /// Retrieve the next set of components using the storage capability. The
8225    /// returned monikers are relative to the component that declares the
8226    /// storage capability. Returns an empty vector after all components have
8227    /// been returned.
8228    pub fn r#next(&self, ___deadline: zx::MonotonicInstant) -> Result<Vec<String>, fidl::Error> {
8229        let _response = self.client.send_query::<
8230            fidl::encoding::EmptyPayload,
8231            StorageIteratorNextResponse,
8232            StorageIteratorMarker,
8233        >(
8234            (),
8235            0x7a6b21f15fd01b72,
8236            fidl::encoding::DynamicFlags::empty(),
8237            ___deadline,
8238        )?;
8239        Ok(_response.relative_monikers)
8240    }
8241}
8242
8243#[cfg(target_os = "fuchsia")]
8244impl From<StorageIteratorSynchronousProxy> for zx::NullableHandle {
8245    fn from(value: StorageIteratorSynchronousProxy) -> Self {
8246        value.into_channel().into()
8247    }
8248}
8249
8250#[cfg(target_os = "fuchsia")]
8251impl From<fidl::Channel> for StorageIteratorSynchronousProxy {
8252    fn from(value: fidl::Channel) -> Self {
8253        Self::new(value)
8254    }
8255}
8256
8257#[cfg(target_os = "fuchsia")]
8258impl fidl::endpoints::FromClient for StorageIteratorSynchronousProxy {
8259    type Protocol = StorageIteratorMarker;
8260
8261    fn from_client(value: fidl::endpoints::ClientEnd<StorageIteratorMarker>) -> Self {
8262        Self::new(value.into_channel())
8263    }
8264}
8265
8266#[derive(Debug, Clone)]
8267pub struct StorageIteratorProxy {
8268    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
8269}
8270
8271impl fidl::endpoints::Proxy for StorageIteratorProxy {
8272    type Protocol = StorageIteratorMarker;
8273
8274    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
8275        Self::new(inner)
8276    }
8277
8278    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
8279        self.client.into_channel().map_err(|client| Self { client })
8280    }
8281
8282    fn as_channel(&self) -> &::fidl::AsyncChannel {
8283        self.client.as_channel()
8284    }
8285}
8286
8287impl StorageIteratorProxy {
8288    /// Create a new Proxy for fuchsia.component/StorageIterator.
8289    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
8290        let protocol_name = <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8291        Self { client: fidl::client::Client::new(channel, protocol_name) }
8292    }
8293
8294    /// Get a Stream of events from the remote end of the protocol.
8295    ///
8296    /// # Panics
8297    ///
8298    /// Panics if the event stream was already taken.
8299    pub fn take_event_stream(&self) -> StorageIteratorEventStream {
8300        StorageIteratorEventStream { event_receiver: self.client.take_event_receiver() }
8301    }
8302
8303    /// Retrieve the next set of components using the storage capability. The
8304    /// returned monikers are relative to the component that declares the
8305    /// storage capability. Returns an empty vector after all components have
8306    /// been returned.
8307    pub fn r#next(
8308        &self,
8309    ) -> fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>
8310    {
8311        StorageIteratorProxyInterface::r#next(self)
8312    }
8313}
8314
8315impl StorageIteratorProxyInterface for StorageIteratorProxy {
8316    type NextResponseFut =
8317        fidl::client::QueryResponseFut<Vec<String>, fidl::encoding::DefaultFuchsiaResourceDialect>;
8318    fn r#next(&self) -> Self::NextResponseFut {
8319        fn _decode(
8320            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
8321        ) -> Result<Vec<String>, fidl::Error> {
8322            let _response = fidl::client::decode_transaction_body::<
8323                StorageIteratorNextResponse,
8324                fidl::encoding::DefaultFuchsiaResourceDialect,
8325                0x7a6b21f15fd01b72,
8326            >(_buf?)?;
8327            Ok(_response.relative_monikers)
8328        }
8329        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<String>>(
8330            (),
8331            0x7a6b21f15fd01b72,
8332            fidl::encoding::DynamicFlags::empty(),
8333            _decode,
8334        )
8335    }
8336}
8337
8338pub struct StorageIteratorEventStream {
8339    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
8340}
8341
8342impl std::marker::Unpin for StorageIteratorEventStream {}
8343
8344impl futures::stream::FusedStream for StorageIteratorEventStream {
8345    fn is_terminated(&self) -> bool {
8346        self.event_receiver.is_terminated()
8347    }
8348}
8349
8350impl futures::Stream for StorageIteratorEventStream {
8351    type Item = Result<StorageIteratorEvent, fidl::Error>;
8352
8353    fn poll_next(
8354        mut self: std::pin::Pin<&mut Self>,
8355        cx: &mut std::task::Context<'_>,
8356    ) -> std::task::Poll<Option<Self::Item>> {
8357        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
8358            &mut self.event_receiver,
8359            cx
8360        )?) {
8361            Some(buf) => std::task::Poll::Ready(Some(StorageIteratorEvent::decode(buf))),
8362            None => std::task::Poll::Ready(None),
8363        }
8364    }
8365}
8366
8367#[derive(Debug)]
8368pub enum StorageIteratorEvent {}
8369
8370impl StorageIteratorEvent {
8371    /// Decodes a message buffer as a [`StorageIteratorEvent`].
8372    fn decode(
8373        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
8374    ) -> Result<StorageIteratorEvent, fidl::Error> {
8375        let (bytes, _handles) = buf.split_mut();
8376        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8377        debug_assert_eq!(tx_header.tx_id, 0);
8378        match tx_header.ordinal {
8379            _ => Err(fidl::Error::UnknownOrdinal {
8380                ordinal: tx_header.ordinal,
8381                protocol_name:
8382                    <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8383            }),
8384        }
8385    }
8386}
8387
8388/// A Stream of incoming requests for fuchsia.component/StorageIterator.
8389pub struct StorageIteratorRequestStream {
8390    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8391    is_terminated: bool,
8392}
8393
8394impl std::marker::Unpin for StorageIteratorRequestStream {}
8395
8396impl futures::stream::FusedStream for StorageIteratorRequestStream {
8397    fn is_terminated(&self) -> bool {
8398        self.is_terminated
8399    }
8400}
8401
8402impl fidl::endpoints::RequestStream for StorageIteratorRequestStream {
8403    type Protocol = StorageIteratorMarker;
8404    type ControlHandle = StorageIteratorControlHandle;
8405
8406    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
8407        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
8408    }
8409
8410    fn control_handle(&self) -> Self::ControlHandle {
8411        StorageIteratorControlHandle { inner: self.inner.clone() }
8412    }
8413
8414    fn into_inner(
8415        self,
8416    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
8417    {
8418        (self.inner, self.is_terminated)
8419    }
8420
8421    fn from_inner(
8422        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8423        is_terminated: bool,
8424    ) -> Self {
8425        Self { inner, is_terminated }
8426    }
8427}
8428
8429impl futures::Stream for StorageIteratorRequestStream {
8430    type Item = Result<StorageIteratorRequest, fidl::Error>;
8431
8432    fn poll_next(
8433        mut self: std::pin::Pin<&mut Self>,
8434        cx: &mut std::task::Context<'_>,
8435    ) -> std::task::Poll<Option<Self::Item>> {
8436        let this = &mut *self;
8437        if this.inner.check_shutdown(cx) {
8438            this.is_terminated = true;
8439            return std::task::Poll::Ready(None);
8440        }
8441        if this.is_terminated {
8442            panic!("polled StorageIteratorRequestStream after completion");
8443        }
8444        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
8445            |bytes, handles| {
8446                match this.inner.channel().read_etc(cx, bytes, handles) {
8447                    std::task::Poll::Ready(Ok(())) => {}
8448                    std::task::Poll::Pending => return std::task::Poll::Pending,
8449                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
8450                        this.is_terminated = true;
8451                        return std::task::Poll::Ready(None);
8452                    }
8453                    std::task::Poll::Ready(Err(e)) => {
8454                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
8455                            e.into(),
8456                        ))));
8457                    }
8458                }
8459
8460                // A message has been received from the channel
8461                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
8462
8463                std::task::Poll::Ready(Some(match header.ordinal {
8464                    0x7a6b21f15fd01b72 => {
8465                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
8466                        let mut req = fidl::new_empty!(
8467                            fidl::encoding::EmptyPayload,
8468                            fidl::encoding::DefaultFuchsiaResourceDialect
8469                        );
8470                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
8471                        let control_handle =
8472                            StorageIteratorControlHandle { inner: this.inner.clone() };
8473                        Ok(StorageIteratorRequest::Next {
8474                            responder: StorageIteratorNextResponder {
8475                                control_handle: std::mem::ManuallyDrop::new(control_handle),
8476                                tx_id: header.tx_id,
8477                            },
8478                        })
8479                    }
8480                    _ => Err(fidl::Error::UnknownOrdinal {
8481                        ordinal: header.ordinal,
8482                        protocol_name:
8483                            <StorageIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
8484                    }),
8485                }))
8486            },
8487        )
8488    }
8489}
8490
8491/// An iterator protocol for returning a set of components using a storage
8492/// capability. See |StorageAdmin.ListStorageInRealm| for more information.
8493#[derive(Debug)]
8494pub enum StorageIteratorRequest {
8495    /// Retrieve the next set of components using the storage capability. The
8496    /// returned monikers are relative to the component that declares the
8497    /// storage capability. Returns an empty vector after all components have
8498    /// been returned.
8499    Next { responder: StorageIteratorNextResponder },
8500}
8501
8502impl StorageIteratorRequest {
8503    #[allow(irrefutable_let_patterns)]
8504    pub fn into_next(self) -> Option<(StorageIteratorNextResponder)> {
8505        if let StorageIteratorRequest::Next { responder } = self { Some((responder)) } else { None }
8506    }
8507
8508    /// Name of the method defined in FIDL
8509    pub fn method_name(&self) -> &'static str {
8510        match *self {
8511            StorageIteratorRequest::Next { .. } => "next",
8512        }
8513    }
8514}
8515
8516#[derive(Debug, Clone)]
8517pub struct StorageIteratorControlHandle {
8518    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8519}
8520
8521impl StorageIteratorControlHandle {
8522    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
8523        self.inner.shutdown_with_epitaph(status.into())
8524    }
8525}
8526
8527impl fidl::endpoints::ControlHandle for StorageIteratorControlHandle {
8528    fn shutdown(&self) {
8529        self.inner.shutdown()
8530    }
8531
8532    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
8533        self.inner.shutdown_with_epitaph(status)
8534    }
8535
8536    fn is_closed(&self) -> bool {
8537        self.inner.channel().is_closed()
8538    }
8539    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8540        self.inner.channel().on_closed()
8541    }
8542
8543    #[cfg(target_os = "fuchsia")]
8544    fn signal_peer(
8545        &self,
8546        clear_mask: zx::Signals,
8547        set_mask: zx::Signals,
8548    ) -> Result<(), zx_status::Status> {
8549        use fidl::Peered;
8550        self.inner.channel().signal_peer(clear_mask, set_mask)
8551    }
8552}
8553
8554impl StorageIteratorControlHandle {}
8555
8556#[must_use = "FIDL methods require a response to be sent"]
8557#[derive(Debug)]
8558pub struct StorageIteratorNextResponder {
8559    control_handle: std::mem::ManuallyDrop<StorageIteratorControlHandle>,
8560    tx_id: u32,
8561}
8562
8563/// Set the the channel to be shutdown (see [`StorageIteratorControlHandle::shutdown`])
8564/// if the responder is dropped without sending a response, so that the client
8565/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8566impl std::ops::Drop for StorageIteratorNextResponder {
8567    fn drop(&mut self) {
8568        self.control_handle.shutdown();
8569        // Safety: drops once, never accessed again
8570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8571    }
8572}
8573
8574impl fidl::endpoints::Responder for StorageIteratorNextResponder {
8575    type ControlHandle = StorageIteratorControlHandle;
8576
8577    fn control_handle(&self) -> &StorageIteratorControlHandle {
8578        &self.control_handle
8579    }
8580
8581    fn drop_without_shutdown(mut self) {
8582        // Safety: drops once, never accessed again due to mem::forget
8583        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8584        // Prevent Drop from running (which would shut down the channel)
8585        std::mem::forget(self);
8586    }
8587}
8588
8589impl StorageIteratorNextResponder {
8590    /// Sends a response to the FIDL transaction.
8591    ///
8592    /// Sets the channel to shutdown if an error occurs.
8593    pub fn send(self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
8594        let _result = self.send_raw(relative_monikers);
8595        if _result.is_err() {
8596            self.control_handle.shutdown();
8597        }
8598        self.drop_without_shutdown();
8599        _result
8600    }
8601
8602    /// Similar to "send" but does not shutdown the channel if an error occurs.
8603    pub fn send_no_shutdown_on_err(
8604        self,
8605        mut relative_monikers: &[String],
8606    ) -> Result<(), fidl::Error> {
8607        let _result = self.send_raw(relative_monikers);
8608        self.drop_without_shutdown();
8609        _result
8610    }
8611
8612    fn send_raw(&self, mut relative_monikers: &[String]) -> Result<(), fidl::Error> {
8613        self.control_handle.inner.send::<StorageIteratorNextResponse>(
8614            (relative_monikers,),
8615            self.tx_id,
8616            0x7a6b21f15fd01b72,
8617            fidl::encoding::DynamicFlags::empty(),
8618        )
8619    }
8620}
8621
8622mod internal {
8623    use super::*;
8624
8625    impl fidl::encoding::ResourceTypeMarker for ControllerOpenExposedDirRequest {
8626        type Borrowed<'a> = &'a mut Self;
8627        fn take_or_borrow<'a>(
8628            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8629        ) -> Self::Borrowed<'a> {
8630            value
8631        }
8632    }
8633
8634    unsafe impl fidl::encoding::TypeMarker for ControllerOpenExposedDirRequest {
8635        type Owned = Self;
8636
8637        #[inline(always)]
8638        fn inline_align(_context: fidl::encoding::Context) -> usize {
8639            4
8640        }
8641
8642        #[inline(always)]
8643        fn inline_size(_context: fidl::encoding::Context) -> usize {
8644            4
8645        }
8646    }
8647
8648    unsafe impl
8649        fidl::encoding::Encode<
8650            ControllerOpenExposedDirRequest,
8651            fidl::encoding::DefaultFuchsiaResourceDialect,
8652        > for &mut ControllerOpenExposedDirRequest
8653    {
8654        #[inline]
8655        unsafe fn encode(
8656            self,
8657            encoder: &mut fidl::encoding::Encoder<
8658                '_,
8659                fidl::encoding::DefaultFuchsiaResourceDialect,
8660            >,
8661            offset: usize,
8662            _depth: fidl::encoding::Depth,
8663        ) -> fidl::Result<()> {
8664            encoder.debug_check_bounds::<ControllerOpenExposedDirRequest>(offset);
8665            // Delegate to tuple encoding.
8666            fidl::encoding::Encode::<
8667                ControllerOpenExposedDirRequest,
8668                fidl::encoding::DefaultFuchsiaResourceDialect,
8669            >::encode(
8670                (<fidl::encoding::Endpoint<
8671                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8672                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
8673                    &mut self.exposed_dir
8674                ),),
8675                encoder,
8676                offset,
8677                _depth,
8678            )
8679        }
8680    }
8681    unsafe impl<
8682        T0: fidl::encoding::Encode<
8683                fidl::encoding::Endpoint<
8684                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8685                >,
8686                fidl::encoding::DefaultFuchsiaResourceDialect,
8687            >,
8688    >
8689        fidl::encoding::Encode<
8690            ControllerOpenExposedDirRequest,
8691            fidl::encoding::DefaultFuchsiaResourceDialect,
8692        > for (T0,)
8693    {
8694        #[inline]
8695        unsafe fn encode(
8696            self,
8697            encoder: &mut fidl::encoding::Encoder<
8698                '_,
8699                fidl::encoding::DefaultFuchsiaResourceDialect,
8700            >,
8701            offset: usize,
8702            depth: fidl::encoding::Depth,
8703        ) -> fidl::Result<()> {
8704            encoder.debug_check_bounds::<ControllerOpenExposedDirRequest>(offset);
8705            // Zero out padding regions. There's no need to apply masks
8706            // because the unmasked parts will be overwritten by fields.
8707            // Write the fields.
8708            self.0.encode(encoder, offset + 0, depth)?;
8709            Ok(())
8710        }
8711    }
8712
8713    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8714        for ControllerOpenExposedDirRequest
8715    {
8716        #[inline(always)]
8717        fn new_empty() -> Self {
8718            Self {
8719                exposed_dir: fidl::new_empty!(
8720                    fidl::encoding::Endpoint<
8721                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8722                    >,
8723                    fidl::encoding::DefaultFuchsiaResourceDialect
8724                ),
8725            }
8726        }
8727
8728        #[inline]
8729        unsafe fn decode(
8730            &mut self,
8731            decoder: &mut fidl::encoding::Decoder<
8732                '_,
8733                fidl::encoding::DefaultFuchsiaResourceDialect,
8734            >,
8735            offset: usize,
8736            _depth: fidl::encoding::Depth,
8737        ) -> fidl::Result<()> {
8738            decoder.debug_check_bounds::<Self>(offset);
8739            // Verify that padding bytes are zero.
8740            fidl::decode!(
8741                fidl::encoding::Endpoint<
8742                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
8743                >,
8744                fidl::encoding::DefaultFuchsiaResourceDialect,
8745                &mut self.exposed_dir,
8746                decoder,
8747                offset + 0,
8748                _depth
8749            )?;
8750            Ok(())
8751        }
8752    }
8753
8754    impl fidl::encoding::ResourceTypeMarker for ControllerStartRequest {
8755        type Borrowed<'a> = &'a mut Self;
8756        fn take_or_borrow<'a>(
8757            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8758        ) -> Self::Borrowed<'a> {
8759            value
8760        }
8761    }
8762
8763    unsafe impl fidl::encoding::TypeMarker for ControllerStartRequest {
8764        type Owned = Self;
8765
8766        #[inline(always)]
8767        fn inline_align(_context: fidl::encoding::Context) -> usize {
8768            8
8769        }
8770
8771        #[inline(always)]
8772        fn inline_size(_context: fidl::encoding::Context) -> usize {
8773            24
8774        }
8775    }
8776
8777    unsafe impl
8778        fidl::encoding::Encode<
8779            ControllerStartRequest,
8780            fidl::encoding::DefaultFuchsiaResourceDialect,
8781        > for &mut ControllerStartRequest
8782    {
8783        #[inline]
8784        unsafe fn encode(
8785            self,
8786            encoder: &mut fidl::encoding::Encoder<
8787                '_,
8788                fidl::encoding::DefaultFuchsiaResourceDialect,
8789            >,
8790            offset: usize,
8791            _depth: fidl::encoding::Depth,
8792        ) -> fidl::Result<()> {
8793            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
8794            // Delegate to tuple encoding.
8795            fidl::encoding::Encode::<ControllerStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8796                (
8797                    <StartChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
8798                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.execution_controller),
8799                ),
8800                encoder, offset, _depth
8801            )
8802        }
8803    }
8804    unsafe impl<
8805        T0: fidl::encoding::Encode<StartChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
8806        T1: fidl::encoding::Encode<
8807                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
8808                fidl::encoding::DefaultFuchsiaResourceDialect,
8809            >,
8810    >
8811        fidl::encoding::Encode<
8812            ControllerStartRequest,
8813            fidl::encoding::DefaultFuchsiaResourceDialect,
8814        > for (T0, T1)
8815    {
8816        #[inline]
8817        unsafe fn encode(
8818            self,
8819            encoder: &mut fidl::encoding::Encoder<
8820                '_,
8821                fidl::encoding::DefaultFuchsiaResourceDialect,
8822            >,
8823            offset: usize,
8824            depth: fidl::encoding::Depth,
8825        ) -> fidl::Result<()> {
8826            encoder.debug_check_bounds::<ControllerStartRequest>(offset);
8827            // Zero out padding regions. There's no need to apply masks
8828            // because the unmasked parts will be overwritten by fields.
8829            unsafe {
8830                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8831                (ptr as *mut u64).write_unaligned(0);
8832            }
8833            // Write the fields.
8834            self.0.encode(encoder, offset + 0, depth)?;
8835            self.1.encode(encoder, offset + 16, depth)?;
8836            Ok(())
8837        }
8838    }
8839
8840    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8841        for ControllerStartRequest
8842    {
8843        #[inline(always)]
8844        fn new_empty() -> Self {
8845            Self {
8846                args: fidl::new_empty!(
8847                    StartChildArgs,
8848                    fidl::encoding::DefaultFuchsiaResourceDialect
8849                ),
8850                execution_controller: fidl::new_empty!(
8851                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
8852                    fidl::encoding::DefaultFuchsiaResourceDialect
8853                ),
8854            }
8855        }
8856
8857        #[inline]
8858        unsafe fn decode(
8859            &mut self,
8860            decoder: &mut fidl::encoding::Decoder<
8861                '_,
8862                fidl::encoding::DefaultFuchsiaResourceDialect,
8863            >,
8864            offset: usize,
8865            _depth: fidl::encoding::Depth,
8866        ) -> fidl::Result<()> {
8867            decoder.debug_check_bounds::<Self>(offset);
8868            // Verify that padding bytes are zero.
8869            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8870            let padval = unsafe { (ptr as *const u64).read_unaligned() };
8871            let mask = 0xffffffff00000000u64;
8872            let maskedval = padval & mask;
8873            if maskedval != 0 {
8874                return Err(fidl::Error::NonZeroPadding {
8875                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8876                });
8877            }
8878            fidl::decode!(
8879                StartChildArgs,
8880                fidl::encoding::DefaultFuchsiaResourceDialect,
8881                &mut self.args,
8882                decoder,
8883                offset + 0,
8884                _depth
8885            )?;
8886            fidl::decode!(
8887                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ExecutionControllerMarker>>,
8888                fidl::encoding::DefaultFuchsiaResourceDialect,
8889                &mut self.execution_controller,
8890                decoder,
8891                offset + 16,
8892                _depth
8893            )?;
8894            Ok(())
8895        }
8896    }
8897
8898    impl fidl::encoding::ResourceTypeMarker for ControllerGetExposedDictionaryResponse {
8899        type Borrowed<'a> = &'a mut Self;
8900        fn take_or_borrow<'a>(
8901            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
8902        ) -> Self::Borrowed<'a> {
8903            value
8904        }
8905    }
8906
8907    unsafe impl fidl::encoding::TypeMarker for ControllerGetExposedDictionaryResponse {
8908        type Owned = Self;
8909
8910        #[inline(always)]
8911        fn inline_align(_context: fidl::encoding::Context) -> usize {
8912            4
8913        }
8914
8915        #[inline(always)]
8916        fn inline_size(_context: fidl::encoding::Context) -> usize {
8917            4
8918        }
8919    }
8920
8921    unsafe impl
8922        fidl::encoding::Encode<
8923            ControllerGetExposedDictionaryResponse,
8924            fidl::encoding::DefaultFuchsiaResourceDialect,
8925        > for &mut ControllerGetExposedDictionaryResponse
8926    {
8927        #[inline]
8928        unsafe fn encode(
8929            self,
8930            encoder: &mut fidl::encoding::Encoder<
8931                '_,
8932                fidl::encoding::DefaultFuchsiaResourceDialect,
8933            >,
8934            offset: usize,
8935            _depth: fidl::encoding::Depth,
8936        ) -> fidl::Result<()> {
8937            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
8938            // Delegate to tuple encoding.
8939            fidl::encoding::Encode::<ControllerGetExposedDictionaryResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
8940                (
8941                    <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
8942                ),
8943                encoder, offset, _depth
8944            )
8945        }
8946    }
8947    unsafe impl<
8948        T0: fidl::encoding::Encode<
8949                fidl_fuchsia_component_sandbox::DictionaryRef,
8950                fidl::encoding::DefaultFuchsiaResourceDialect,
8951            >,
8952    >
8953        fidl::encoding::Encode<
8954            ControllerGetExposedDictionaryResponse,
8955            fidl::encoding::DefaultFuchsiaResourceDialect,
8956        > for (T0,)
8957    {
8958        #[inline]
8959        unsafe fn encode(
8960            self,
8961            encoder: &mut fidl::encoding::Encoder<
8962                '_,
8963                fidl::encoding::DefaultFuchsiaResourceDialect,
8964            >,
8965            offset: usize,
8966            depth: fidl::encoding::Depth,
8967        ) -> fidl::Result<()> {
8968            encoder.debug_check_bounds::<ControllerGetExposedDictionaryResponse>(offset);
8969            // Zero out padding regions. There's no need to apply masks
8970            // because the unmasked parts will be overwritten by fields.
8971            // Write the fields.
8972            self.0.encode(encoder, offset + 0, depth)?;
8973            Ok(())
8974        }
8975    }
8976
8977    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
8978        for ControllerGetExposedDictionaryResponse
8979    {
8980        #[inline(always)]
8981        fn new_empty() -> Self {
8982            Self {
8983                dictionary: fidl::new_empty!(
8984                    fidl_fuchsia_component_sandbox::DictionaryRef,
8985                    fidl::encoding::DefaultFuchsiaResourceDialect
8986                ),
8987            }
8988        }
8989
8990        #[inline]
8991        unsafe fn decode(
8992            &mut self,
8993            decoder: &mut fidl::encoding::Decoder<
8994                '_,
8995                fidl::encoding::DefaultFuchsiaResourceDialect,
8996            >,
8997            offset: usize,
8998            _depth: fidl::encoding::Depth,
8999        ) -> fidl::Result<()> {
9000            decoder.debug_check_bounds::<Self>(offset);
9001            // Verify that padding bytes are zero.
9002            fidl::decode!(
9003                fidl_fuchsia_component_sandbox::DictionaryRef,
9004                fidl::encoding::DefaultFuchsiaResourceDialect,
9005                &mut self.dictionary,
9006                decoder,
9007                offset + 0,
9008                _depth
9009            )?;
9010            Ok(())
9011        }
9012    }
9013
9014    impl fidl::encoding::ResourceTypeMarker for ControllerGetOutputDictionaryResponse {
9015        type Borrowed<'a> = &'a mut Self;
9016        fn take_or_borrow<'a>(
9017            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9018        ) -> Self::Borrowed<'a> {
9019            value
9020        }
9021    }
9022
9023    unsafe impl fidl::encoding::TypeMarker for ControllerGetOutputDictionaryResponse {
9024        type Owned = Self;
9025
9026        #[inline(always)]
9027        fn inline_align(_context: fidl::encoding::Context) -> usize {
9028            4
9029        }
9030
9031        #[inline(always)]
9032        fn inline_size(_context: fidl::encoding::Context) -> usize {
9033            4
9034        }
9035    }
9036
9037    unsafe impl
9038        fidl::encoding::Encode<
9039            ControllerGetOutputDictionaryResponse,
9040            fidl::encoding::DefaultFuchsiaResourceDialect,
9041        > for &mut ControllerGetOutputDictionaryResponse
9042    {
9043        #[inline]
9044        unsafe fn encode(
9045            self,
9046            encoder: &mut fidl::encoding::Encoder<
9047                '_,
9048                fidl::encoding::DefaultFuchsiaResourceDialect,
9049            >,
9050            offset: usize,
9051            _depth: fidl::encoding::Depth,
9052        ) -> fidl::Result<()> {
9053            encoder.debug_check_bounds::<ControllerGetOutputDictionaryResponse>(offset);
9054            // Delegate to tuple encoding.
9055            fidl::encoding::Encode::<
9056                ControllerGetOutputDictionaryResponse,
9057                fidl::encoding::DefaultFuchsiaResourceDialect,
9058            >::encode(
9059                (<fidl::encoding::HandleType<
9060                    fidl::EventPair,
9061                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9062                    2147483648,
9063                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9064                    &mut self.dictionary
9065                ),),
9066                encoder,
9067                offset,
9068                _depth,
9069            )
9070        }
9071    }
9072    unsafe impl<
9073        T0: fidl::encoding::Encode<
9074                fidl::encoding::HandleType<
9075                    fidl::EventPair,
9076                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9077                    2147483648,
9078                >,
9079                fidl::encoding::DefaultFuchsiaResourceDialect,
9080            >,
9081    >
9082        fidl::encoding::Encode<
9083            ControllerGetOutputDictionaryResponse,
9084            fidl::encoding::DefaultFuchsiaResourceDialect,
9085        > for (T0,)
9086    {
9087        #[inline]
9088        unsafe fn encode(
9089            self,
9090            encoder: &mut fidl::encoding::Encoder<
9091                '_,
9092                fidl::encoding::DefaultFuchsiaResourceDialect,
9093            >,
9094            offset: usize,
9095            depth: fidl::encoding::Depth,
9096        ) -> fidl::Result<()> {
9097            encoder.debug_check_bounds::<ControllerGetOutputDictionaryResponse>(offset);
9098            // Zero out padding regions. There's no need to apply masks
9099            // because the unmasked parts will be overwritten by fields.
9100            // Write the fields.
9101            self.0.encode(encoder, offset + 0, depth)?;
9102            Ok(())
9103        }
9104    }
9105
9106    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9107        for ControllerGetOutputDictionaryResponse
9108    {
9109        #[inline(always)]
9110        fn new_empty() -> Self {
9111            Self {
9112                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9113            }
9114        }
9115
9116        #[inline]
9117        unsafe fn decode(
9118            &mut self,
9119            decoder: &mut fidl::encoding::Decoder<
9120                '_,
9121                fidl::encoding::DefaultFuchsiaResourceDialect,
9122            >,
9123            offset: usize,
9124            _depth: fidl::encoding::Depth,
9125        ) -> fidl::Result<()> {
9126            decoder.debug_check_bounds::<Self>(offset);
9127            // Verify that padding bytes are zero.
9128            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
9129            Ok(())
9130        }
9131    }
9132
9133    impl fidl::encoding::ResourceTypeMarker for ControllerIsStartedResponse {
9134        type Borrowed<'a> = &'a mut Self;
9135        fn take_or_borrow<'a>(
9136            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9137        ) -> Self::Borrowed<'a> {
9138            value
9139        }
9140    }
9141
9142    unsafe impl fidl::encoding::TypeMarker for ControllerIsStartedResponse {
9143        type Owned = Self;
9144
9145        #[inline(always)]
9146        fn inline_align(_context: fidl::encoding::Context) -> usize {
9147            1
9148        }
9149
9150        #[inline(always)]
9151        fn inline_size(_context: fidl::encoding::Context) -> usize {
9152            1
9153        }
9154    }
9155
9156    unsafe impl
9157        fidl::encoding::Encode<
9158            ControllerIsStartedResponse,
9159            fidl::encoding::DefaultFuchsiaResourceDialect,
9160        > for &mut ControllerIsStartedResponse
9161    {
9162        #[inline]
9163        unsafe fn encode(
9164            self,
9165            encoder: &mut fidl::encoding::Encoder<
9166                '_,
9167                fidl::encoding::DefaultFuchsiaResourceDialect,
9168            >,
9169            offset: usize,
9170            _depth: fidl::encoding::Depth,
9171        ) -> fidl::Result<()> {
9172            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
9173            // Delegate to tuple encoding.
9174            fidl::encoding::Encode::<
9175                ControllerIsStartedResponse,
9176                fidl::encoding::DefaultFuchsiaResourceDialect,
9177            >::encode(
9178                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_started),),
9179                encoder,
9180                offset,
9181                _depth,
9182            )
9183        }
9184    }
9185    unsafe impl<T0: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>>
9186        fidl::encoding::Encode<
9187            ControllerIsStartedResponse,
9188            fidl::encoding::DefaultFuchsiaResourceDialect,
9189        > for (T0,)
9190    {
9191        #[inline]
9192        unsafe fn encode(
9193            self,
9194            encoder: &mut fidl::encoding::Encoder<
9195                '_,
9196                fidl::encoding::DefaultFuchsiaResourceDialect,
9197            >,
9198            offset: usize,
9199            depth: fidl::encoding::Depth,
9200        ) -> fidl::Result<()> {
9201            encoder.debug_check_bounds::<ControllerIsStartedResponse>(offset);
9202            // Zero out padding regions. There's no need to apply masks
9203            // because the unmasked parts will be overwritten by fields.
9204            // Write the fields.
9205            self.0.encode(encoder, offset + 0, depth)?;
9206            Ok(())
9207        }
9208    }
9209
9210    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9211        for ControllerIsStartedResponse
9212    {
9213        #[inline(always)]
9214        fn new_empty() -> Self {
9215            Self {
9216                is_started: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
9217            }
9218        }
9219
9220        #[inline]
9221        unsafe fn decode(
9222            &mut self,
9223            decoder: &mut fidl::encoding::Decoder<
9224                '_,
9225                fidl::encoding::DefaultFuchsiaResourceDialect,
9226            >,
9227            offset: usize,
9228            _depth: fidl::encoding::Depth,
9229        ) -> fidl::Result<()> {
9230            decoder.debug_check_bounds::<Self>(offset);
9231            // Verify that padding bytes are zero.
9232            fidl::decode!(
9233                bool,
9234                fidl::encoding::DefaultFuchsiaResourceDialect,
9235                &mut self.is_started,
9236                decoder,
9237                offset + 0,
9238                _depth
9239            )?;
9240            Ok(())
9241        }
9242    }
9243
9244    impl fidl::encoding::ResourceTypeMarker for EventStreamGetNextResponse {
9245        type Borrowed<'a> = &'a mut Self;
9246        fn take_or_borrow<'a>(
9247            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9248        ) -> Self::Borrowed<'a> {
9249            value
9250        }
9251    }
9252
9253    unsafe impl fidl::encoding::TypeMarker for EventStreamGetNextResponse {
9254        type Owned = Self;
9255
9256        #[inline(always)]
9257        fn inline_align(_context: fidl::encoding::Context) -> usize {
9258            8
9259        }
9260
9261        #[inline(always)]
9262        fn inline_size(_context: fidl::encoding::Context) -> usize {
9263            16
9264        }
9265    }
9266
9267    unsafe impl
9268        fidl::encoding::Encode<
9269            EventStreamGetNextResponse,
9270            fidl::encoding::DefaultFuchsiaResourceDialect,
9271        > for &mut EventStreamGetNextResponse
9272    {
9273        #[inline]
9274        unsafe fn encode(
9275            self,
9276            encoder: &mut fidl::encoding::Encoder<
9277                '_,
9278                fidl::encoding::DefaultFuchsiaResourceDialect,
9279            >,
9280            offset: usize,
9281            _depth: fidl::encoding::Depth,
9282        ) -> fidl::Result<()> {
9283            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
9284            // Delegate to tuple encoding.
9285            fidl::encoding::Encode::<EventStreamGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9286                (
9287                    <fidl::encoding::UnboundedVector<Event> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.events),
9288                ),
9289                encoder, offset, _depth
9290            )
9291        }
9292    }
9293    unsafe impl<
9294        T0: fidl::encoding::Encode<
9295                fidl::encoding::UnboundedVector<Event>,
9296                fidl::encoding::DefaultFuchsiaResourceDialect,
9297            >,
9298    >
9299        fidl::encoding::Encode<
9300            EventStreamGetNextResponse,
9301            fidl::encoding::DefaultFuchsiaResourceDialect,
9302        > for (T0,)
9303    {
9304        #[inline]
9305        unsafe fn encode(
9306            self,
9307            encoder: &mut fidl::encoding::Encoder<
9308                '_,
9309                fidl::encoding::DefaultFuchsiaResourceDialect,
9310            >,
9311            offset: usize,
9312            depth: fidl::encoding::Depth,
9313        ) -> fidl::Result<()> {
9314            encoder.debug_check_bounds::<EventStreamGetNextResponse>(offset);
9315            // Zero out padding regions. There's no need to apply masks
9316            // because the unmasked parts will be overwritten by fields.
9317            // Write the fields.
9318            self.0.encode(encoder, offset + 0, depth)?;
9319            Ok(())
9320        }
9321    }
9322
9323    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9324        for EventStreamGetNextResponse
9325    {
9326        #[inline(always)]
9327        fn new_empty() -> Self {
9328            Self {
9329                events: fidl::new_empty!(
9330                    fidl::encoding::UnboundedVector<Event>,
9331                    fidl::encoding::DefaultFuchsiaResourceDialect
9332                ),
9333            }
9334        }
9335
9336        #[inline]
9337        unsafe fn decode(
9338            &mut self,
9339            decoder: &mut fidl::encoding::Decoder<
9340                '_,
9341                fidl::encoding::DefaultFuchsiaResourceDialect,
9342            >,
9343            offset: usize,
9344            _depth: fidl::encoding::Depth,
9345        ) -> fidl::Result<()> {
9346            decoder.debug_check_bounds::<Self>(offset);
9347            // Verify that padding bytes are zero.
9348            fidl::decode!(
9349                fidl::encoding::UnboundedVector<Event>,
9350                fidl::encoding::DefaultFuchsiaResourceDialect,
9351                &mut self.events,
9352                decoder,
9353                offset + 0,
9354                _depth
9355            )?;
9356            Ok(())
9357        }
9358    }
9359
9360    impl fidl::encoding::ResourceTypeMarker for IntrospectorGetMonikerRequest {
9361        type Borrowed<'a> = &'a mut Self;
9362        fn take_or_borrow<'a>(
9363            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9364        ) -> Self::Borrowed<'a> {
9365            value
9366        }
9367    }
9368
9369    unsafe impl fidl::encoding::TypeMarker for IntrospectorGetMonikerRequest {
9370        type Owned = Self;
9371
9372        #[inline(always)]
9373        fn inline_align(_context: fidl::encoding::Context) -> usize {
9374            4
9375        }
9376
9377        #[inline(always)]
9378        fn inline_size(_context: fidl::encoding::Context) -> usize {
9379            4
9380        }
9381    }
9382
9383    unsafe impl
9384        fidl::encoding::Encode<
9385            IntrospectorGetMonikerRequest,
9386            fidl::encoding::DefaultFuchsiaResourceDialect,
9387        > for &mut IntrospectorGetMonikerRequest
9388    {
9389        #[inline]
9390        unsafe fn encode(
9391            self,
9392            encoder: &mut fidl::encoding::Encoder<
9393                '_,
9394                fidl::encoding::DefaultFuchsiaResourceDialect,
9395            >,
9396            offset: usize,
9397            _depth: fidl::encoding::Depth,
9398        ) -> fidl::Result<()> {
9399            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
9400            // Delegate to tuple encoding.
9401            fidl::encoding::Encode::<
9402                IntrospectorGetMonikerRequest,
9403                fidl::encoding::DefaultFuchsiaResourceDialect,
9404            >::encode(
9405                (<fidl::encoding::HandleType<
9406                    fidl::Event,
9407                    { fidl::ObjectType::EVENT.into_raw() },
9408                    2147483648,
9409                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
9410                    &mut self.component_instance,
9411                ),),
9412                encoder,
9413                offset,
9414                _depth,
9415            )
9416        }
9417    }
9418    unsafe impl<
9419        T0: fidl::encoding::Encode<
9420                fidl::encoding::HandleType<
9421                    fidl::Event,
9422                    { fidl::ObjectType::EVENT.into_raw() },
9423                    2147483648,
9424                >,
9425                fidl::encoding::DefaultFuchsiaResourceDialect,
9426            >,
9427    >
9428        fidl::encoding::Encode<
9429            IntrospectorGetMonikerRequest,
9430            fidl::encoding::DefaultFuchsiaResourceDialect,
9431        > for (T0,)
9432    {
9433        #[inline]
9434        unsafe fn encode(
9435            self,
9436            encoder: &mut fidl::encoding::Encoder<
9437                '_,
9438                fidl::encoding::DefaultFuchsiaResourceDialect,
9439            >,
9440            offset: usize,
9441            depth: fidl::encoding::Depth,
9442        ) -> fidl::Result<()> {
9443            encoder.debug_check_bounds::<IntrospectorGetMonikerRequest>(offset);
9444            // Zero out padding regions. There's no need to apply masks
9445            // because the unmasked parts will be overwritten by fields.
9446            // Write the fields.
9447            self.0.encode(encoder, offset + 0, depth)?;
9448            Ok(())
9449        }
9450    }
9451
9452    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9453        for IntrospectorGetMonikerRequest
9454    {
9455        #[inline(always)]
9456        fn new_empty() -> Self {
9457            Self {
9458                component_instance: fidl::new_empty!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9459            }
9460        }
9461
9462        #[inline]
9463        unsafe fn decode(
9464            &mut self,
9465            decoder: &mut fidl::encoding::Decoder<
9466                '_,
9467                fidl::encoding::DefaultFuchsiaResourceDialect,
9468            >,
9469            offset: usize,
9470            _depth: fidl::encoding::Depth,
9471        ) -> fidl::Result<()> {
9472            decoder.debug_check_bounds::<Self>(offset);
9473            // Verify that padding bytes are zero.
9474            fidl::decode!(fidl::encoding::HandleType<fidl::Event, { fidl::ObjectType::EVENT.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.component_instance, decoder, offset + 0, _depth)?;
9475            Ok(())
9476        }
9477    }
9478
9479    impl fidl::encoding::ResourceTypeMarker for NamespaceCreate2Request {
9480        type Borrowed<'a> = &'a mut Self;
9481        fn take_or_borrow<'a>(
9482            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9483        ) -> Self::Borrowed<'a> {
9484            value
9485        }
9486    }
9487
9488    unsafe impl fidl::encoding::TypeMarker for NamespaceCreate2Request {
9489        type Owned = Self;
9490
9491        #[inline(always)]
9492        fn inline_align(_context: fidl::encoding::Context) -> usize {
9493            8
9494        }
9495
9496        #[inline(always)]
9497        fn inline_size(_context: fidl::encoding::Context) -> usize {
9498            16
9499        }
9500    }
9501
9502    unsafe impl
9503        fidl::encoding::Encode<
9504            NamespaceCreate2Request,
9505            fidl::encoding::DefaultFuchsiaResourceDialect,
9506        > for &mut NamespaceCreate2Request
9507    {
9508        #[inline]
9509        unsafe fn encode(
9510            self,
9511            encoder: &mut fidl::encoding::Encoder<
9512                '_,
9513                fidl::encoding::DefaultFuchsiaResourceDialect,
9514            >,
9515            offset: usize,
9516            _depth: fidl::encoding::Depth,
9517        ) -> fidl::Result<()> {
9518            encoder.debug_check_bounds::<NamespaceCreate2Request>(offset);
9519            // Delegate to tuple encoding.
9520            fidl::encoding::Encode::<NamespaceCreate2Request, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9521                (
9522                    <fidl::encoding::UnboundedVector<NamespaceInputEntry2> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
9523                ),
9524                encoder, offset, _depth
9525            )
9526        }
9527    }
9528    unsafe impl<
9529        T0: fidl::encoding::Encode<
9530                fidl::encoding::UnboundedVector<NamespaceInputEntry2>,
9531                fidl::encoding::DefaultFuchsiaResourceDialect,
9532            >,
9533    >
9534        fidl::encoding::Encode<
9535            NamespaceCreate2Request,
9536            fidl::encoding::DefaultFuchsiaResourceDialect,
9537        > for (T0,)
9538    {
9539        #[inline]
9540        unsafe fn encode(
9541            self,
9542            encoder: &mut fidl::encoding::Encoder<
9543                '_,
9544                fidl::encoding::DefaultFuchsiaResourceDialect,
9545            >,
9546            offset: usize,
9547            depth: fidl::encoding::Depth,
9548        ) -> fidl::Result<()> {
9549            encoder.debug_check_bounds::<NamespaceCreate2Request>(offset);
9550            // Zero out padding regions. There's no need to apply masks
9551            // because the unmasked parts will be overwritten by fields.
9552            // Write the fields.
9553            self.0.encode(encoder, offset + 0, depth)?;
9554            Ok(())
9555        }
9556    }
9557
9558    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9559        for NamespaceCreate2Request
9560    {
9561        #[inline(always)]
9562        fn new_empty() -> Self {
9563            Self {
9564                entries: fidl::new_empty!(
9565                    fidl::encoding::UnboundedVector<NamespaceInputEntry2>,
9566                    fidl::encoding::DefaultFuchsiaResourceDialect
9567                ),
9568            }
9569        }
9570
9571        #[inline]
9572        unsafe fn decode(
9573            &mut self,
9574            decoder: &mut fidl::encoding::Decoder<
9575                '_,
9576                fidl::encoding::DefaultFuchsiaResourceDialect,
9577            >,
9578            offset: usize,
9579            _depth: fidl::encoding::Depth,
9580        ) -> fidl::Result<()> {
9581            decoder.debug_check_bounds::<Self>(offset);
9582            // Verify that padding bytes are zero.
9583            fidl::decode!(
9584                fidl::encoding::UnboundedVector<NamespaceInputEntry2>,
9585                fidl::encoding::DefaultFuchsiaResourceDialect,
9586                &mut self.entries,
9587                decoder,
9588                offset + 0,
9589                _depth
9590            )?;
9591            Ok(())
9592        }
9593    }
9594
9595    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateRequest {
9596        type Borrowed<'a> = &'a mut Self;
9597        fn take_or_borrow<'a>(
9598            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9599        ) -> Self::Borrowed<'a> {
9600            value
9601        }
9602    }
9603
9604    unsafe impl fidl::encoding::TypeMarker for NamespaceCreateRequest {
9605        type Owned = Self;
9606
9607        #[inline(always)]
9608        fn inline_align(_context: fidl::encoding::Context) -> usize {
9609            8
9610        }
9611
9612        #[inline(always)]
9613        fn inline_size(_context: fidl::encoding::Context) -> usize {
9614            16
9615        }
9616    }
9617
9618    unsafe impl
9619        fidl::encoding::Encode<
9620            NamespaceCreateRequest,
9621            fidl::encoding::DefaultFuchsiaResourceDialect,
9622        > for &mut NamespaceCreateRequest
9623    {
9624        #[inline]
9625        unsafe fn encode(
9626            self,
9627            encoder: &mut fidl::encoding::Encoder<
9628                '_,
9629                fidl::encoding::DefaultFuchsiaResourceDialect,
9630            >,
9631            offset: usize,
9632            _depth: fidl::encoding::Depth,
9633        ) -> fidl::Result<()> {
9634            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
9635            // Delegate to tuple encoding.
9636            fidl::encoding::Encode::<NamespaceCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9637                (
9638                    <fidl::encoding::UnboundedVector<NamespaceInputEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
9639                ),
9640                encoder, offset, _depth
9641            )
9642        }
9643    }
9644    unsafe impl<
9645        T0: fidl::encoding::Encode<
9646                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
9647                fidl::encoding::DefaultFuchsiaResourceDialect,
9648            >,
9649    >
9650        fidl::encoding::Encode<
9651            NamespaceCreateRequest,
9652            fidl::encoding::DefaultFuchsiaResourceDialect,
9653        > for (T0,)
9654    {
9655        #[inline]
9656        unsafe fn encode(
9657            self,
9658            encoder: &mut fidl::encoding::Encoder<
9659                '_,
9660                fidl::encoding::DefaultFuchsiaResourceDialect,
9661            >,
9662            offset: usize,
9663            depth: fidl::encoding::Depth,
9664        ) -> fidl::Result<()> {
9665            encoder.debug_check_bounds::<NamespaceCreateRequest>(offset);
9666            // Zero out padding regions. There's no need to apply masks
9667            // because the unmasked parts will be overwritten by fields.
9668            // Write the fields.
9669            self.0.encode(encoder, offset + 0, depth)?;
9670            Ok(())
9671        }
9672    }
9673
9674    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9675        for NamespaceCreateRequest
9676    {
9677        #[inline(always)]
9678        fn new_empty() -> Self {
9679            Self {
9680                entries: fidl::new_empty!(
9681                    fidl::encoding::UnboundedVector<NamespaceInputEntry>,
9682                    fidl::encoding::DefaultFuchsiaResourceDialect
9683                ),
9684            }
9685        }
9686
9687        #[inline]
9688        unsafe fn decode(
9689            &mut self,
9690            decoder: &mut fidl::encoding::Decoder<
9691                '_,
9692                fidl::encoding::DefaultFuchsiaResourceDialect,
9693            >,
9694            offset: usize,
9695            _depth: fidl::encoding::Depth,
9696        ) -> fidl::Result<()> {
9697            decoder.debug_check_bounds::<Self>(offset);
9698            // Verify that padding bytes are zero.
9699            fidl::decode!(
9700                fidl::encoding::UnboundedVector<NamespaceInputEntry>,
9701                fidl::encoding::DefaultFuchsiaResourceDialect,
9702                &mut self.entries,
9703                decoder,
9704                offset + 0,
9705                _depth
9706            )?;
9707            Ok(())
9708        }
9709    }
9710
9711    impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry {
9712        type Borrowed<'a> = &'a mut Self;
9713        fn take_or_borrow<'a>(
9714            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9715        ) -> Self::Borrowed<'a> {
9716            value
9717        }
9718    }
9719
9720    unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry {
9721        type Owned = Self;
9722
9723        #[inline(always)]
9724        fn inline_align(_context: fidl::encoding::Context) -> usize {
9725            8
9726        }
9727
9728        #[inline(always)]
9729        fn inline_size(_context: fidl::encoding::Context) -> usize {
9730            24
9731        }
9732    }
9733
9734    unsafe impl
9735        fidl::encoding::Encode<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
9736        for &mut NamespaceInputEntry
9737    {
9738        #[inline]
9739        unsafe fn encode(
9740            self,
9741            encoder: &mut fidl::encoding::Encoder<
9742                '_,
9743                fidl::encoding::DefaultFuchsiaResourceDialect,
9744            >,
9745            offset: usize,
9746            _depth: fidl::encoding::Depth,
9747        ) -> fidl::Result<()> {
9748            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
9749            // Delegate to tuple encoding.
9750            fidl::encoding::Encode::<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9751                (
9752                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
9753                    <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
9754                ),
9755                encoder, offset, _depth
9756            )
9757        }
9758    }
9759    unsafe impl<
9760        T0: fidl::encoding::Encode<
9761                fidl::encoding::BoundedString<4095>,
9762                fidl::encoding::DefaultFuchsiaResourceDialect,
9763            >,
9764        T1: fidl::encoding::Encode<
9765                fidl::encoding::Endpoint<
9766                    fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
9767                >,
9768                fidl::encoding::DefaultFuchsiaResourceDialect,
9769            >,
9770    > fidl::encoding::Encode<NamespaceInputEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
9771        for (T0, T1)
9772    {
9773        #[inline]
9774        unsafe fn encode(
9775            self,
9776            encoder: &mut fidl::encoding::Encoder<
9777                '_,
9778                fidl::encoding::DefaultFuchsiaResourceDialect,
9779            >,
9780            offset: usize,
9781            depth: fidl::encoding::Depth,
9782        ) -> fidl::Result<()> {
9783            encoder.debug_check_bounds::<NamespaceInputEntry>(offset);
9784            // Zero out padding regions. There's no need to apply masks
9785            // because the unmasked parts will be overwritten by fields.
9786            unsafe {
9787                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9788                (ptr as *mut u64).write_unaligned(0);
9789            }
9790            // Write the fields.
9791            self.0.encode(encoder, offset + 0, depth)?;
9792            self.1.encode(encoder, offset + 16, depth)?;
9793            Ok(())
9794        }
9795    }
9796
9797    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9798        for NamespaceInputEntry
9799    {
9800        #[inline(always)]
9801        fn new_empty() -> Self {
9802            Self {
9803                path: fidl::new_empty!(
9804                    fidl::encoding::BoundedString<4095>,
9805                    fidl::encoding::DefaultFuchsiaResourceDialect
9806                ),
9807                dictionary: fidl::new_empty!(
9808                    fidl::encoding::Endpoint<
9809                        fidl::endpoints::ClientEnd<
9810                            fidl_fuchsia_component_sandbox::DictionaryMarker,
9811                        >,
9812                    >,
9813                    fidl::encoding::DefaultFuchsiaResourceDialect
9814                ),
9815            }
9816        }
9817
9818        #[inline]
9819        unsafe fn decode(
9820            &mut self,
9821            decoder: &mut fidl::encoding::Decoder<
9822                '_,
9823                fidl::encoding::DefaultFuchsiaResourceDialect,
9824            >,
9825            offset: usize,
9826            _depth: fidl::encoding::Depth,
9827        ) -> fidl::Result<()> {
9828            decoder.debug_check_bounds::<Self>(offset);
9829            // Verify that padding bytes are zero.
9830            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9831            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9832            let mask = 0xffffffff00000000u64;
9833            let maskedval = padval & mask;
9834            if maskedval != 0 {
9835                return Err(fidl::Error::NonZeroPadding {
9836                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9837                });
9838            }
9839            fidl::decode!(
9840                fidl::encoding::BoundedString<4095>,
9841                fidl::encoding::DefaultFuchsiaResourceDialect,
9842                &mut self.path,
9843                decoder,
9844                offset + 0,
9845                _depth
9846            )?;
9847            fidl::decode!(
9848                fidl::encoding::Endpoint<
9849                    fidl::endpoints::ClientEnd<fidl_fuchsia_component_sandbox::DictionaryMarker>,
9850                >,
9851                fidl::encoding::DefaultFuchsiaResourceDialect,
9852                &mut self.dictionary,
9853                decoder,
9854                offset + 16,
9855                _depth
9856            )?;
9857            Ok(())
9858        }
9859    }
9860
9861    impl fidl::encoding::ResourceTypeMarker for NamespaceInputEntry2 {
9862        type Borrowed<'a> = &'a mut Self;
9863        fn take_or_borrow<'a>(
9864            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
9865        ) -> Self::Borrowed<'a> {
9866            value
9867        }
9868    }
9869
9870    unsafe impl fidl::encoding::TypeMarker for NamespaceInputEntry2 {
9871        type Owned = Self;
9872
9873        #[inline(always)]
9874        fn inline_align(_context: fidl::encoding::Context) -> usize {
9875            8
9876        }
9877
9878        #[inline(always)]
9879        fn inline_size(_context: fidl::encoding::Context) -> usize {
9880            24
9881        }
9882    }
9883
9884    unsafe impl
9885        fidl::encoding::Encode<NamespaceInputEntry2, fidl::encoding::DefaultFuchsiaResourceDialect>
9886        for &mut NamespaceInputEntry2
9887    {
9888        #[inline]
9889        unsafe fn encode(
9890            self,
9891            encoder: &mut fidl::encoding::Encoder<
9892                '_,
9893                fidl::encoding::DefaultFuchsiaResourceDialect,
9894            >,
9895            offset: usize,
9896            _depth: fidl::encoding::Depth,
9897        ) -> fidl::Result<()> {
9898            encoder.debug_check_bounds::<NamespaceInputEntry2>(offset);
9899            // Delegate to tuple encoding.
9900            fidl::encoding::Encode::<NamespaceInputEntry2, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
9901                (
9902                    <fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow(&self.path),
9903                    <fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.capability),
9904                ),
9905                encoder, offset, _depth
9906            )
9907        }
9908    }
9909    unsafe impl<
9910        T0: fidl::encoding::Encode<
9911                fidl::encoding::BoundedString<4095>,
9912                fidl::encoding::DefaultFuchsiaResourceDialect,
9913            >,
9914        T1: fidl::encoding::Encode<
9915                fidl::encoding::HandleType<
9916                    fidl::EventPair,
9917                    { fidl::ObjectType::EVENTPAIR.into_raw() },
9918                    2147483648,
9919                >,
9920                fidl::encoding::DefaultFuchsiaResourceDialect,
9921            >,
9922    >
9923        fidl::encoding::Encode<NamespaceInputEntry2, fidl::encoding::DefaultFuchsiaResourceDialect>
9924        for (T0, T1)
9925    {
9926        #[inline]
9927        unsafe fn encode(
9928            self,
9929            encoder: &mut fidl::encoding::Encoder<
9930                '_,
9931                fidl::encoding::DefaultFuchsiaResourceDialect,
9932            >,
9933            offset: usize,
9934            depth: fidl::encoding::Depth,
9935        ) -> fidl::Result<()> {
9936            encoder.debug_check_bounds::<NamespaceInputEntry2>(offset);
9937            // Zero out padding regions. There's no need to apply masks
9938            // because the unmasked parts will be overwritten by fields.
9939            unsafe {
9940                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9941                (ptr as *mut u64).write_unaligned(0);
9942            }
9943            // Write the fields.
9944            self.0.encode(encoder, offset + 0, depth)?;
9945            self.1.encode(encoder, offset + 16, depth)?;
9946            Ok(())
9947        }
9948    }
9949
9950    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
9951        for NamespaceInputEntry2
9952    {
9953        #[inline(always)]
9954        fn new_empty() -> Self {
9955            Self {
9956                path: fidl::new_empty!(
9957                    fidl::encoding::BoundedString<4095>,
9958                    fidl::encoding::DefaultFuchsiaResourceDialect
9959                ),
9960                capability: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
9961            }
9962        }
9963
9964        #[inline]
9965        unsafe fn decode(
9966            &mut self,
9967            decoder: &mut fidl::encoding::Decoder<
9968                '_,
9969                fidl::encoding::DefaultFuchsiaResourceDialect,
9970            >,
9971            offset: usize,
9972            _depth: fidl::encoding::Depth,
9973        ) -> fidl::Result<()> {
9974            decoder.debug_check_bounds::<Self>(offset);
9975            // Verify that padding bytes are zero.
9976            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9977            let padval = unsafe { (ptr as *const u64).read_unaligned() };
9978            let mask = 0xffffffff00000000u64;
9979            let maskedval = padval & mask;
9980            if maskedval != 0 {
9981                return Err(fidl::Error::NonZeroPadding {
9982                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9983                });
9984            }
9985            fidl::decode!(
9986                fidl::encoding::BoundedString<4095>,
9987                fidl::encoding::DefaultFuchsiaResourceDialect,
9988                &mut self.path,
9989                decoder,
9990                offset + 0,
9991                _depth
9992            )?;
9993            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.capability, decoder, offset + 16, _depth)?;
9994            Ok(())
9995        }
9996    }
9997
9998    impl fidl::encoding::ResourceTypeMarker for NamespaceCreate2Response {
9999        type Borrowed<'a> = &'a mut Self;
10000        fn take_or_borrow<'a>(
10001            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10002        ) -> Self::Borrowed<'a> {
10003            value
10004        }
10005    }
10006
10007    unsafe impl fidl::encoding::TypeMarker for NamespaceCreate2Response {
10008        type Owned = Self;
10009
10010        #[inline(always)]
10011        fn inline_align(_context: fidl::encoding::Context) -> usize {
10012            8
10013        }
10014
10015        #[inline(always)]
10016        fn inline_size(_context: fidl::encoding::Context) -> usize {
10017            16
10018        }
10019    }
10020
10021    unsafe impl
10022        fidl::encoding::Encode<
10023            NamespaceCreate2Response,
10024            fidl::encoding::DefaultFuchsiaResourceDialect,
10025        > for &mut NamespaceCreate2Response
10026    {
10027        #[inline]
10028        unsafe fn encode(
10029            self,
10030            encoder: &mut fidl::encoding::Encoder<
10031                '_,
10032                fidl::encoding::DefaultFuchsiaResourceDialect,
10033            >,
10034            offset: usize,
10035            _depth: fidl::encoding::Depth,
10036        ) -> fidl::Result<()> {
10037            encoder.debug_check_bounds::<NamespaceCreate2Response>(offset);
10038            // Delegate to tuple encoding.
10039            fidl::encoding::Encode::<NamespaceCreate2Response, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10040                (
10041                    <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
10042                ),
10043                encoder, offset, _depth
10044            )
10045        }
10046    }
10047    unsafe impl<
10048        T0: fidl::encoding::Encode<
10049                fidl::encoding::UnboundedVector<NamespaceEntry>,
10050                fidl::encoding::DefaultFuchsiaResourceDialect,
10051            >,
10052    >
10053        fidl::encoding::Encode<
10054            NamespaceCreate2Response,
10055            fidl::encoding::DefaultFuchsiaResourceDialect,
10056        > for (T0,)
10057    {
10058        #[inline]
10059        unsafe fn encode(
10060            self,
10061            encoder: &mut fidl::encoding::Encoder<
10062                '_,
10063                fidl::encoding::DefaultFuchsiaResourceDialect,
10064            >,
10065            offset: usize,
10066            depth: fidl::encoding::Depth,
10067        ) -> fidl::Result<()> {
10068            encoder.debug_check_bounds::<NamespaceCreate2Response>(offset);
10069            // Zero out padding regions. There's no need to apply masks
10070            // because the unmasked parts will be overwritten by fields.
10071            // Write the fields.
10072            self.0.encode(encoder, offset + 0, depth)?;
10073            Ok(())
10074        }
10075    }
10076
10077    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10078        for NamespaceCreate2Response
10079    {
10080        #[inline(always)]
10081        fn new_empty() -> Self {
10082            Self {
10083                entries: fidl::new_empty!(
10084                    fidl::encoding::UnboundedVector<NamespaceEntry>,
10085                    fidl::encoding::DefaultFuchsiaResourceDialect
10086                ),
10087            }
10088        }
10089
10090        #[inline]
10091        unsafe fn decode(
10092            &mut self,
10093            decoder: &mut fidl::encoding::Decoder<
10094                '_,
10095                fidl::encoding::DefaultFuchsiaResourceDialect,
10096            >,
10097            offset: usize,
10098            _depth: fidl::encoding::Depth,
10099        ) -> fidl::Result<()> {
10100            decoder.debug_check_bounds::<Self>(offset);
10101            // Verify that padding bytes are zero.
10102            fidl::decode!(
10103                fidl::encoding::UnboundedVector<NamespaceEntry>,
10104                fidl::encoding::DefaultFuchsiaResourceDialect,
10105                &mut self.entries,
10106                decoder,
10107                offset + 0,
10108                _depth
10109            )?;
10110            Ok(())
10111        }
10112    }
10113
10114    impl fidl::encoding::ResourceTypeMarker for NamespaceCreateResponse {
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 NamespaceCreateResponse {
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            16
10134        }
10135    }
10136
10137    unsafe impl
10138        fidl::encoding::Encode<
10139            NamespaceCreateResponse,
10140            fidl::encoding::DefaultFuchsiaResourceDialect,
10141        > for &mut NamespaceCreateResponse
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::<NamespaceCreateResponse>(offset);
10154            // Delegate to tuple encoding.
10155            fidl::encoding::Encode::<NamespaceCreateResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10156                (
10157                    <fidl::encoding::UnboundedVector<NamespaceEntry> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.entries),
10158                ),
10159                encoder, offset, _depth
10160            )
10161        }
10162    }
10163    unsafe impl<
10164        T0: fidl::encoding::Encode<
10165                fidl::encoding::UnboundedVector<NamespaceEntry>,
10166                fidl::encoding::DefaultFuchsiaResourceDialect,
10167            >,
10168    >
10169        fidl::encoding::Encode<
10170            NamespaceCreateResponse,
10171            fidl::encoding::DefaultFuchsiaResourceDialect,
10172        > for (T0,)
10173    {
10174        #[inline]
10175        unsafe fn encode(
10176            self,
10177            encoder: &mut fidl::encoding::Encoder<
10178                '_,
10179                fidl::encoding::DefaultFuchsiaResourceDialect,
10180            >,
10181            offset: usize,
10182            depth: fidl::encoding::Depth,
10183        ) -> fidl::Result<()> {
10184            encoder.debug_check_bounds::<NamespaceCreateResponse>(offset);
10185            // Zero out padding regions. There's no need to apply masks
10186            // because the unmasked parts will be overwritten by fields.
10187            // Write the fields.
10188            self.0.encode(encoder, offset + 0, depth)?;
10189            Ok(())
10190        }
10191    }
10192
10193    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10194        for NamespaceCreateResponse
10195    {
10196        #[inline(always)]
10197        fn new_empty() -> Self {
10198            Self {
10199                entries: fidl::new_empty!(
10200                    fidl::encoding::UnboundedVector<NamespaceEntry>,
10201                    fidl::encoding::DefaultFuchsiaResourceDialect
10202                ),
10203            }
10204        }
10205
10206        #[inline]
10207        unsafe fn decode(
10208            &mut self,
10209            decoder: &mut fidl::encoding::Decoder<
10210                '_,
10211                fidl::encoding::DefaultFuchsiaResourceDialect,
10212            >,
10213            offset: usize,
10214            _depth: fidl::encoding::Depth,
10215        ) -> fidl::Result<()> {
10216            decoder.debug_check_bounds::<Self>(offset);
10217            // Verify that padding bytes are zero.
10218            fidl::decode!(
10219                fidl::encoding::UnboundedVector<NamespaceEntry>,
10220                fidl::encoding::DefaultFuchsiaResourceDialect,
10221                &mut self.entries,
10222                decoder,
10223                offset + 0,
10224                _depth
10225            )?;
10226            Ok(())
10227        }
10228    }
10229
10230    impl fidl::encoding::ResourceTypeMarker for RealmCreateChildRequest {
10231        type Borrowed<'a> = &'a mut Self;
10232        fn take_or_borrow<'a>(
10233            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10234        ) -> Self::Borrowed<'a> {
10235            value
10236        }
10237    }
10238
10239    unsafe impl fidl::encoding::TypeMarker for RealmCreateChildRequest {
10240        type Owned = Self;
10241
10242        #[inline(always)]
10243        fn inline_align(_context: fidl::encoding::Context) -> usize {
10244            8
10245        }
10246
10247        #[inline(always)]
10248        fn inline_size(_context: fidl::encoding::Context) -> usize {
10249            48
10250        }
10251    }
10252
10253    unsafe impl
10254        fidl::encoding::Encode<
10255            RealmCreateChildRequest,
10256            fidl::encoding::DefaultFuchsiaResourceDialect,
10257        > for &mut RealmCreateChildRequest
10258    {
10259        #[inline]
10260        unsafe fn encode(
10261            self,
10262            encoder: &mut fidl::encoding::Encoder<
10263                '_,
10264                fidl::encoding::DefaultFuchsiaResourceDialect,
10265            >,
10266            offset: usize,
10267            _depth: fidl::encoding::Depth,
10268        ) -> fidl::Result<()> {
10269            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
10270            // Delegate to tuple encoding.
10271            fidl::encoding::Encode::<RealmCreateChildRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10272                (
10273                    <fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
10274                    <fidl_fuchsia_component_decl::Child as fidl::encoding::ValueTypeMarker>::borrow(&self.decl),
10275                    <CreateChildArgs as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.args),
10276                ),
10277                encoder, offset, _depth
10278            )
10279        }
10280    }
10281    unsafe impl<
10282        T0: fidl::encoding::Encode<
10283                fidl_fuchsia_component_decl::CollectionRef,
10284                fidl::encoding::DefaultFuchsiaResourceDialect,
10285            >,
10286        T1: fidl::encoding::Encode<
10287                fidl_fuchsia_component_decl::Child,
10288                fidl::encoding::DefaultFuchsiaResourceDialect,
10289            >,
10290        T2: fidl::encoding::Encode<CreateChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>,
10291    >
10292        fidl::encoding::Encode<
10293            RealmCreateChildRequest,
10294            fidl::encoding::DefaultFuchsiaResourceDialect,
10295        > for (T0, T1, T2)
10296    {
10297        #[inline]
10298        unsafe fn encode(
10299            self,
10300            encoder: &mut fidl::encoding::Encoder<
10301                '_,
10302                fidl::encoding::DefaultFuchsiaResourceDialect,
10303            >,
10304            offset: usize,
10305            depth: fidl::encoding::Depth,
10306        ) -> fidl::Result<()> {
10307            encoder.debug_check_bounds::<RealmCreateChildRequest>(offset);
10308            // Zero out padding regions. There's no need to apply masks
10309            // because the unmasked parts will be overwritten by fields.
10310            // Write the fields.
10311            self.0.encode(encoder, offset + 0, depth)?;
10312            self.1.encode(encoder, offset + 16, depth)?;
10313            self.2.encode(encoder, offset + 32, depth)?;
10314            Ok(())
10315        }
10316    }
10317
10318    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10319        for RealmCreateChildRequest
10320    {
10321        #[inline(always)]
10322        fn new_empty() -> Self {
10323            Self {
10324                collection: fidl::new_empty!(
10325                    fidl_fuchsia_component_decl::CollectionRef,
10326                    fidl::encoding::DefaultFuchsiaResourceDialect
10327                ),
10328                decl: fidl::new_empty!(
10329                    fidl_fuchsia_component_decl::Child,
10330                    fidl::encoding::DefaultFuchsiaResourceDialect
10331                ),
10332                args: fidl::new_empty!(
10333                    CreateChildArgs,
10334                    fidl::encoding::DefaultFuchsiaResourceDialect
10335                ),
10336            }
10337        }
10338
10339        #[inline]
10340        unsafe fn decode(
10341            &mut self,
10342            decoder: &mut fidl::encoding::Decoder<
10343                '_,
10344                fidl::encoding::DefaultFuchsiaResourceDialect,
10345            >,
10346            offset: usize,
10347            _depth: fidl::encoding::Depth,
10348        ) -> fidl::Result<()> {
10349            decoder.debug_check_bounds::<Self>(offset);
10350            // Verify that padding bytes are zero.
10351            fidl::decode!(
10352                fidl_fuchsia_component_decl::CollectionRef,
10353                fidl::encoding::DefaultFuchsiaResourceDialect,
10354                &mut self.collection,
10355                decoder,
10356                offset + 0,
10357                _depth
10358            )?;
10359            fidl::decode!(
10360                fidl_fuchsia_component_decl::Child,
10361                fidl::encoding::DefaultFuchsiaResourceDialect,
10362                &mut self.decl,
10363                decoder,
10364                offset + 16,
10365                _depth
10366            )?;
10367            fidl::decode!(
10368                CreateChildArgs,
10369                fidl::encoding::DefaultFuchsiaResourceDialect,
10370                &mut self.args,
10371                decoder,
10372                offset + 32,
10373                _depth
10374            )?;
10375            Ok(())
10376        }
10377    }
10378
10379    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryDeprecatedRequest {
10380        type Borrowed<'a> = &'a mut Self;
10381        fn take_or_borrow<'a>(
10382            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10383        ) -> Self::Borrowed<'a> {
10384            value
10385        }
10386    }
10387
10388    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryDeprecatedRequest {
10389        type Owned = Self;
10390
10391        #[inline(always)]
10392        fn inline_align(_context: fidl::encoding::Context) -> usize {
10393            8
10394        }
10395
10396        #[inline(always)]
10397        fn inline_size(_context: fidl::encoding::Context) -> usize {
10398            32
10399        }
10400    }
10401
10402    unsafe impl
10403        fidl::encoding::Encode<
10404            RealmGetChildOutputDictionaryDeprecatedRequest,
10405            fidl::encoding::DefaultFuchsiaResourceDialect,
10406        > for &mut RealmGetChildOutputDictionaryDeprecatedRequest
10407    {
10408        #[inline]
10409        unsafe fn encode(
10410            self,
10411            encoder: &mut fidl::encoding::Encoder<
10412                '_,
10413                fidl::encoding::DefaultFuchsiaResourceDialect,
10414            >,
10415            offset: usize,
10416            _depth: fidl::encoding::Depth,
10417        ) -> fidl::Result<()> {
10418            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedRequest>(offset);
10419            // Delegate to tuple encoding.
10420            fidl::encoding::Encode::<RealmGetChildOutputDictionaryDeprecatedRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10421                (
10422                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
10423                ),
10424                encoder, offset, _depth
10425            )
10426        }
10427    }
10428    unsafe impl<
10429        T0: fidl::encoding::Encode<
10430                fidl_fuchsia_component_decl::ChildRef,
10431                fidl::encoding::DefaultFuchsiaResourceDialect,
10432            >,
10433    >
10434        fidl::encoding::Encode<
10435            RealmGetChildOutputDictionaryDeprecatedRequest,
10436            fidl::encoding::DefaultFuchsiaResourceDialect,
10437        > for (T0,)
10438    {
10439        #[inline]
10440        unsafe fn encode(
10441            self,
10442            encoder: &mut fidl::encoding::Encoder<
10443                '_,
10444                fidl::encoding::DefaultFuchsiaResourceDialect,
10445            >,
10446            offset: usize,
10447            depth: fidl::encoding::Depth,
10448        ) -> fidl::Result<()> {
10449            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedRequest>(offset);
10450            // Zero out padding regions. There's no need to apply masks
10451            // because the unmasked parts will be overwritten by fields.
10452            // Write the fields.
10453            self.0.encode(encoder, offset + 0, depth)?;
10454            Ok(())
10455        }
10456    }
10457
10458    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10459        for RealmGetChildOutputDictionaryDeprecatedRequest
10460    {
10461        #[inline(always)]
10462        fn new_empty() -> Self {
10463            Self {
10464                child: fidl::new_empty!(
10465                    fidl_fuchsia_component_decl::ChildRef,
10466                    fidl::encoding::DefaultFuchsiaResourceDialect
10467                ),
10468            }
10469        }
10470
10471        #[inline]
10472        unsafe fn decode(
10473            &mut self,
10474            decoder: &mut fidl::encoding::Decoder<
10475                '_,
10476                fidl::encoding::DefaultFuchsiaResourceDialect,
10477            >,
10478            offset: usize,
10479            _depth: fidl::encoding::Depth,
10480        ) -> fidl::Result<()> {
10481            decoder.debug_check_bounds::<Self>(offset);
10482            // Verify that padding bytes are zero.
10483            fidl::decode!(
10484                fidl_fuchsia_component_decl::ChildRef,
10485                fidl::encoding::DefaultFuchsiaResourceDialect,
10486                &mut self.child,
10487                decoder,
10488                offset + 0,
10489                _depth
10490            )?;
10491            Ok(())
10492        }
10493    }
10494
10495    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryRequest {
10496        type Borrowed<'a> = &'a mut Self;
10497        fn take_or_borrow<'a>(
10498            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10499        ) -> Self::Borrowed<'a> {
10500            value
10501        }
10502    }
10503
10504    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryRequest {
10505        type Owned = Self;
10506
10507        #[inline(always)]
10508        fn inline_align(_context: fidl::encoding::Context) -> usize {
10509            8
10510        }
10511
10512        #[inline(always)]
10513        fn inline_size(_context: fidl::encoding::Context) -> usize {
10514            32
10515        }
10516    }
10517
10518    unsafe impl
10519        fidl::encoding::Encode<
10520            RealmGetChildOutputDictionaryRequest,
10521            fidl::encoding::DefaultFuchsiaResourceDialect,
10522        > for &mut RealmGetChildOutputDictionaryRequest
10523    {
10524        #[inline]
10525        unsafe fn encode(
10526            self,
10527            encoder: &mut fidl::encoding::Encoder<
10528                '_,
10529                fidl::encoding::DefaultFuchsiaResourceDialect,
10530            >,
10531            offset: usize,
10532            _depth: fidl::encoding::Depth,
10533        ) -> fidl::Result<()> {
10534            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
10535            // Delegate to tuple encoding.
10536            fidl::encoding::Encode::<RealmGetChildOutputDictionaryRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10537                (
10538                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
10539                ),
10540                encoder, offset, _depth
10541            )
10542        }
10543    }
10544    unsafe impl<
10545        T0: fidl::encoding::Encode<
10546                fidl_fuchsia_component_decl::ChildRef,
10547                fidl::encoding::DefaultFuchsiaResourceDialect,
10548            >,
10549    >
10550        fidl::encoding::Encode<
10551            RealmGetChildOutputDictionaryRequest,
10552            fidl::encoding::DefaultFuchsiaResourceDialect,
10553        > for (T0,)
10554    {
10555        #[inline]
10556        unsafe fn encode(
10557            self,
10558            encoder: &mut fidl::encoding::Encoder<
10559                '_,
10560                fidl::encoding::DefaultFuchsiaResourceDialect,
10561            >,
10562            offset: usize,
10563            depth: fidl::encoding::Depth,
10564        ) -> fidl::Result<()> {
10565            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryRequest>(offset);
10566            // Zero out padding regions. There's no need to apply masks
10567            // because the unmasked parts will be overwritten by fields.
10568            // Write the fields.
10569            self.0.encode(encoder, offset + 0, depth)?;
10570            Ok(())
10571        }
10572    }
10573
10574    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10575        for RealmGetChildOutputDictionaryRequest
10576    {
10577        #[inline(always)]
10578        fn new_empty() -> Self {
10579            Self {
10580                child: fidl::new_empty!(
10581                    fidl_fuchsia_component_decl::ChildRef,
10582                    fidl::encoding::DefaultFuchsiaResourceDialect
10583                ),
10584            }
10585        }
10586
10587        #[inline]
10588        unsafe fn decode(
10589            &mut self,
10590            decoder: &mut fidl::encoding::Decoder<
10591                '_,
10592                fidl::encoding::DefaultFuchsiaResourceDialect,
10593            >,
10594            offset: usize,
10595            _depth: fidl::encoding::Depth,
10596        ) -> fidl::Result<()> {
10597            decoder.debug_check_bounds::<Self>(offset);
10598            // Verify that padding bytes are zero.
10599            fidl::decode!(
10600                fidl_fuchsia_component_decl::ChildRef,
10601                fidl::encoding::DefaultFuchsiaResourceDialect,
10602                &mut self.child,
10603                decoder,
10604                offset + 0,
10605                _depth
10606            )?;
10607            Ok(())
10608        }
10609    }
10610
10611    impl fidl::encoding::ResourceTypeMarker for RealmListChildrenRequest {
10612        type Borrowed<'a> = &'a mut Self;
10613        fn take_or_borrow<'a>(
10614            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10615        ) -> Self::Borrowed<'a> {
10616            value
10617        }
10618    }
10619
10620    unsafe impl fidl::encoding::TypeMarker for RealmListChildrenRequest {
10621        type Owned = Self;
10622
10623        #[inline(always)]
10624        fn inline_align(_context: fidl::encoding::Context) -> usize {
10625            8
10626        }
10627
10628        #[inline(always)]
10629        fn inline_size(_context: fidl::encoding::Context) -> usize {
10630            24
10631        }
10632    }
10633
10634    unsafe impl
10635        fidl::encoding::Encode<
10636            RealmListChildrenRequest,
10637            fidl::encoding::DefaultFuchsiaResourceDialect,
10638        > for &mut RealmListChildrenRequest
10639    {
10640        #[inline]
10641        unsafe fn encode(
10642            self,
10643            encoder: &mut fidl::encoding::Encoder<
10644                '_,
10645                fidl::encoding::DefaultFuchsiaResourceDialect,
10646            >,
10647            offset: usize,
10648            _depth: fidl::encoding::Depth,
10649        ) -> fidl::Result<()> {
10650            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
10651            // Delegate to tuple encoding.
10652            fidl::encoding::Encode::<RealmListChildrenRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10653                (
10654                    <fidl_fuchsia_component_decl::CollectionRef as fidl::encoding::ValueTypeMarker>::borrow(&self.collection),
10655                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iter),
10656                ),
10657                encoder, offset, _depth
10658            )
10659        }
10660    }
10661    unsafe impl<
10662        T0: fidl::encoding::Encode<
10663                fidl_fuchsia_component_decl::CollectionRef,
10664                fidl::encoding::DefaultFuchsiaResourceDialect,
10665            >,
10666        T1: fidl::encoding::Encode<
10667                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
10668                fidl::encoding::DefaultFuchsiaResourceDialect,
10669            >,
10670    >
10671        fidl::encoding::Encode<
10672            RealmListChildrenRequest,
10673            fidl::encoding::DefaultFuchsiaResourceDialect,
10674        > for (T0, T1)
10675    {
10676        #[inline]
10677        unsafe fn encode(
10678            self,
10679            encoder: &mut fidl::encoding::Encoder<
10680                '_,
10681                fidl::encoding::DefaultFuchsiaResourceDialect,
10682            >,
10683            offset: usize,
10684            depth: fidl::encoding::Depth,
10685        ) -> fidl::Result<()> {
10686            encoder.debug_check_bounds::<RealmListChildrenRequest>(offset);
10687            // Zero out padding regions. There's no need to apply masks
10688            // because the unmasked parts will be overwritten by fields.
10689            unsafe {
10690                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
10691                (ptr as *mut u64).write_unaligned(0);
10692            }
10693            // Write the fields.
10694            self.0.encode(encoder, offset + 0, depth)?;
10695            self.1.encode(encoder, offset + 16, depth)?;
10696            Ok(())
10697        }
10698    }
10699
10700    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10701        for RealmListChildrenRequest
10702    {
10703        #[inline(always)]
10704        fn new_empty() -> Self {
10705            Self {
10706                collection: fidl::new_empty!(
10707                    fidl_fuchsia_component_decl::CollectionRef,
10708                    fidl::encoding::DefaultFuchsiaResourceDialect
10709                ),
10710                iter: fidl::new_empty!(
10711                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
10712                    fidl::encoding::DefaultFuchsiaResourceDialect
10713                ),
10714            }
10715        }
10716
10717        #[inline]
10718        unsafe fn decode(
10719            &mut self,
10720            decoder: &mut fidl::encoding::Decoder<
10721                '_,
10722                fidl::encoding::DefaultFuchsiaResourceDialect,
10723            >,
10724            offset: usize,
10725            _depth: fidl::encoding::Depth,
10726        ) -> fidl::Result<()> {
10727            decoder.debug_check_bounds::<Self>(offset);
10728            // Verify that padding bytes are zero.
10729            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
10730            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10731            let mask = 0xffffffff00000000u64;
10732            let maskedval = padval & mask;
10733            if maskedval != 0 {
10734                return Err(fidl::Error::NonZeroPadding {
10735                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
10736                });
10737            }
10738            fidl::decode!(
10739                fidl_fuchsia_component_decl::CollectionRef,
10740                fidl::encoding::DefaultFuchsiaResourceDialect,
10741                &mut self.collection,
10742                decoder,
10743                offset + 0,
10744                _depth
10745            )?;
10746            fidl::decode!(
10747                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ChildIteratorMarker>>,
10748                fidl::encoding::DefaultFuchsiaResourceDialect,
10749                &mut self.iter,
10750                decoder,
10751                offset + 16,
10752                _depth
10753            )?;
10754            Ok(())
10755        }
10756    }
10757
10758    impl fidl::encoding::ResourceTypeMarker for RealmOpenControllerRequest {
10759        type Borrowed<'a> = &'a mut Self;
10760        fn take_or_borrow<'a>(
10761            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10762        ) -> Self::Borrowed<'a> {
10763            value
10764        }
10765    }
10766
10767    unsafe impl fidl::encoding::TypeMarker for RealmOpenControllerRequest {
10768        type Owned = Self;
10769
10770        #[inline(always)]
10771        fn inline_align(_context: fidl::encoding::Context) -> usize {
10772            8
10773        }
10774
10775        #[inline(always)]
10776        fn inline_size(_context: fidl::encoding::Context) -> usize {
10777            40
10778        }
10779    }
10780
10781    unsafe impl
10782        fidl::encoding::Encode<
10783            RealmOpenControllerRequest,
10784            fidl::encoding::DefaultFuchsiaResourceDialect,
10785        > for &mut RealmOpenControllerRequest
10786    {
10787        #[inline]
10788        unsafe fn encode(
10789            self,
10790            encoder: &mut fidl::encoding::Encoder<
10791                '_,
10792                fidl::encoding::DefaultFuchsiaResourceDialect,
10793            >,
10794            offset: usize,
10795            _depth: fidl::encoding::Depth,
10796        ) -> fidl::Result<()> {
10797            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
10798            // Delegate to tuple encoding.
10799            fidl::encoding::Encode::<RealmOpenControllerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10800                (
10801                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
10802                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.controller),
10803                ),
10804                encoder, offset, _depth
10805            )
10806        }
10807    }
10808    unsafe impl<
10809        T0: fidl::encoding::Encode<
10810                fidl_fuchsia_component_decl::ChildRef,
10811                fidl::encoding::DefaultFuchsiaResourceDialect,
10812            >,
10813        T1: fidl::encoding::Encode<
10814                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10815                fidl::encoding::DefaultFuchsiaResourceDialect,
10816            >,
10817    >
10818        fidl::encoding::Encode<
10819            RealmOpenControllerRequest,
10820            fidl::encoding::DefaultFuchsiaResourceDialect,
10821        > for (T0, T1)
10822    {
10823        #[inline]
10824        unsafe fn encode(
10825            self,
10826            encoder: &mut fidl::encoding::Encoder<
10827                '_,
10828                fidl::encoding::DefaultFuchsiaResourceDialect,
10829            >,
10830            offset: usize,
10831            depth: fidl::encoding::Depth,
10832        ) -> fidl::Result<()> {
10833            encoder.debug_check_bounds::<RealmOpenControllerRequest>(offset);
10834            // Zero out padding regions. There's no need to apply masks
10835            // because the unmasked parts will be overwritten by fields.
10836            unsafe {
10837                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10838                (ptr as *mut u64).write_unaligned(0);
10839            }
10840            // Write the fields.
10841            self.0.encode(encoder, offset + 0, depth)?;
10842            self.1.encode(encoder, offset + 32, depth)?;
10843            Ok(())
10844        }
10845    }
10846
10847    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10848        for RealmOpenControllerRequest
10849    {
10850        #[inline(always)]
10851        fn new_empty() -> Self {
10852            Self {
10853                child: fidl::new_empty!(
10854                    fidl_fuchsia_component_decl::ChildRef,
10855                    fidl::encoding::DefaultFuchsiaResourceDialect
10856                ),
10857                controller: fidl::new_empty!(
10858                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10859                    fidl::encoding::DefaultFuchsiaResourceDialect
10860                ),
10861            }
10862        }
10863
10864        #[inline]
10865        unsafe fn decode(
10866            &mut self,
10867            decoder: &mut fidl::encoding::Decoder<
10868                '_,
10869                fidl::encoding::DefaultFuchsiaResourceDialect,
10870            >,
10871            offset: usize,
10872            _depth: fidl::encoding::Depth,
10873        ) -> fidl::Result<()> {
10874            decoder.debug_check_bounds::<Self>(offset);
10875            // Verify that padding bytes are zero.
10876            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
10877            let padval = unsafe { (ptr as *const u64).read_unaligned() };
10878            let mask = 0xffffffff00000000u64;
10879            let maskedval = padval & mask;
10880            if maskedval != 0 {
10881                return Err(fidl::Error::NonZeroPadding {
10882                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
10883                });
10884            }
10885            fidl::decode!(
10886                fidl_fuchsia_component_decl::ChildRef,
10887                fidl::encoding::DefaultFuchsiaResourceDialect,
10888                &mut self.child,
10889                decoder,
10890                offset + 0,
10891                _depth
10892            )?;
10893            fidl::decode!(
10894                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
10895                fidl::encoding::DefaultFuchsiaResourceDialect,
10896                &mut self.controller,
10897                decoder,
10898                offset + 32,
10899                _depth
10900            )?;
10901            Ok(())
10902        }
10903    }
10904
10905    impl fidl::encoding::ResourceTypeMarker for RealmOpenExposedDirRequest {
10906        type Borrowed<'a> = &'a mut Self;
10907        fn take_or_borrow<'a>(
10908            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
10909        ) -> Self::Borrowed<'a> {
10910            value
10911        }
10912    }
10913
10914    unsafe impl fidl::encoding::TypeMarker for RealmOpenExposedDirRequest {
10915        type Owned = Self;
10916
10917        #[inline(always)]
10918        fn inline_align(_context: fidl::encoding::Context) -> usize {
10919            8
10920        }
10921
10922        #[inline(always)]
10923        fn inline_size(_context: fidl::encoding::Context) -> usize {
10924            40
10925        }
10926    }
10927
10928    unsafe impl
10929        fidl::encoding::Encode<
10930            RealmOpenExposedDirRequest,
10931            fidl::encoding::DefaultFuchsiaResourceDialect,
10932        > for &mut RealmOpenExposedDirRequest
10933    {
10934        #[inline]
10935        unsafe fn encode(
10936            self,
10937            encoder: &mut fidl::encoding::Encoder<
10938                '_,
10939                fidl::encoding::DefaultFuchsiaResourceDialect,
10940            >,
10941            offset: usize,
10942            _depth: fidl::encoding::Depth,
10943        ) -> fidl::Result<()> {
10944            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
10945            // Delegate to tuple encoding.
10946            fidl::encoding::Encode::<RealmOpenExposedDirRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
10947                (
10948                    <fidl_fuchsia_component_decl::ChildRef as fidl::encoding::ValueTypeMarker>::borrow(&self.child),
10949                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.exposed_dir),
10950                ),
10951                encoder, offset, _depth
10952            )
10953        }
10954    }
10955    unsafe impl<
10956        T0: fidl::encoding::Encode<
10957                fidl_fuchsia_component_decl::ChildRef,
10958                fidl::encoding::DefaultFuchsiaResourceDialect,
10959            >,
10960        T1: fidl::encoding::Encode<
10961                fidl::encoding::Endpoint<
10962                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
10963                >,
10964                fidl::encoding::DefaultFuchsiaResourceDialect,
10965            >,
10966    >
10967        fidl::encoding::Encode<
10968            RealmOpenExposedDirRequest,
10969            fidl::encoding::DefaultFuchsiaResourceDialect,
10970        > for (T0, T1)
10971    {
10972        #[inline]
10973        unsafe fn encode(
10974            self,
10975            encoder: &mut fidl::encoding::Encoder<
10976                '_,
10977                fidl::encoding::DefaultFuchsiaResourceDialect,
10978            >,
10979            offset: usize,
10980            depth: fidl::encoding::Depth,
10981        ) -> fidl::Result<()> {
10982            encoder.debug_check_bounds::<RealmOpenExposedDirRequest>(offset);
10983            // Zero out padding regions. There's no need to apply masks
10984            // because the unmasked parts will be overwritten by fields.
10985            unsafe {
10986                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
10987                (ptr as *mut u64).write_unaligned(0);
10988            }
10989            // Write the fields.
10990            self.0.encode(encoder, offset + 0, depth)?;
10991            self.1.encode(encoder, offset + 32, depth)?;
10992            Ok(())
10993        }
10994    }
10995
10996    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
10997        for RealmOpenExposedDirRequest
10998    {
10999        #[inline(always)]
11000        fn new_empty() -> Self {
11001            Self {
11002                child: fidl::new_empty!(
11003                    fidl_fuchsia_component_decl::ChildRef,
11004                    fidl::encoding::DefaultFuchsiaResourceDialect
11005                ),
11006                exposed_dir: fidl::new_empty!(
11007                    fidl::encoding::Endpoint<
11008                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11009                    >,
11010                    fidl::encoding::DefaultFuchsiaResourceDialect
11011                ),
11012            }
11013        }
11014
11015        #[inline]
11016        unsafe fn decode(
11017            &mut self,
11018            decoder: &mut fidl::encoding::Decoder<
11019                '_,
11020                fidl::encoding::DefaultFuchsiaResourceDialect,
11021            >,
11022            offset: usize,
11023            _depth: fidl::encoding::Depth,
11024        ) -> fidl::Result<()> {
11025            decoder.debug_check_bounds::<Self>(offset);
11026            // Verify that padding bytes are zero.
11027            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
11028            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11029            let mask = 0xffffffff00000000u64;
11030            let maskedval = padval & mask;
11031            if maskedval != 0 {
11032                return Err(fidl::Error::NonZeroPadding {
11033                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
11034                });
11035            }
11036            fidl::decode!(
11037                fidl_fuchsia_component_decl::ChildRef,
11038                fidl::encoding::DefaultFuchsiaResourceDialect,
11039                &mut self.child,
11040                decoder,
11041                offset + 0,
11042                _depth
11043            )?;
11044            fidl::decode!(
11045                fidl::encoding::Endpoint<
11046                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
11047                >,
11048                fidl::encoding::DefaultFuchsiaResourceDialect,
11049                &mut self.exposed_dir,
11050                decoder,
11051                offset + 32,
11052                _depth
11053            )?;
11054            Ok(())
11055        }
11056    }
11057
11058    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryDeprecatedResponse {
11059        type Borrowed<'a> = &'a mut Self;
11060        fn take_or_borrow<'a>(
11061            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11062        ) -> Self::Borrowed<'a> {
11063            value
11064        }
11065    }
11066
11067    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryDeprecatedResponse {
11068        type Owned = Self;
11069
11070        #[inline(always)]
11071        fn inline_align(_context: fidl::encoding::Context) -> usize {
11072            4
11073        }
11074
11075        #[inline(always)]
11076        fn inline_size(_context: fidl::encoding::Context) -> usize {
11077            4
11078        }
11079    }
11080
11081    unsafe impl
11082        fidl::encoding::Encode<
11083            RealmGetChildOutputDictionaryDeprecatedResponse,
11084            fidl::encoding::DefaultFuchsiaResourceDialect,
11085        > for &mut RealmGetChildOutputDictionaryDeprecatedResponse
11086    {
11087        #[inline]
11088        unsafe fn encode(
11089            self,
11090            encoder: &mut fidl::encoding::Encoder<
11091                '_,
11092                fidl::encoding::DefaultFuchsiaResourceDialect,
11093            >,
11094            offset: usize,
11095            _depth: fidl::encoding::Depth,
11096        ) -> fidl::Result<()> {
11097            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedResponse>(offset);
11098            // Delegate to tuple encoding.
11099            fidl::encoding::Encode::<RealmGetChildOutputDictionaryDeprecatedResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11100                (
11101                    <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dictionary),
11102                ),
11103                encoder, offset, _depth
11104            )
11105        }
11106    }
11107    unsafe impl<
11108        T0: fidl::encoding::Encode<
11109                fidl_fuchsia_component_sandbox::DictionaryRef,
11110                fidl::encoding::DefaultFuchsiaResourceDialect,
11111            >,
11112    >
11113        fidl::encoding::Encode<
11114            RealmGetChildOutputDictionaryDeprecatedResponse,
11115            fidl::encoding::DefaultFuchsiaResourceDialect,
11116        > for (T0,)
11117    {
11118        #[inline]
11119        unsafe fn encode(
11120            self,
11121            encoder: &mut fidl::encoding::Encoder<
11122                '_,
11123                fidl::encoding::DefaultFuchsiaResourceDialect,
11124            >,
11125            offset: usize,
11126            depth: fidl::encoding::Depth,
11127        ) -> fidl::Result<()> {
11128            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryDeprecatedResponse>(offset);
11129            // Zero out padding regions. There's no need to apply masks
11130            // because the unmasked parts will be overwritten by fields.
11131            // Write the fields.
11132            self.0.encode(encoder, offset + 0, depth)?;
11133            Ok(())
11134        }
11135    }
11136
11137    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11138        for RealmGetChildOutputDictionaryDeprecatedResponse
11139    {
11140        #[inline(always)]
11141        fn new_empty() -> Self {
11142            Self {
11143                dictionary: fidl::new_empty!(
11144                    fidl_fuchsia_component_sandbox::DictionaryRef,
11145                    fidl::encoding::DefaultFuchsiaResourceDialect
11146                ),
11147            }
11148        }
11149
11150        #[inline]
11151        unsafe fn decode(
11152            &mut self,
11153            decoder: &mut fidl::encoding::Decoder<
11154                '_,
11155                fidl::encoding::DefaultFuchsiaResourceDialect,
11156            >,
11157            offset: usize,
11158            _depth: fidl::encoding::Depth,
11159        ) -> fidl::Result<()> {
11160            decoder.debug_check_bounds::<Self>(offset);
11161            // Verify that padding bytes are zero.
11162            fidl::decode!(
11163                fidl_fuchsia_component_sandbox::DictionaryRef,
11164                fidl::encoding::DefaultFuchsiaResourceDialect,
11165                &mut self.dictionary,
11166                decoder,
11167                offset + 0,
11168                _depth
11169            )?;
11170            Ok(())
11171        }
11172    }
11173
11174    impl fidl::encoding::ResourceTypeMarker for RealmGetChildOutputDictionaryResponse {
11175        type Borrowed<'a> = &'a mut Self;
11176        fn take_or_borrow<'a>(
11177            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11178        ) -> Self::Borrowed<'a> {
11179            value
11180        }
11181    }
11182
11183    unsafe impl fidl::encoding::TypeMarker for RealmGetChildOutputDictionaryResponse {
11184        type Owned = Self;
11185
11186        #[inline(always)]
11187        fn inline_align(_context: fidl::encoding::Context) -> usize {
11188            4
11189        }
11190
11191        #[inline(always)]
11192        fn inline_size(_context: fidl::encoding::Context) -> usize {
11193            4
11194        }
11195    }
11196
11197    unsafe impl
11198        fidl::encoding::Encode<
11199            RealmGetChildOutputDictionaryResponse,
11200            fidl::encoding::DefaultFuchsiaResourceDialect,
11201        > for &mut RealmGetChildOutputDictionaryResponse
11202    {
11203        #[inline]
11204        unsafe fn encode(
11205            self,
11206            encoder: &mut fidl::encoding::Encoder<
11207                '_,
11208                fidl::encoding::DefaultFuchsiaResourceDialect,
11209            >,
11210            offset: usize,
11211            _depth: fidl::encoding::Depth,
11212        ) -> fidl::Result<()> {
11213            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
11214            // Delegate to tuple encoding.
11215            fidl::encoding::Encode::<
11216                RealmGetChildOutputDictionaryResponse,
11217                fidl::encoding::DefaultFuchsiaResourceDialect,
11218            >::encode(
11219                (<fidl::encoding::HandleType<
11220                    fidl::EventPair,
11221                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11222                    2147483648,
11223                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11224                    &mut self.dictionary
11225                ),),
11226                encoder,
11227                offset,
11228                _depth,
11229            )
11230        }
11231    }
11232    unsafe impl<
11233        T0: fidl::encoding::Encode<
11234                fidl::encoding::HandleType<
11235                    fidl::EventPair,
11236                    { fidl::ObjectType::EVENTPAIR.into_raw() },
11237                    2147483648,
11238                >,
11239                fidl::encoding::DefaultFuchsiaResourceDialect,
11240            >,
11241    >
11242        fidl::encoding::Encode<
11243            RealmGetChildOutputDictionaryResponse,
11244            fidl::encoding::DefaultFuchsiaResourceDialect,
11245        > for (T0,)
11246    {
11247        #[inline]
11248        unsafe fn encode(
11249            self,
11250            encoder: &mut fidl::encoding::Encoder<
11251                '_,
11252                fidl::encoding::DefaultFuchsiaResourceDialect,
11253            >,
11254            offset: usize,
11255            depth: fidl::encoding::Depth,
11256        ) -> fidl::Result<()> {
11257            encoder.debug_check_bounds::<RealmGetChildOutputDictionaryResponse>(offset);
11258            // Zero out padding regions. There's no need to apply masks
11259            // because the unmasked parts will be overwritten by fields.
11260            // Write the fields.
11261            self.0.encode(encoder, offset + 0, depth)?;
11262            Ok(())
11263        }
11264    }
11265
11266    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11267        for RealmGetChildOutputDictionaryResponse
11268    {
11269        #[inline(always)]
11270        fn new_empty() -> Self {
11271            Self {
11272                dictionary: fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
11273            }
11274        }
11275
11276        #[inline]
11277        unsafe fn decode(
11278            &mut self,
11279            decoder: &mut fidl::encoding::Decoder<
11280                '_,
11281                fidl::encoding::DefaultFuchsiaResourceDialect,
11282            >,
11283            offset: usize,
11284            _depth: fidl::encoding::Depth,
11285        ) -> fidl::Result<()> {
11286            decoder.debug_check_bounds::<Self>(offset);
11287            // Verify that padding bytes are zero.
11288            fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.dictionary, decoder, offset + 0, _depth)?;
11289            Ok(())
11290        }
11291    }
11292
11293    impl fidl::encoding::ResourceTypeMarker for RealmGetResolvedInfoResponse {
11294        type Borrowed<'a> = &'a mut Self;
11295        fn take_or_borrow<'a>(
11296            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11297        ) -> Self::Borrowed<'a> {
11298            value
11299        }
11300    }
11301
11302    unsafe impl fidl::encoding::TypeMarker for RealmGetResolvedInfoResponse {
11303        type Owned = Self;
11304
11305        #[inline(always)]
11306        fn inline_align(_context: fidl::encoding::Context) -> usize {
11307            8
11308        }
11309
11310        #[inline(always)]
11311        fn inline_size(_context: fidl::encoding::Context) -> usize {
11312            16
11313        }
11314    }
11315
11316    unsafe impl
11317        fidl::encoding::Encode<
11318            RealmGetResolvedInfoResponse,
11319            fidl::encoding::DefaultFuchsiaResourceDialect,
11320        > for &mut RealmGetResolvedInfoResponse
11321    {
11322        #[inline]
11323        unsafe fn encode(
11324            self,
11325            encoder: &mut fidl::encoding::Encoder<
11326                '_,
11327                fidl::encoding::DefaultFuchsiaResourceDialect,
11328            >,
11329            offset: usize,
11330            _depth: fidl::encoding::Depth,
11331        ) -> fidl::Result<()> {
11332            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
11333            // Delegate to tuple encoding.
11334            fidl::encoding::Encode::<RealmGetResolvedInfoResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11335                (
11336                    <fidl_fuchsia_component_resolution::Component as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.resolved_info),
11337                ),
11338                encoder, offset, _depth
11339            )
11340        }
11341    }
11342    unsafe impl<
11343        T0: fidl::encoding::Encode<
11344                fidl_fuchsia_component_resolution::Component,
11345                fidl::encoding::DefaultFuchsiaResourceDialect,
11346            >,
11347    >
11348        fidl::encoding::Encode<
11349            RealmGetResolvedInfoResponse,
11350            fidl::encoding::DefaultFuchsiaResourceDialect,
11351        > for (T0,)
11352    {
11353        #[inline]
11354        unsafe fn encode(
11355            self,
11356            encoder: &mut fidl::encoding::Encoder<
11357                '_,
11358                fidl::encoding::DefaultFuchsiaResourceDialect,
11359            >,
11360            offset: usize,
11361            depth: fidl::encoding::Depth,
11362        ) -> fidl::Result<()> {
11363            encoder.debug_check_bounds::<RealmGetResolvedInfoResponse>(offset);
11364            // Zero out padding regions. There's no need to apply masks
11365            // because the unmasked parts will be overwritten by fields.
11366            // Write the fields.
11367            self.0.encode(encoder, offset + 0, depth)?;
11368            Ok(())
11369        }
11370    }
11371
11372    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11373        for RealmGetResolvedInfoResponse
11374    {
11375        #[inline(always)]
11376        fn new_empty() -> Self {
11377            Self {
11378                resolved_info: fidl::new_empty!(
11379                    fidl_fuchsia_component_resolution::Component,
11380                    fidl::encoding::DefaultFuchsiaResourceDialect
11381                ),
11382            }
11383        }
11384
11385        #[inline]
11386        unsafe fn decode(
11387            &mut self,
11388            decoder: &mut fidl::encoding::Decoder<
11389                '_,
11390                fidl::encoding::DefaultFuchsiaResourceDialect,
11391            >,
11392            offset: usize,
11393            _depth: fidl::encoding::Depth,
11394        ) -> fidl::Result<()> {
11395            decoder.debug_check_bounds::<Self>(offset);
11396            // Verify that padding bytes are zero.
11397            fidl::decode!(
11398                fidl_fuchsia_component_resolution::Component,
11399                fidl::encoding::DefaultFuchsiaResourceDialect,
11400                &mut self.resolved_info,
11401                decoder,
11402                offset + 0,
11403                _depth
11404            )?;
11405            Ok(())
11406        }
11407    }
11408
11409    impl fidl::encoding::ResourceTypeMarker for StorageAdminListStorageInRealmRequest {
11410        type Borrowed<'a> = &'a mut Self;
11411        fn take_or_borrow<'a>(
11412            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11413        ) -> Self::Borrowed<'a> {
11414            value
11415        }
11416    }
11417
11418    unsafe impl fidl::encoding::TypeMarker for StorageAdminListStorageInRealmRequest {
11419        type Owned = Self;
11420
11421        #[inline(always)]
11422        fn inline_align(_context: fidl::encoding::Context) -> usize {
11423            8
11424        }
11425
11426        #[inline(always)]
11427        fn inline_size(_context: fidl::encoding::Context) -> usize {
11428            24
11429        }
11430    }
11431
11432    unsafe impl
11433        fidl::encoding::Encode<
11434            StorageAdminListStorageInRealmRequest,
11435            fidl::encoding::DefaultFuchsiaResourceDialect,
11436        > for &mut StorageAdminListStorageInRealmRequest
11437    {
11438        #[inline]
11439        unsafe fn encode(
11440            self,
11441            encoder: &mut fidl::encoding::Encoder<
11442                '_,
11443                fidl::encoding::DefaultFuchsiaResourceDialect,
11444            >,
11445            offset: usize,
11446            _depth: fidl::encoding::Depth,
11447        ) -> fidl::Result<()> {
11448            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
11449            // Delegate to tuple encoding.
11450            fidl::encoding::Encode::<StorageAdminListStorageInRealmRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11451                (
11452                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
11453                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.iterator),
11454                ),
11455                encoder, offset, _depth
11456            )
11457        }
11458    }
11459    unsafe impl<
11460        T0: fidl::encoding::Encode<
11461                fidl::encoding::BoundedString<4096>,
11462                fidl::encoding::DefaultFuchsiaResourceDialect,
11463            >,
11464        T1: fidl::encoding::Encode<
11465                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
11466                fidl::encoding::DefaultFuchsiaResourceDialect,
11467            >,
11468    >
11469        fidl::encoding::Encode<
11470            StorageAdminListStorageInRealmRequest,
11471            fidl::encoding::DefaultFuchsiaResourceDialect,
11472        > for (T0, T1)
11473    {
11474        #[inline]
11475        unsafe fn encode(
11476            self,
11477            encoder: &mut fidl::encoding::Encoder<
11478                '_,
11479                fidl::encoding::DefaultFuchsiaResourceDialect,
11480            >,
11481            offset: usize,
11482            depth: fidl::encoding::Depth,
11483        ) -> fidl::Result<()> {
11484            encoder.debug_check_bounds::<StorageAdminListStorageInRealmRequest>(offset);
11485            // Zero out padding regions. There's no need to apply masks
11486            // because the unmasked parts will be overwritten by fields.
11487            unsafe {
11488                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11489                (ptr as *mut u64).write_unaligned(0);
11490            }
11491            // Write the fields.
11492            self.0.encode(encoder, offset + 0, depth)?;
11493            self.1.encode(encoder, offset + 16, depth)?;
11494            Ok(())
11495        }
11496    }
11497
11498    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11499        for StorageAdminListStorageInRealmRequest
11500    {
11501        #[inline(always)]
11502        fn new_empty() -> Self {
11503            Self {
11504                relative_moniker: fidl::new_empty!(
11505                    fidl::encoding::BoundedString<4096>,
11506                    fidl::encoding::DefaultFuchsiaResourceDialect
11507                ),
11508                iterator: fidl::new_empty!(
11509                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
11510                    fidl::encoding::DefaultFuchsiaResourceDialect
11511                ),
11512            }
11513        }
11514
11515        #[inline]
11516        unsafe fn decode(
11517            &mut self,
11518            decoder: &mut fidl::encoding::Decoder<
11519                '_,
11520                fidl::encoding::DefaultFuchsiaResourceDialect,
11521            >,
11522            offset: usize,
11523            _depth: fidl::encoding::Depth,
11524        ) -> fidl::Result<()> {
11525            decoder.debug_check_bounds::<Self>(offset);
11526            // Verify that padding bytes are zero.
11527            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11528            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11529            let mask = 0xffffffff00000000u64;
11530            let maskedval = padval & mask;
11531            if maskedval != 0 {
11532                return Err(fidl::Error::NonZeroPadding {
11533                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11534                });
11535            }
11536            fidl::decode!(
11537                fidl::encoding::BoundedString<4096>,
11538                fidl::encoding::DefaultFuchsiaResourceDialect,
11539                &mut self.relative_moniker,
11540                decoder,
11541                offset + 0,
11542                _depth
11543            )?;
11544            fidl::decode!(
11545                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StorageIteratorMarker>>,
11546                fidl::encoding::DefaultFuchsiaResourceDialect,
11547                &mut self.iterator,
11548                decoder,
11549                offset + 16,
11550                _depth
11551            )?;
11552            Ok(())
11553        }
11554    }
11555
11556    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenComponentStorageByIdRequest {
11557        type Borrowed<'a> = &'a mut Self;
11558        fn take_or_borrow<'a>(
11559            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11560        ) -> Self::Borrowed<'a> {
11561            value
11562        }
11563    }
11564
11565    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenComponentStorageByIdRequest {
11566        type Owned = Self;
11567
11568        #[inline(always)]
11569        fn inline_align(_context: fidl::encoding::Context) -> usize {
11570            8
11571        }
11572
11573        #[inline(always)]
11574        fn inline_size(_context: fidl::encoding::Context) -> usize {
11575            24
11576        }
11577    }
11578
11579    unsafe impl
11580        fidl::encoding::Encode<
11581            StorageAdminOpenComponentStorageByIdRequest,
11582            fidl::encoding::DefaultFuchsiaResourceDialect,
11583        > for &mut StorageAdminOpenComponentStorageByIdRequest
11584    {
11585        #[inline]
11586        unsafe fn encode(
11587            self,
11588            encoder: &mut fidl::encoding::Encoder<
11589                '_,
11590                fidl::encoding::DefaultFuchsiaResourceDialect,
11591            >,
11592            offset: usize,
11593            _depth: fidl::encoding::Depth,
11594        ) -> fidl::Result<()> {
11595            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
11596            // Delegate to tuple encoding.
11597            fidl::encoding::Encode::<
11598                StorageAdminOpenComponentStorageByIdRequest,
11599                fidl::encoding::DefaultFuchsiaResourceDialect,
11600            >::encode(
11601                (
11602                    <fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
11603                        &self.id,
11604                    ),
11605                    <fidl::encoding::Endpoint<
11606                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11607                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11608                        &mut self.object
11609                    ),
11610                ),
11611                encoder,
11612                offset,
11613                _depth,
11614            )
11615        }
11616    }
11617    unsafe impl<
11618        T0: fidl::encoding::Encode<
11619                fidl::encoding::BoundedString<64>,
11620                fidl::encoding::DefaultFuchsiaResourceDialect,
11621            >,
11622        T1: fidl::encoding::Encode<
11623                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11624                fidl::encoding::DefaultFuchsiaResourceDialect,
11625            >,
11626    >
11627        fidl::encoding::Encode<
11628            StorageAdminOpenComponentStorageByIdRequest,
11629            fidl::encoding::DefaultFuchsiaResourceDialect,
11630        > for (T0, T1)
11631    {
11632        #[inline]
11633        unsafe fn encode(
11634            self,
11635            encoder: &mut fidl::encoding::Encoder<
11636                '_,
11637                fidl::encoding::DefaultFuchsiaResourceDialect,
11638            >,
11639            offset: usize,
11640            depth: fidl::encoding::Depth,
11641        ) -> fidl::Result<()> {
11642            encoder.debug_check_bounds::<StorageAdminOpenComponentStorageByIdRequest>(offset);
11643            // Zero out padding regions. There's no need to apply masks
11644            // because the unmasked parts will be overwritten by fields.
11645            unsafe {
11646                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11647                (ptr as *mut u64).write_unaligned(0);
11648            }
11649            // Write the fields.
11650            self.0.encode(encoder, offset + 0, depth)?;
11651            self.1.encode(encoder, offset + 16, depth)?;
11652            Ok(())
11653        }
11654    }
11655
11656    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11657        for StorageAdminOpenComponentStorageByIdRequest
11658    {
11659        #[inline(always)]
11660        fn new_empty() -> Self {
11661            Self {
11662                id: fidl::new_empty!(
11663                    fidl::encoding::BoundedString<64>,
11664                    fidl::encoding::DefaultFuchsiaResourceDialect
11665                ),
11666                object: fidl::new_empty!(
11667                    fidl::encoding::Endpoint<
11668                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11669                    >,
11670                    fidl::encoding::DefaultFuchsiaResourceDialect
11671                ),
11672            }
11673        }
11674
11675        #[inline]
11676        unsafe fn decode(
11677            &mut self,
11678            decoder: &mut fidl::encoding::Decoder<
11679                '_,
11680                fidl::encoding::DefaultFuchsiaResourceDialect,
11681            >,
11682            offset: usize,
11683            _depth: fidl::encoding::Depth,
11684        ) -> fidl::Result<()> {
11685            decoder.debug_check_bounds::<Self>(offset);
11686            // Verify that padding bytes are zero.
11687            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11688            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11689            let mask = 0xffffffff00000000u64;
11690            let maskedval = padval & mask;
11691            if maskedval != 0 {
11692                return Err(fidl::Error::NonZeroPadding {
11693                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11694                });
11695            }
11696            fidl::decode!(
11697                fidl::encoding::BoundedString<64>,
11698                fidl::encoding::DefaultFuchsiaResourceDialect,
11699                &mut self.id,
11700                decoder,
11701                offset + 0,
11702                _depth
11703            )?;
11704            fidl::decode!(
11705                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11706                fidl::encoding::DefaultFuchsiaResourceDialect,
11707                &mut self.object,
11708                decoder,
11709                offset + 16,
11710                _depth
11711            )?;
11712            Ok(())
11713        }
11714    }
11715
11716    impl fidl::encoding::ResourceTypeMarker for StorageAdminOpenStorageRequest {
11717        type Borrowed<'a> = &'a mut Self;
11718        fn take_or_borrow<'a>(
11719            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11720        ) -> Self::Borrowed<'a> {
11721            value
11722        }
11723    }
11724
11725    unsafe impl fidl::encoding::TypeMarker for StorageAdminOpenStorageRequest {
11726        type Owned = Self;
11727
11728        #[inline(always)]
11729        fn inline_align(_context: fidl::encoding::Context) -> usize {
11730            8
11731        }
11732
11733        #[inline(always)]
11734        fn inline_size(_context: fidl::encoding::Context) -> usize {
11735            24
11736        }
11737    }
11738
11739    unsafe impl
11740        fidl::encoding::Encode<
11741            StorageAdminOpenStorageRequest,
11742            fidl::encoding::DefaultFuchsiaResourceDialect,
11743        > for &mut StorageAdminOpenStorageRequest
11744    {
11745        #[inline]
11746        unsafe fn encode(
11747            self,
11748            encoder: &mut fidl::encoding::Encoder<
11749                '_,
11750                fidl::encoding::DefaultFuchsiaResourceDialect,
11751            >,
11752            offset: usize,
11753            _depth: fidl::encoding::Depth,
11754        ) -> fidl::Result<()> {
11755            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
11756            // Delegate to tuple encoding.
11757            fidl::encoding::Encode::<StorageAdminOpenStorageRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
11758                (
11759                    <fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow(&self.relative_moniker),
11760                    <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.object),
11761                ),
11762                encoder, offset, _depth
11763            )
11764        }
11765    }
11766    unsafe impl<
11767        T0: fidl::encoding::Encode<
11768                fidl::encoding::BoundedString<4096>,
11769                fidl::encoding::DefaultFuchsiaResourceDialect,
11770            >,
11771        T1: fidl::encoding::Encode<
11772                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11773                fidl::encoding::DefaultFuchsiaResourceDialect,
11774            >,
11775    >
11776        fidl::encoding::Encode<
11777            StorageAdminOpenStorageRequest,
11778            fidl::encoding::DefaultFuchsiaResourceDialect,
11779        > for (T0, T1)
11780    {
11781        #[inline]
11782        unsafe fn encode(
11783            self,
11784            encoder: &mut fidl::encoding::Encoder<
11785                '_,
11786                fidl::encoding::DefaultFuchsiaResourceDialect,
11787            >,
11788            offset: usize,
11789            depth: fidl::encoding::Depth,
11790        ) -> fidl::Result<()> {
11791            encoder.debug_check_bounds::<StorageAdminOpenStorageRequest>(offset);
11792            // Zero out padding regions. There's no need to apply masks
11793            // because the unmasked parts will be overwritten by fields.
11794            unsafe {
11795                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
11796                (ptr as *mut u64).write_unaligned(0);
11797            }
11798            // Write the fields.
11799            self.0.encode(encoder, offset + 0, depth)?;
11800            self.1.encode(encoder, offset + 16, depth)?;
11801            Ok(())
11802        }
11803    }
11804
11805    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
11806        for StorageAdminOpenStorageRequest
11807    {
11808        #[inline(always)]
11809        fn new_empty() -> Self {
11810            Self {
11811                relative_moniker: fidl::new_empty!(
11812                    fidl::encoding::BoundedString<4096>,
11813                    fidl::encoding::DefaultFuchsiaResourceDialect
11814                ),
11815                object: fidl::new_empty!(
11816                    fidl::encoding::Endpoint<
11817                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>,
11818                    >,
11819                    fidl::encoding::DefaultFuchsiaResourceDialect
11820                ),
11821            }
11822        }
11823
11824        #[inline]
11825        unsafe fn decode(
11826            &mut self,
11827            decoder: &mut fidl::encoding::Decoder<
11828                '_,
11829                fidl::encoding::DefaultFuchsiaResourceDialect,
11830            >,
11831            offset: usize,
11832            _depth: fidl::encoding::Depth,
11833        ) -> fidl::Result<()> {
11834            decoder.debug_check_bounds::<Self>(offset);
11835            // Verify that padding bytes are zero.
11836            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
11837            let padval = unsafe { (ptr as *const u64).read_unaligned() };
11838            let mask = 0xffffffff00000000u64;
11839            let maskedval = padval & mask;
11840            if maskedval != 0 {
11841                return Err(fidl::Error::NonZeroPadding {
11842                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
11843                });
11844            }
11845            fidl::decode!(
11846                fidl::encoding::BoundedString<4096>,
11847                fidl::encoding::DefaultFuchsiaResourceDialect,
11848                &mut self.relative_moniker,
11849                decoder,
11850                offset + 0,
11851                _depth
11852            )?;
11853            fidl::decode!(
11854                fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<fidl_fuchsia_io::NodeMarker>>,
11855                fidl::encoding::DefaultFuchsiaResourceDialect,
11856                &mut self.object,
11857                decoder,
11858                offset + 16,
11859                _depth
11860            )?;
11861            Ok(())
11862        }
11863    }
11864
11865    impl CapabilityRequestedPayload {
11866        #[inline(always)]
11867        fn max_ordinal_present(&self) -> u64 {
11868            if let Some(_) = self.capability {
11869                return 2;
11870            }
11871            if let Some(_) = self.name {
11872                return 1;
11873            }
11874            0
11875        }
11876    }
11877
11878    impl fidl::encoding::ResourceTypeMarker for CapabilityRequestedPayload {
11879        type Borrowed<'a> = &'a mut Self;
11880        fn take_or_borrow<'a>(
11881            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11882        ) -> Self::Borrowed<'a> {
11883            value
11884        }
11885    }
11886
11887    unsafe impl fidl::encoding::TypeMarker for CapabilityRequestedPayload {
11888        type Owned = Self;
11889
11890        #[inline(always)]
11891        fn inline_align(_context: fidl::encoding::Context) -> usize {
11892            8
11893        }
11894
11895        #[inline(always)]
11896        fn inline_size(_context: fidl::encoding::Context) -> usize {
11897            16
11898        }
11899    }
11900
11901    unsafe impl
11902        fidl::encoding::Encode<
11903            CapabilityRequestedPayload,
11904            fidl::encoding::DefaultFuchsiaResourceDialect,
11905        > for &mut CapabilityRequestedPayload
11906    {
11907        unsafe fn encode(
11908            self,
11909            encoder: &mut fidl::encoding::Encoder<
11910                '_,
11911                fidl::encoding::DefaultFuchsiaResourceDialect,
11912            >,
11913            offset: usize,
11914            mut depth: fidl::encoding::Depth,
11915        ) -> fidl::Result<()> {
11916            encoder.debug_check_bounds::<CapabilityRequestedPayload>(offset);
11917            // Vector header
11918            let max_ordinal: u64 = self.max_ordinal_present();
11919            encoder.write_num(max_ordinal, offset);
11920            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11921            // Calling encoder.out_of_line_offset(0) is not allowed.
11922            if max_ordinal == 0 {
11923                return Ok(());
11924            }
11925            depth.increment()?;
11926            let envelope_size = 8;
11927            let bytes_len = max_ordinal as usize * envelope_size;
11928            #[allow(unused_variables)]
11929            let offset = encoder.out_of_line_offset(bytes_len);
11930            let mut _prev_end_offset: usize = 0;
11931            if 1 > max_ordinal {
11932                return Ok(());
11933            }
11934
11935            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11936            // are envelope_size bytes.
11937            let cur_offset: usize = (1 - 1) * envelope_size;
11938
11939            // Zero reserved fields.
11940            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11941
11942            // Safety:
11943            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11944            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11945            //   envelope_size bytes, there is always sufficient room.
11946            fidl::encoding::encode_in_envelope_optional::<
11947                fidl::encoding::BoundedString<255>,
11948                fidl::encoding::DefaultFuchsiaResourceDialect,
11949            >(
11950                self.name.as_ref().map(
11951                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
11952                ),
11953                encoder,
11954                offset + cur_offset,
11955                depth,
11956            )?;
11957
11958            _prev_end_offset = cur_offset + envelope_size;
11959            if 2 > max_ordinal {
11960                return Ok(());
11961            }
11962
11963            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11964            // are envelope_size bytes.
11965            let cur_offset: usize = (2 - 1) * envelope_size;
11966
11967            // Zero reserved fields.
11968            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11969
11970            // Safety:
11971            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11972            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11973            //   envelope_size bytes, there is always sufficient room.
11974            fidl::encoding::encode_in_envelope_optional::<
11975                fidl::encoding::HandleType<
11976                    fidl::Channel,
11977                    { fidl::ObjectType::CHANNEL.into_raw() },
11978                    2147483648,
11979                >,
11980                fidl::encoding::DefaultFuchsiaResourceDialect,
11981            >(
11982                self.capability.as_mut().map(
11983                    <fidl::encoding::HandleType<
11984                        fidl::Channel,
11985                        { fidl::ObjectType::CHANNEL.into_raw() },
11986                        2147483648,
11987                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
11988                ),
11989                encoder,
11990                offset + cur_offset,
11991                depth,
11992            )?;
11993
11994            _prev_end_offset = cur_offset + envelope_size;
11995
11996            Ok(())
11997        }
11998    }
11999
12000    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12001        for CapabilityRequestedPayload
12002    {
12003        #[inline(always)]
12004        fn new_empty() -> Self {
12005            Self::default()
12006        }
12007
12008        unsafe fn decode(
12009            &mut self,
12010            decoder: &mut fidl::encoding::Decoder<
12011                '_,
12012                fidl::encoding::DefaultFuchsiaResourceDialect,
12013            >,
12014            offset: usize,
12015            mut depth: fidl::encoding::Depth,
12016        ) -> fidl::Result<()> {
12017            decoder.debug_check_bounds::<Self>(offset);
12018            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12019                None => return Err(fidl::Error::NotNullable),
12020                Some(len) => len,
12021            };
12022            // Calling decoder.out_of_line_offset(0) is not allowed.
12023            if len == 0 {
12024                return Ok(());
12025            };
12026            depth.increment()?;
12027            let envelope_size = 8;
12028            let bytes_len = len * envelope_size;
12029            let offset = decoder.out_of_line_offset(bytes_len)?;
12030            // Decode the envelope for each type.
12031            let mut _next_ordinal_to_read = 0;
12032            let mut next_offset = offset;
12033            let end_offset = offset + bytes_len;
12034            _next_ordinal_to_read += 1;
12035            if next_offset >= end_offset {
12036                return Ok(());
12037            }
12038
12039            // Decode unknown envelopes for gaps in ordinals.
12040            while _next_ordinal_to_read < 1 {
12041                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12042                _next_ordinal_to_read += 1;
12043                next_offset += envelope_size;
12044            }
12045
12046            let next_out_of_line = decoder.next_out_of_line();
12047            let handles_before = decoder.remaining_handles();
12048            if let Some((inlined, num_bytes, num_handles)) =
12049                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12050            {
12051                let member_inline_size =
12052                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
12053                        decoder.context,
12054                    );
12055                if inlined != (member_inline_size <= 4) {
12056                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12057                }
12058                let inner_offset;
12059                let mut inner_depth = depth.clone();
12060                if inlined {
12061                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12062                    inner_offset = next_offset;
12063                } else {
12064                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12065                    inner_depth.increment()?;
12066                }
12067                let val_ref = self.name.get_or_insert_with(|| {
12068                    fidl::new_empty!(
12069                        fidl::encoding::BoundedString<255>,
12070                        fidl::encoding::DefaultFuchsiaResourceDialect
12071                    )
12072                });
12073                fidl::decode!(
12074                    fidl::encoding::BoundedString<255>,
12075                    fidl::encoding::DefaultFuchsiaResourceDialect,
12076                    val_ref,
12077                    decoder,
12078                    inner_offset,
12079                    inner_depth
12080                )?;
12081                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12082                {
12083                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12084                }
12085                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12086                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12087                }
12088            }
12089
12090            next_offset += envelope_size;
12091            _next_ordinal_to_read += 1;
12092            if next_offset >= end_offset {
12093                return Ok(());
12094            }
12095
12096            // Decode unknown envelopes for gaps in ordinals.
12097            while _next_ordinal_to_read < 2 {
12098                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12099                _next_ordinal_to_read += 1;
12100                next_offset += envelope_size;
12101            }
12102
12103            let next_out_of_line = decoder.next_out_of_line();
12104            let handles_before = decoder.remaining_handles();
12105            if let Some((inlined, num_bytes, num_handles)) =
12106                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12107            {
12108                let member_inline_size = <fidl::encoding::HandleType<
12109                    fidl::Channel,
12110                    { fidl::ObjectType::CHANNEL.into_raw() },
12111                    2147483648,
12112                > as fidl::encoding::TypeMarker>::inline_size(
12113                    decoder.context
12114                );
12115                if inlined != (member_inline_size <= 4) {
12116                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12117                }
12118                let inner_offset;
12119                let mut inner_depth = depth.clone();
12120                if inlined {
12121                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12122                    inner_offset = next_offset;
12123                } else {
12124                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12125                    inner_depth.increment()?;
12126                }
12127                let val_ref =
12128                self.capability.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12129                fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12130                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12131                {
12132                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12133                }
12134                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12135                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12136                }
12137            }
12138
12139            next_offset += envelope_size;
12140
12141            // Decode the remaining unknown envelopes.
12142            while next_offset < end_offset {
12143                _next_ordinal_to_read += 1;
12144                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12145                next_offset += envelope_size;
12146            }
12147
12148            Ok(())
12149        }
12150    }
12151
12152    impl CreateChildArgs {
12153        #[inline(always)]
12154        fn max_ordinal_present(&self) -> u64 {
12155            if let Some(_) = self.additional_inputs {
12156                return 5;
12157            }
12158            if let Some(_) = self.dictionary {
12159                return 4;
12160            }
12161            if let Some(_) = self.controller {
12162                return 3;
12163            }
12164            if let Some(_) = self.dynamic_offers {
12165                return 2;
12166            }
12167            if let Some(_) = self.numbered_handles {
12168                return 1;
12169            }
12170            0
12171        }
12172    }
12173
12174    impl fidl::encoding::ResourceTypeMarker for CreateChildArgs {
12175        type Borrowed<'a> = &'a mut Self;
12176        fn take_or_borrow<'a>(
12177            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12178        ) -> Self::Borrowed<'a> {
12179            value
12180        }
12181    }
12182
12183    unsafe impl fidl::encoding::TypeMarker for CreateChildArgs {
12184        type Owned = Self;
12185
12186        #[inline(always)]
12187        fn inline_align(_context: fidl::encoding::Context) -> usize {
12188            8
12189        }
12190
12191        #[inline(always)]
12192        fn inline_size(_context: fidl::encoding::Context) -> usize {
12193            16
12194        }
12195    }
12196
12197    unsafe impl
12198        fidl::encoding::Encode<CreateChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
12199        for &mut CreateChildArgs
12200    {
12201        unsafe fn encode(
12202            self,
12203            encoder: &mut fidl::encoding::Encoder<
12204                '_,
12205                fidl::encoding::DefaultFuchsiaResourceDialect,
12206            >,
12207            offset: usize,
12208            mut depth: fidl::encoding::Depth,
12209        ) -> fidl::Result<()> {
12210            encoder.debug_check_bounds::<CreateChildArgs>(offset);
12211            // Vector header
12212            let max_ordinal: u64 = self.max_ordinal_present();
12213            encoder.write_num(max_ordinal, offset);
12214            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12215            // Calling encoder.out_of_line_offset(0) is not allowed.
12216            if max_ordinal == 0 {
12217                return Ok(());
12218            }
12219            depth.increment()?;
12220            let envelope_size = 8;
12221            let bytes_len = max_ordinal as usize * envelope_size;
12222            #[allow(unused_variables)]
12223            let offset = encoder.out_of_line_offset(bytes_len);
12224            let mut _prev_end_offset: usize = 0;
12225            if 1 > max_ordinal {
12226                return Ok(());
12227            }
12228
12229            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12230            // are envelope_size bytes.
12231            let cur_offset: usize = (1 - 1) * envelope_size;
12232
12233            // Zero reserved fields.
12234            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12235
12236            // Safety:
12237            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12238            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12239            //   envelope_size bytes, there is always sufficient room.
12240            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12241            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12242            encoder, offset + cur_offset, depth
12243        )?;
12244
12245            _prev_end_offset = cur_offset + envelope_size;
12246            if 2 > max_ordinal {
12247                return Ok(());
12248            }
12249
12250            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12251            // are envelope_size bytes.
12252            let cur_offset: usize = (2 - 1) * envelope_size;
12253
12254            // Zero reserved fields.
12255            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12256
12257            // Safety:
12258            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12259            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12260            //   envelope_size bytes, there is always sufficient room.
12261            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12262            self.dynamic_offers.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128> as fidl::encoding::ValueTypeMarker>::borrow),
12263            encoder, offset + cur_offset, depth
12264        )?;
12265
12266            _prev_end_offset = cur_offset + envelope_size;
12267            if 3 > max_ordinal {
12268                return Ok(());
12269            }
12270
12271            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12272            // are envelope_size bytes.
12273            let cur_offset: usize = (3 - 1) * envelope_size;
12274
12275            // Zero reserved fields.
12276            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12277
12278            // Safety:
12279            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12280            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12281            //   envelope_size bytes, there is always sufficient room.
12282            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>, fidl::encoding::DefaultFuchsiaResourceDialect>(
12283            self.controller.as_mut().map(<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12284            encoder, offset + cur_offset, depth
12285        )?;
12286
12287            _prev_end_offset = cur_offset + envelope_size;
12288            if 4 > max_ordinal {
12289                return Ok(());
12290            }
12291
12292            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12293            // are envelope_size bytes.
12294            let cur_offset: usize = (4 - 1) * envelope_size;
12295
12296            // Zero reserved fields.
12297            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12298
12299            // Safety:
12300            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12301            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12302            //   envelope_size bytes, there is always sufficient room.
12303            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
12304            self.dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
12305            encoder, offset + cur_offset, depth
12306        )?;
12307
12308            _prev_end_offset = cur_offset + envelope_size;
12309            if 5 > max_ordinal {
12310                return Ok(());
12311            }
12312
12313            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12314            // are envelope_size bytes.
12315            let cur_offset: usize = (5 - 1) * envelope_size;
12316
12317            // Zero reserved fields.
12318            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12319
12320            // Safety:
12321            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12322            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12323            //   envelope_size bytes, there is always sufficient room.
12324            fidl::encoding::encode_in_envelope_optional::<
12325                fidl::encoding::HandleType<
12326                    fidl::EventPair,
12327                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12328                    2147483648,
12329                >,
12330                fidl::encoding::DefaultFuchsiaResourceDialect,
12331            >(
12332                self.additional_inputs.as_mut().map(
12333                    <fidl::encoding::HandleType<
12334                        fidl::EventPair,
12335                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12336                        2147483648,
12337                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12338                ),
12339                encoder,
12340                offset + cur_offset,
12341                depth,
12342            )?;
12343
12344            _prev_end_offset = cur_offset + envelope_size;
12345
12346            Ok(())
12347        }
12348    }
12349
12350    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12351        for CreateChildArgs
12352    {
12353        #[inline(always)]
12354        fn new_empty() -> Self {
12355            Self::default()
12356        }
12357
12358        unsafe fn decode(
12359            &mut self,
12360            decoder: &mut fidl::encoding::Decoder<
12361                '_,
12362                fidl::encoding::DefaultFuchsiaResourceDialect,
12363            >,
12364            offset: usize,
12365            mut depth: fidl::encoding::Depth,
12366        ) -> fidl::Result<()> {
12367            decoder.debug_check_bounds::<Self>(offset);
12368            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12369                None => return Err(fidl::Error::NotNullable),
12370                Some(len) => len,
12371            };
12372            // Calling decoder.out_of_line_offset(0) is not allowed.
12373            if len == 0 {
12374                return Ok(());
12375            };
12376            depth.increment()?;
12377            let envelope_size = 8;
12378            let bytes_len = len * envelope_size;
12379            let offset = decoder.out_of_line_offset(bytes_len)?;
12380            // Decode the envelope for each type.
12381            let mut _next_ordinal_to_read = 0;
12382            let mut next_offset = offset;
12383            let end_offset = offset + bytes_len;
12384            _next_ordinal_to_read += 1;
12385            if next_offset >= end_offset {
12386                return Ok(());
12387            }
12388
12389            // Decode unknown envelopes for gaps in ordinals.
12390            while _next_ordinal_to_read < 1 {
12391                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12392                _next_ordinal_to_read += 1;
12393                next_offset += envelope_size;
12394            }
12395
12396            let next_out_of_line = decoder.next_out_of_line();
12397            let handles_before = decoder.remaining_handles();
12398            if let Some((inlined, num_bytes, num_handles)) =
12399                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12400            {
12401                let member_inline_size = <fidl::encoding::Vector<
12402                    fidl_fuchsia_process::HandleInfo,
12403                    128,
12404                > as fidl::encoding::TypeMarker>::inline_size(
12405                    decoder.context
12406                );
12407                if inlined != (member_inline_size <= 4) {
12408                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12409                }
12410                let inner_offset;
12411                let mut inner_depth = depth.clone();
12412                if inlined {
12413                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12414                    inner_offset = next_offset;
12415                } else {
12416                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12417                    inner_depth.increment()?;
12418                }
12419                let val_ref =
12420                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
12421                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12422                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12423                {
12424                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12425                }
12426                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12427                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12428                }
12429            }
12430
12431            next_offset += envelope_size;
12432            _next_ordinal_to_read += 1;
12433            if next_offset >= end_offset {
12434                return Ok(());
12435            }
12436
12437            // Decode unknown envelopes for gaps in ordinals.
12438            while _next_ordinal_to_read < 2 {
12439                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12440                _next_ordinal_to_read += 1;
12441                next_offset += envelope_size;
12442            }
12443
12444            let next_out_of_line = decoder.next_out_of_line();
12445            let handles_before = decoder.remaining_handles();
12446            if let Some((inlined, num_bytes, num_handles)) =
12447                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12448            {
12449                let member_inline_size = <fidl::encoding::Vector<
12450                    fidl_fuchsia_component_decl::Offer,
12451                    128,
12452                > as fidl::encoding::TypeMarker>::inline_size(
12453                    decoder.context
12454                );
12455                if inlined != (member_inline_size <= 4) {
12456                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12457                }
12458                let inner_offset;
12459                let mut inner_depth = depth.clone();
12460                if inlined {
12461                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12462                    inner_offset = next_offset;
12463                } else {
12464                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12465                    inner_depth.increment()?;
12466                }
12467                let val_ref =
12468                self.dynamic_offers.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
12469                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_component_decl::Offer, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12470                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12471                {
12472                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12473                }
12474                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12475                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12476                }
12477            }
12478
12479            next_offset += envelope_size;
12480            _next_ordinal_to_read += 1;
12481            if next_offset >= end_offset {
12482                return Ok(());
12483            }
12484
12485            // Decode unknown envelopes for gaps in ordinals.
12486            while _next_ordinal_to_read < 3 {
12487                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12488                _next_ordinal_to_read += 1;
12489                next_offset += envelope_size;
12490            }
12491
12492            let next_out_of_line = decoder.next_out_of_line();
12493            let handles_before = decoder.remaining_handles();
12494            if let Some((inlined, num_bytes, num_handles)) =
12495                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12496            {
12497                let member_inline_size = <fidl::encoding::Endpoint<
12498                    fidl::endpoints::ServerEnd<ControllerMarker>,
12499                > as fidl::encoding::TypeMarker>::inline_size(
12500                    decoder.context
12501                );
12502                if inlined != (member_inline_size <= 4) {
12503                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12504                }
12505                let inner_offset;
12506                let mut inner_depth = depth.clone();
12507                if inlined {
12508                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12509                    inner_offset = next_offset;
12510                } else {
12511                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12512                    inner_depth.increment()?;
12513                }
12514                let val_ref = self.controller.get_or_insert_with(|| {
12515                    fidl::new_empty!(
12516                        fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
12517                        fidl::encoding::DefaultFuchsiaResourceDialect
12518                    )
12519                });
12520                fidl::decode!(
12521                    fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
12522                    fidl::encoding::DefaultFuchsiaResourceDialect,
12523                    val_ref,
12524                    decoder,
12525                    inner_offset,
12526                    inner_depth
12527                )?;
12528                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12529                {
12530                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12531                }
12532                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12533                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12534                }
12535            }
12536
12537            next_offset += envelope_size;
12538            _next_ordinal_to_read += 1;
12539            if next_offset >= end_offset {
12540                return Ok(());
12541            }
12542
12543            // Decode unknown envelopes for gaps in ordinals.
12544            while _next_ordinal_to_read < 4 {
12545                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12546                _next_ordinal_to_read += 1;
12547                next_offset += envelope_size;
12548            }
12549
12550            let next_out_of_line = decoder.next_out_of_line();
12551            let handles_before = decoder.remaining_handles();
12552            if let Some((inlined, num_bytes, num_handles)) =
12553                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12554            {
12555                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12556                if inlined != (member_inline_size <= 4) {
12557                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12558                }
12559                let inner_offset;
12560                let mut inner_depth = depth.clone();
12561                if inlined {
12562                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12563                    inner_offset = next_offset;
12564                } else {
12565                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12566                    inner_depth.increment()?;
12567                }
12568                let val_ref = self.dictionary.get_or_insert_with(|| {
12569                    fidl::new_empty!(
12570                        fidl_fuchsia_component_sandbox::DictionaryRef,
12571                        fidl::encoding::DefaultFuchsiaResourceDialect
12572                    )
12573                });
12574                fidl::decode!(
12575                    fidl_fuchsia_component_sandbox::DictionaryRef,
12576                    fidl::encoding::DefaultFuchsiaResourceDialect,
12577                    val_ref,
12578                    decoder,
12579                    inner_offset,
12580                    inner_depth
12581                )?;
12582                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12583                {
12584                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12585                }
12586                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12587                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12588                }
12589            }
12590
12591            next_offset += envelope_size;
12592            _next_ordinal_to_read += 1;
12593            if next_offset >= end_offset {
12594                return Ok(());
12595            }
12596
12597            // Decode unknown envelopes for gaps in ordinals.
12598            while _next_ordinal_to_read < 5 {
12599                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12600                _next_ordinal_to_read += 1;
12601                next_offset += envelope_size;
12602            }
12603
12604            let next_out_of_line = decoder.next_out_of_line();
12605            let handles_before = decoder.remaining_handles();
12606            if let Some((inlined, num_bytes, num_handles)) =
12607                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12608            {
12609                let member_inline_size = <fidl::encoding::HandleType<
12610                    fidl::EventPair,
12611                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12612                    2147483648,
12613                > as fidl::encoding::TypeMarker>::inline_size(
12614                    decoder.context
12615                );
12616                if inlined != (member_inline_size <= 4) {
12617                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12618                }
12619                let inner_offset;
12620                let mut inner_depth = depth.clone();
12621                if inlined {
12622                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12623                    inner_offset = next_offset;
12624                } else {
12625                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12626                    inner_depth.increment()?;
12627                }
12628                let val_ref =
12629                self.additional_inputs.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
12630                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12631                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12632                {
12633                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12634                }
12635                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12636                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12637                }
12638            }
12639
12640            next_offset += envelope_size;
12641
12642            // Decode the remaining unknown envelopes.
12643            while next_offset < end_offset {
12644                _next_ordinal_to_read += 1;
12645                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12646                next_offset += envelope_size;
12647            }
12648
12649            Ok(())
12650        }
12651    }
12652
12653    impl DebugStartedPayload {
12654        #[inline(always)]
12655        fn max_ordinal_present(&self) -> u64 {
12656            if let Some(_) = self.break_on_start {
12657                return 2;
12658            }
12659            if let Some(_) = self.runtime_dir {
12660                return 1;
12661            }
12662            0
12663        }
12664    }
12665
12666    impl fidl::encoding::ResourceTypeMarker for DebugStartedPayload {
12667        type Borrowed<'a> = &'a mut Self;
12668        fn take_or_borrow<'a>(
12669            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12670        ) -> Self::Borrowed<'a> {
12671            value
12672        }
12673    }
12674
12675    unsafe impl fidl::encoding::TypeMarker for DebugStartedPayload {
12676        type Owned = Self;
12677
12678        #[inline(always)]
12679        fn inline_align(_context: fidl::encoding::Context) -> usize {
12680            8
12681        }
12682
12683        #[inline(always)]
12684        fn inline_size(_context: fidl::encoding::Context) -> usize {
12685            16
12686        }
12687    }
12688
12689    unsafe impl
12690        fidl::encoding::Encode<DebugStartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
12691        for &mut DebugStartedPayload
12692    {
12693        unsafe fn encode(
12694            self,
12695            encoder: &mut fidl::encoding::Encoder<
12696                '_,
12697                fidl::encoding::DefaultFuchsiaResourceDialect,
12698            >,
12699            offset: usize,
12700            mut depth: fidl::encoding::Depth,
12701        ) -> fidl::Result<()> {
12702            encoder.debug_check_bounds::<DebugStartedPayload>(offset);
12703            // Vector header
12704            let max_ordinal: u64 = self.max_ordinal_present();
12705            encoder.write_num(max_ordinal, offset);
12706            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12707            // Calling encoder.out_of_line_offset(0) is not allowed.
12708            if max_ordinal == 0 {
12709                return Ok(());
12710            }
12711            depth.increment()?;
12712            let envelope_size = 8;
12713            let bytes_len = max_ordinal as usize * envelope_size;
12714            #[allow(unused_variables)]
12715            let offset = encoder.out_of_line_offset(bytes_len);
12716            let mut _prev_end_offset: usize = 0;
12717            if 1 > max_ordinal {
12718                return Ok(());
12719            }
12720
12721            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12722            // are envelope_size bytes.
12723            let cur_offset: usize = (1 - 1) * envelope_size;
12724
12725            // Zero reserved fields.
12726            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12727
12728            // Safety:
12729            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12730            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12731            //   envelope_size bytes, there is always sufficient room.
12732            fidl::encoding::encode_in_envelope_optional::<
12733                fidl::encoding::Endpoint<
12734                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12735                >,
12736                fidl::encoding::DefaultFuchsiaResourceDialect,
12737            >(
12738                self.runtime_dir.as_mut().map(
12739                    <fidl::encoding::Endpoint<
12740                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12741                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12742                ),
12743                encoder,
12744                offset + cur_offset,
12745                depth,
12746            )?;
12747
12748            _prev_end_offset = cur_offset + envelope_size;
12749            if 2 > max_ordinal {
12750                return Ok(());
12751            }
12752
12753            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12754            // are envelope_size bytes.
12755            let cur_offset: usize = (2 - 1) * envelope_size;
12756
12757            // Zero reserved fields.
12758            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12759
12760            // Safety:
12761            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12762            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12763            //   envelope_size bytes, there is always sufficient room.
12764            fidl::encoding::encode_in_envelope_optional::<
12765                fidl::encoding::HandleType<
12766                    fidl::EventPair,
12767                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12768                    2147483648,
12769                >,
12770                fidl::encoding::DefaultFuchsiaResourceDialect,
12771            >(
12772                self.break_on_start.as_mut().map(
12773                    <fidl::encoding::HandleType<
12774                        fidl::EventPair,
12775                        { fidl::ObjectType::EVENTPAIR.into_raw() },
12776                        2147483648,
12777                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
12778                ),
12779                encoder,
12780                offset + cur_offset,
12781                depth,
12782            )?;
12783
12784            _prev_end_offset = cur_offset + envelope_size;
12785
12786            Ok(())
12787        }
12788    }
12789
12790    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12791        for DebugStartedPayload
12792    {
12793        #[inline(always)]
12794        fn new_empty() -> Self {
12795            Self::default()
12796        }
12797
12798        unsafe fn decode(
12799            &mut self,
12800            decoder: &mut fidl::encoding::Decoder<
12801                '_,
12802                fidl::encoding::DefaultFuchsiaResourceDialect,
12803            >,
12804            offset: usize,
12805            mut depth: fidl::encoding::Depth,
12806        ) -> fidl::Result<()> {
12807            decoder.debug_check_bounds::<Self>(offset);
12808            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12809                None => return Err(fidl::Error::NotNullable),
12810                Some(len) => len,
12811            };
12812            // Calling decoder.out_of_line_offset(0) is not allowed.
12813            if len == 0 {
12814                return Ok(());
12815            };
12816            depth.increment()?;
12817            let envelope_size = 8;
12818            let bytes_len = len * envelope_size;
12819            let offset = decoder.out_of_line_offset(bytes_len)?;
12820            // Decode the envelope for each type.
12821            let mut _next_ordinal_to_read = 0;
12822            let mut next_offset = offset;
12823            let end_offset = offset + bytes_len;
12824            _next_ordinal_to_read += 1;
12825            if next_offset >= end_offset {
12826                return Ok(());
12827            }
12828
12829            // Decode unknown envelopes for gaps in ordinals.
12830            while _next_ordinal_to_read < 1 {
12831                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12832                _next_ordinal_to_read += 1;
12833                next_offset += envelope_size;
12834            }
12835
12836            let next_out_of_line = decoder.next_out_of_line();
12837            let handles_before = decoder.remaining_handles();
12838            if let Some((inlined, num_bytes, num_handles)) =
12839                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12840            {
12841                let member_inline_size = <fidl::encoding::Endpoint<
12842                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12843                > as fidl::encoding::TypeMarker>::inline_size(
12844                    decoder.context
12845                );
12846                if inlined != (member_inline_size <= 4) {
12847                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12848                }
12849                let inner_offset;
12850                let mut inner_depth = depth.clone();
12851                if inlined {
12852                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12853                    inner_offset = next_offset;
12854                } else {
12855                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12856                    inner_depth.increment()?;
12857                }
12858                let val_ref = self.runtime_dir.get_or_insert_with(|| {
12859                    fidl::new_empty!(
12860                        fidl::encoding::Endpoint<
12861                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12862                        >,
12863                        fidl::encoding::DefaultFuchsiaResourceDialect
12864                    )
12865                });
12866                fidl::decode!(
12867                    fidl::encoding::Endpoint<
12868                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
12869                    >,
12870                    fidl::encoding::DefaultFuchsiaResourceDialect,
12871                    val_ref,
12872                    decoder,
12873                    inner_offset,
12874                    inner_depth
12875                )?;
12876                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12877                {
12878                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12879                }
12880                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12881                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12882                }
12883            }
12884
12885            next_offset += envelope_size;
12886            _next_ordinal_to_read += 1;
12887            if next_offset >= end_offset {
12888                return Ok(());
12889            }
12890
12891            // Decode unknown envelopes for gaps in ordinals.
12892            while _next_ordinal_to_read < 2 {
12893                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12894                _next_ordinal_to_read += 1;
12895                next_offset += envelope_size;
12896            }
12897
12898            let next_out_of_line = decoder.next_out_of_line();
12899            let handles_before = decoder.remaining_handles();
12900            if let Some((inlined, num_bytes, num_handles)) =
12901                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12902            {
12903                let member_inline_size = <fidl::encoding::HandleType<
12904                    fidl::EventPair,
12905                    { fidl::ObjectType::EVENTPAIR.into_raw() },
12906                    2147483648,
12907                > as fidl::encoding::TypeMarker>::inline_size(
12908                    decoder.context
12909                );
12910                if inlined != (member_inline_size <= 4) {
12911                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12912                }
12913                let inner_offset;
12914                let mut inner_depth = depth.clone();
12915                if inlined {
12916                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12917                    inner_offset = next_offset;
12918                } else {
12919                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12920                    inner_depth.increment()?;
12921                }
12922                let val_ref =
12923                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));
12924                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
12925                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12926                {
12927                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12928                }
12929                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12930                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12931                }
12932            }
12933
12934            next_offset += envelope_size;
12935
12936            // Decode the remaining unknown envelopes.
12937            while next_offset < end_offset {
12938                _next_ordinal_to_read += 1;
12939                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12940                next_offset += envelope_size;
12941            }
12942
12943            Ok(())
12944        }
12945    }
12946
12947    impl Event {
12948        #[inline(always)]
12949        fn max_ordinal_present(&self) -> u64 {
12950            if let Some(_) = self.payload {
12951                return 2;
12952            }
12953            if let Some(_) = self.header {
12954                return 1;
12955            }
12956            0
12957        }
12958    }
12959
12960    impl fidl::encoding::ResourceTypeMarker for Event {
12961        type Borrowed<'a> = &'a mut Self;
12962        fn take_or_borrow<'a>(
12963            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12964        ) -> Self::Borrowed<'a> {
12965            value
12966        }
12967    }
12968
12969    unsafe impl fidl::encoding::TypeMarker for Event {
12970        type Owned = Self;
12971
12972        #[inline(always)]
12973        fn inline_align(_context: fidl::encoding::Context) -> usize {
12974            8
12975        }
12976
12977        #[inline(always)]
12978        fn inline_size(_context: fidl::encoding::Context) -> usize {
12979            16
12980        }
12981    }
12982
12983    unsafe impl fidl::encoding::Encode<Event, fidl::encoding::DefaultFuchsiaResourceDialect>
12984        for &mut Event
12985    {
12986        unsafe fn encode(
12987            self,
12988            encoder: &mut fidl::encoding::Encoder<
12989                '_,
12990                fidl::encoding::DefaultFuchsiaResourceDialect,
12991            >,
12992            offset: usize,
12993            mut depth: fidl::encoding::Depth,
12994        ) -> fidl::Result<()> {
12995            encoder.debug_check_bounds::<Event>(offset);
12996            // Vector header
12997            let max_ordinal: u64 = self.max_ordinal_present();
12998            encoder.write_num(max_ordinal, offset);
12999            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13000            // Calling encoder.out_of_line_offset(0) is not allowed.
13001            if max_ordinal == 0 {
13002                return Ok(());
13003            }
13004            depth.increment()?;
13005            let envelope_size = 8;
13006            let bytes_len = max_ordinal as usize * envelope_size;
13007            #[allow(unused_variables)]
13008            let offset = encoder.out_of_line_offset(bytes_len);
13009            let mut _prev_end_offset: usize = 0;
13010            if 1 > max_ordinal {
13011                return Ok(());
13012            }
13013
13014            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13015            // are envelope_size bytes.
13016            let cur_offset: usize = (1 - 1) * envelope_size;
13017
13018            // Zero reserved fields.
13019            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13020
13021            // Safety:
13022            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13023            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13024            //   envelope_size bytes, there is always sufficient room.
13025            fidl::encoding::encode_in_envelope_optional::<
13026                EventHeader,
13027                fidl::encoding::DefaultFuchsiaResourceDialect,
13028            >(
13029                self.header.as_ref().map(<EventHeader as fidl::encoding::ValueTypeMarker>::borrow),
13030                encoder,
13031                offset + cur_offset,
13032                depth,
13033            )?;
13034
13035            _prev_end_offset = cur_offset + envelope_size;
13036            if 2 > max_ordinal {
13037                return Ok(());
13038            }
13039
13040            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13041            // are envelope_size bytes.
13042            let cur_offset: usize = (2 - 1) * envelope_size;
13043
13044            // Zero reserved fields.
13045            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13046
13047            // Safety:
13048            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13049            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13050            //   envelope_size bytes, there is always sufficient room.
13051            fidl::encoding::encode_in_envelope_optional::<
13052                EventPayload,
13053                fidl::encoding::DefaultFuchsiaResourceDialect,
13054            >(
13055                self.payload
13056                    .as_mut()
13057                    .map(<EventPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13058                encoder,
13059                offset + cur_offset,
13060                depth,
13061            )?;
13062
13063            _prev_end_offset = cur_offset + envelope_size;
13064
13065            Ok(())
13066        }
13067    }
13068
13069    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Event {
13070        #[inline(always)]
13071        fn new_empty() -> Self {
13072            Self::default()
13073        }
13074
13075        unsafe fn decode(
13076            &mut self,
13077            decoder: &mut fidl::encoding::Decoder<
13078                '_,
13079                fidl::encoding::DefaultFuchsiaResourceDialect,
13080            >,
13081            offset: usize,
13082            mut depth: fidl::encoding::Depth,
13083        ) -> fidl::Result<()> {
13084            decoder.debug_check_bounds::<Self>(offset);
13085            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13086                None => return Err(fidl::Error::NotNullable),
13087                Some(len) => len,
13088            };
13089            // Calling decoder.out_of_line_offset(0) is not allowed.
13090            if len == 0 {
13091                return Ok(());
13092            };
13093            depth.increment()?;
13094            let envelope_size = 8;
13095            let bytes_len = len * envelope_size;
13096            let offset = decoder.out_of_line_offset(bytes_len)?;
13097            // Decode the envelope for each type.
13098            let mut _next_ordinal_to_read = 0;
13099            let mut next_offset = offset;
13100            let end_offset = offset + bytes_len;
13101            _next_ordinal_to_read += 1;
13102            if next_offset >= end_offset {
13103                return Ok(());
13104            }
13105
13106            // Decode unknown envelopes for gaps in ordinals.
13107            while _next_ordinal_to_read < 1 {
13108                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13109                _next_ordinal_to_read += 1;
13110                next_offset += envelope_size;
13111            }
13112
13113            let next_out_of_line = decoder.next_out_of_line();
13114            let handles_before = decoder.remaining_handles();
13115            if let Some((inlined, num_bytes, num_handles)) =
13116                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13117            {
13118                let member_inline_size =
13119                    <EventHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13120                if inlined != (member_inline_size <= 4) {
13121                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13122                }
13123                let inner_offset;
13124                let mut inner_depth = depth.clone();
13125                if inlined {
13126                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13127                    inner_offset = next_offset;
13128                } else {
13129                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13130                    inner_depth.increment()?;
13131                }
13132                let val_ref = self.header.get_or_insert_with(|| {
13133                    fidl::new_empty!(EventHeader, fidl::encoding::DefaultFuchsiaResourceDialect)
13134                });
13135                fidl::decode!(
13136                    EventHeader,
13137                    fidl::encoding::DefaultFuchsiaResourceDialect,
13138                    val_ref,
13139                    decoder,
13140                    inner_offset,
13141                    inner_depth
13142                )?;
13143                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13144                {
13145                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13146                }
13147                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13148                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13149                }
13150            }
13151
13152            next_offset += envelope_size;
13153            _next_ordinal_to_read += 1;
13154            if next_offset >= end_offset {
13155                return Ok(());
13156            }
13157
13158            // Decode unknown envelopes for gaps in ordinals.
13159            while _next_ordinal_to_read < 2 {
13160                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13161                _next_ordinal_to_read += 1;
13162                next_offset += envelope_size;
13163            }
13164
13165            let next_out_of_line = decoder.next_out_of_line();
13166            let handles_before = decoder.remaining_handles();
13167            if let Some((inlined, num_bytes, num_handles)) =
13168                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13169            {
13170                let member_inline_size =
13171                    <EventPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13172                if inlined != (member_inline_size <= 4) {
13173                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13174                }
13175                let inner_offset;
13176                let mut inner_depth = depth.clone();
13177                if inlined {
13178                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13179                    inner_offset = next_offset;
13180                } else {
13181                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13182                    inner_depth.increment()?;
13183                }
13184                let val_ref = self.payload.get_or_insert_with(|| {
13185                    fidl::new_empty!(EventPayload, fidl::encoding::DefaultFuchsiaResourceDialect)
13186                });
13187                fidl::decode!(
13188                    EventPayload,
13189                    fidl::encoding::DefaultFuchsiaResourceDialect,
13190                    val_ref,
13191                    decoder,
13192                    inner_offset,
13193                    inner_depth
13194                )?;
13195                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13196                {
13197                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13198                }
13199                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13200                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13201                }
13202            }
13203
13204            next_offset += envelope_size;
13205
13206            // Decode the remaining unknown envelopes.
13207            while next_offset < end_offset {
13208                _next_ordinal_to_read += 1;
13209                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13210                next_offset += envelope_size;
13211            }
13212
13213            Ok(())
13214        }
13215    }
13216
13217    impl NamespaceEntry {
13218        #[inline(always)]
13219        fn max_ordinal_present(&self) -> u64 {
13220            if let Some(_) = self.directory {
13221                return 2;
13222            }
13223            if let Some(_) = self.path {
13224                return 1;
13225            }
13226            0
13227        }
13228    }
13229
13230    impl fidl::encoding::ResourceTypeMarker for NamespaceEntry {
13231        type Borrowed<'a> = &'a mut Self;
13232        fn take_or_borrow<'a>(
13233            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13234        ) -> Self::Borrowed<'a> {
13235            value
13236        }
13237    }
13238
13239    unsafe impl fidl::encoding::TypeMarker for NamespaceEntry {
13240        type Owned = Self;
13241
13242        #[inline(always)]
13243        fn inline_align(_context: fidl::encoding::Context) -> usize {
13244            8
13245        }
13246
13247        #[inline(always)]
13248        fn inline_size(_context: fidl::encoding::Context) -> usize {
13249            16
13250        }
13251    }
13252
13253    unsafe impl
13254        fidl::encoding::Encode<NamespaceEntry, fidl::encoding::DefaultFuchsiaResourceDialect>
13255        for &mut NamespaceEntry
13256    {
13257        unsafe fn encode(
13258            self,
13259            encoder: &mut fidl::encoding::Encoder<
13260                '_,
13261                fidl::encoding::DefaultFuchsiaResourceDialect,
13262            >,
13263            offset: usize,
13264            mut depth: fidl::encoding::Depth,
13265        ) -> fidl::Result<()> {
13266            encoder.debug_check_bounds::<NamespaceEntry>(offset);
13267            // Vector header
13268            let max_ordinal: u64 = self.max_ordinal_present();
13269            encoder.write_num(max_ordinal, offset);
13270            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13271            // Calling encoder.out_of_line_offset(0) is not allowed.
13272            if max_ordinal == 0 {
13273                return Ok(());
13274            }
13275            depth.increment()?;
13276            let envelope_size = 8;
13277            let bytes_len = max_ordinal as usize * envelope_size;
13278            #[allow(unused_variables)]
13279            let offset = encoder.out_of_line_offset(bytes_len);
13280            let mut _prev_end_offset: usize = 0;
13281            if 1 > max_ordinal {
13282                return Ok(());
13283            }
13284
13285            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13286            // are envelope_size bytes.
13287            let cur_offset: usize = (1 - 1) * envelope_size;
13288
13289            // Zero reserved fields.
13290            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13291
13292            // Safety:
13293            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13294            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13295            //   envelope_size bytes, there is always sufficient room.
13296            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4095>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13297            self.path.as_ref().map(<fidl::encoding::BoundedString<4095> as fidl::encoding::ValueTypeMarker>::borrow),
13298            encoder, offset + cur_offset, depth
13299        )?;
13300
13301            _prev_end_offset = cur_offset + envelope_size;
13302            if 2 > max_ordinal {
13303                return Ok(());
13304            }
13305
13306            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13307            // are envelope_size bytes.
13308            let cur_offset: usize = (2 - 1) * envelope_size;
13309
13310            // Zero reserved fields.
13311            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13312
13313            // Safety:
13314            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13315            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13316            //   envelope_size bytes, there is always sufficient room.
13317            fidl::encoding::encode_in_envelope_optional::<
13318                fidl::encoding::Endpoint<
13319                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13320                >,
13321                fidl::encoding::DefaultFuchsiaResourceDialect,
13322            >(
13323                self.directory.as_mut().map(
13324                    <fidl::encoding::Endpoint<
13325                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13326                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13327                ),
13328                encoder,
13329                offset + cur_offset,
13330                depth,
13331            )?;
13332
13333            _prev_end_offset = cur_offset + envelope_size;
13334
13335            Ok(())
13336        }
13337    }
13338
13339    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13340        for NamespaceEntry
13341    {
13342        #[inline(always)]
13343        fn new_empty() -> Self {
13344            Self::default()
13345        }
13346
13347        unsafe fn decode(
13348            &mut self,
13349            decoder: &mut fidl::encoding::Decoder<
13350                '_,
13351                fidl::encoding::DefaultFuchsiaResourceDialect,
13352            >,
13353            offset: usize,
13354            mut depth: fidl::encoding::Depth,
13355        ) -> fidl::Result<()> {
13356            decoder.debug_check_bounds::<Self>(offset);
13357            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13358                None => return Err(fidl::Error::NotNullable),
13359                Some(len) => len,
13360            };
13361            // Calling decoder.out_of_line_offset(0) is not allowed.
13362            if len == 0 {
13363                return Ok(());
13364            };
13365            depth.increment()?;
13366            let envelope_size = 8;
13367            let bytes_len = len * envelope_size;
13368            let offset = decoder.out_of_line_offset(bytes_len)?;
13369            // Decode the envelope for each type.
13370            let mut _next_ordinal_to_read = 0;
13371            let mut next_offset = offset;
13372            let end_offset = offset + bytes_len;
13373            _next_ordinal_to_read += 1;
13374            if next_offset >= end_offset {
13375                return Ok(());
13376            }
13377
13378            // Decode unknown envelopes for gaps in ordinals.
13379            while _next_ordinal_to_read < 1 {
13380                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13381                _next_ordinal_to_read += 1;
13382                next_offset += envelope_size;
13383            }
13384
13385            let next_out_of_line = decoder.next_out_of_line();
13386            let handles_before = decoder.remaining_handles();
13387            if let Some((inlined, num_bytes, num_handles)) =
13388                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13389            {
13390                let member_inline_size = <fidl::encoding::BoundedString<4095> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13391                if inlined != (member_inline_size <= 4) {
13392                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13393                }
13394                let inner_offset;
13395                let mut inner_depth = depth.clone();
13396                if inlined {
13397                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13398                    inner_offset = next_offset;
13399                } else {
13400                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13401                    inner_depth.increment()?;
13402                }
13403                let val_ref = self.path.get_or_insert_with(|| {
13404                    fidl::new_empty!(
13405                        fidl::encoding::BoundedString<4095>,
13406                        fidl::encoding::DefaultFuchsiaResourceDialect
13407                    )
13408                });
13409                fidl::decode!(
13410                    fidl::encoding::BoundedString<4095>,
13411                    fidl::encoding::DefaultFuchsiaResourceDialect,
13412                    val_ref,
13413                    decoder,
13414                    inner_offset,
13415                    inner_depth
13416                )?;
13417                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13418                {
13419                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13420                }
13421                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13422                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13423                }
13424            }
13425
13426            next_offset += envelope_size;
13427            _next_ordinal_to_read += 1;
13428            if next_offset >= end_offset {
13429                return Ok(());
13430            }
13431
13432            // Decode unknown envelopes for gaps in ordinals.
13433            while _next_ordinal_to_read < 2 {
13434                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13435                _next_ordinal_to_read += 1;
13436                next_offset += envelope_size;
13437            }
13438
13439            let next_out_of_line = decoder.next_out_of_line();
13440            let handles_before = decoder.remaining_handles();
13441            if let Some((inlined, num_bytes, num_handles)) =
13442                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13443            {
13444                let member_inline_size = <fidl::encoding::Endpoint<
13445                    fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13446                > as fidl::encoding::TypeMarker>::inline_size(
13447                    decoder.context
13448                );
13449                if inlined != (member_inline_size <= 4) {
13450                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13451                }
13452                let inner_offset;
13453                let mut inner_depth = depth.clone();
13454                if inlined {
13455                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13456                    inner_offset = next_offset;
13457                } else {
13458                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13459                    inner_depth.increment()?;
13460                }
13461                let val_ref = self.directory.get_or_insert_with(|| {
13462                    fidl::new_empty!(
13463                        fidl::encoding::Endpoint<
13464                            fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13465                        >,
13466                        fidl::encoding::DefaultFuchsiaResourceDialect
13467                    )
13468                });
13469                fidl::decode!(
13470                    fidl::encoding::Endpoint<
13471                        fidl::endpoints::ClientEnd<fidl_fuchsia_io::DirectoryMarker>,
13472                    >,
13473                    fidl::encoding::DefaultFuchsiaResourceDialect,
13474                    val_ref,
13475                    decoder,
13476                    inner_offset,
13477                    inner_depth
13478                )?;
13479                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13480                {
13481                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13482                }
13483                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13484                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13485                }
13486            }
13487
13488            next_offset += envelope_size;
13489
13490            // Decode the remaining unknown envelopes.
13491            while next_offset < end_offset {
13492                _next_ordinal_to_read += 1;
13493                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13494                next_offset += envelope_size;
13495            }
13496
13497            Ok(())
13498        }
13499    }
13500
13501    impl StartChildArgs {
13502        #[inline(always)]
13503        fn max_ordinal_present(&self) -> u64 {
13504            if let Some(_) = self.additional_inputs {
13505                return 4;
13506            }
13507            if let Some(_) = self.dictionary {
13508                return 3;
13509            }
13510            if let Some(_) = self.namespace_entries {
13511                return 2;
13512            }
13513            if let Some(_) = self.numbered_handles {
13514                return 1;
13515            }
13516            0
13517        }
13518    }
13519
13520    impl fidl::encoding::ResourceTypeMarker for StartChildArgs {
13521        type Borrowed<'a> = &'a mut Self;
13522        fn take_or_borrow<'a>(
13523            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13524        ) -> Self::Borrowed<'a> {
13525            value
13526        }
13527    }
13528
13529    unsafe impl fidl::encoding::TypeMarker for StartChildArgs {
13530        type Owned = Self;
13531
13532        #[inline(always)]
13533        fn inline_align(_context: fidl::encoding::Context) -> usize {
13534            8
13535        }
13536
13537        #[inline(always)]
13538        fn inline_size(_context: fidl::encoding::Context) -> usize {
13539            16
13540        }
13541    }
13542
13543    unsafe impl
13544        fidl::encoding::Encode<StartChildArgs, fidl::encoding::DefaultFuchsiaResourceDialect>
13545        for &mut StartChildArgs
13546    {
13547        unsafe fn encode(
13548            self,
13549            encoder: &mut fidl::encoding::Encoder<
13550                '_,
13551                fidl::encoding::DefaultFuchsiaResourceDialect,
13552            >,
13553            offset: usize,
13554            mut depth: fidl::encoding::Depth,
13555        ) -> fidl::Result<()> {
13556            encoder.debug_check_bounds::<StartChildArgs>(offset);
13557            // Vector header
13558            let max_ordinal: u64 = self.max_ordinal_present();
13559            encoder.write_num(max_ordinal, offset);
13560            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13561            // Calling encoder.out_of_line_offset(0) is not allowed.
13562            if max_ordinal == 0 {
13563                return Ok(());
13564            }
13565            depth.increment()?;
13566            let envelope_size = 8;
13567            let bytes_len = max_ordinal as usize * envelope_size;
13568            #[allow(unused_variables)]
13569            let offset = encoder.out_of_line_offset(bytes_len);
13570            let mut _prev_end_offset: usize = 0;
13571            if 1 > max_ordinal {
13572                return Ok(());
13573            }
13574
13575            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13576            // are envelope_size bytes.
13577            let cur_offset: usize = (1 - 1) * envelope_size;
13578
13579            // Zero reserved fields.
13580            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13581
13582            // Safety:
13583            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13584            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13585            //   envelope_size bytes, there is always sufficient room.
13586            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13587            self.numbered_handles.as_mut().map(<fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13588            encoder, offset + cur_offset, depth
13589        )?;
13590
13591            _prev_end_offset = cur_offset + envelope_size;
13592            if 2 > max_ordinal {
13593                return Ok(());
13594            }
13595
13596            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13597            // are envelope_size bytes.
13598            let cur_offset: usize = (2 - 1) * envelope_size;
13599
13600            // Zero reserved fields.
13601            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13602
13603            // Safety:
13604            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13605            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13606            //   envelope_size bytes, there is always sufficient room.
13607            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect>(
13608            self.namespace_entries.as_mut().map(<fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13609            encoder, offset + cur_offset, depth
13610        )?;
13611
13612            _prev_end_offset = cur_offset + envelope_size;
13613            if 3 > max_ordinal {
13614                return Ok(());
13615            }
13616
13617            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13618            // are envelope_size bytes.
13619            let cur_offset: usize = (3 - 1) * envelope_size;
13620
13621            // Zero reserved fields.
13622            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13623
13624            // Safety:
13625            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13626            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13627            //   envelope_size bytes, there is always sufficient room.
13628            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_component_sandbox::DictionaryRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
13629            self.dictionary.as_mut().map(<fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
13630            encoder, offset + cur_offset, depth
13631        )?;
13632
13633            _prev_end_offset = cur_offset + envelope_size;
13634            if 4 > max_ordinal {
13635                return Ok(());
13636            }
13637
13638            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13639            // are envelope_size bytes.
13640            let cur_offset: usize = (4 - 1) * envelope_size;
13641
13642            // Zero reserved fields.
13643            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13644
13645            // Safety:
13646            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13647            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13648            //   envelope_size bytes, there is always sufficient room.
13649            fidl::encoding::encode_in_envelope_optional::<
13650                fidl::encoding::HandleType<
13651                    fidl::EventPair,
13652                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13653                    2147483648,
13654                >,
13655                fidl::encoding::DefaultFuchsiaResourceDialect,
13656            >(
13657                self.additional_inputs.as_mut().map(
13658                    <fidl::encoding::HandleType<
13659                        fidl::EventPair,
13660                        { fidl::ObjectType::EVENTPAIR.into_raw() },
13661                        2147483648,
13662                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
13663                ),
13664                encoder,
13665                offset + cur_offset,
13666                depth,
13667            )?;
13668
13669            _prev_end_offset = cur_offset + envelope_size;
13670
13671            Ok(())
13672        }
13673    }
13674
13675    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13676        for StartChildArgs
13677    {
13678        #[inline(always)]
13679        fn new_empty() -> Self {
13680            Self::default()
13681        }
13682
13683        unsafe fn decode(
13684            &mut self,
13685            decoder: &mut fidl::encoding::Decoder<
13686                '_,
13687                fidl::encoding::DefaultFuchsiaResourceDialect,
13688            >,
13689            offset: usize,
13690            mut depth: fidl::encoding::Depth,
13691        ) -> fidl::Result<()> {
13692            decoder.debug_check_bounds::<Self>(offset);
13693            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13694                None => return Err(fidl::Error::NotNullable),
13695                Some(len) => len,
13696            };
13697            // Calling decoder.out_of_line_offset(0) is not allowed.
13698            if len == 0 {
13699                return Ok(());
13700            };
13701            depth.increment()?;
13702            let envelope_size = 8;
13703            let bytes_len = len * envelope_size;
13704            let offset = decoder.out_of_line_offset(bytes_len)?;
13705            // Decode the envelope for each type.
13706            let mut _next_ordinal_to_read = 0;
13707            let mut next_offset = offset;
13708            let end_offset = offset + bytes_len;
13709            _next_ordinal_to_read += 1;
13710            if next_offset >= end_offset {
13711                return Ok(());
13712            }
13713
13714            // Decode unknown envelopes for gaps in ordinals.
13715            while _next_ordinal_to_read < 1 {
13716                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13717                _next_ordinal_to_read += 1;
13718                next_offset += envelope_size;
13719            }
13720
13721            let next_out_of_line = decoder.next_out_of_line();
13722            let handles_before = decoder.remaining_handles();
13723            if let Some((inlined, num_bytes, num_handles)) =
13724                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13725            {
13726                let member_inline_size = <fidl::encoding::Vector<
13727                    fidl_fuchsia_process::HandleInfo,
13728                    128,
13729                > as fidl::encoding::TypeMarker>::inline_size(
13730                    decoder.context
13731                );
13732                if inlined != (member_inline_size <= 4) {
13733                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13734                }
13735                let inner_offset;
13736                let mut inner_depth = depth.clone();
13737                if inlined {
13738                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13739                    inner_offset = next_offset;
13740                } else {
13741                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13742                    inner_depth.increment()?;
13743                }
13744                let val_ref =
13745                self.numbered_handles.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect));
13746                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_process::HandleInfo, 128>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13747                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13748                {
13749                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13750                }
13751                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13752                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13753                }
13754            }
13755
13756            next_offset += envelope_size;
13757            _next_ordinal_to_read += 1;
13758            if next_offset >= end_offset {
13759                return Ok(());
13760            }
13761
13762            // Decode unknown envelopes for gaps in ordinals.
13763            while _next_ordinal_to_read < 2 {
13764                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13765                _next_ordinal_to_read += 1;
13766                next_offset += envelope_size;
13767            }
13768
13769            let next_out_of_line = decoder.next_out_of_line();
13770            let handles_before = decoder.remaining_handles();
13771            if let Some((inlined, num_bytes, num_handles)) =
13772                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13773            {
13774                let member_inline_size = <fidl::encoding::Vector<NamespaceEntry, 32> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13775                if inlined != (member_inline_size <= 4) {
13776                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13777                }
13778                let inner_offset;
13779                let mut inner_depth = depth.clone();
13780                if inlined {
13781                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13782                    inner_offset = next_offset;
13783                } else {
13784                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13785                    inner_depth.increment()?;
13786                }
13787                let val_ref =
13788                self.namespace_entries.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect));
13789                fidl::decode!(fidl::encoding::Vector<NamespaceEntry, 32>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13790                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13791                {
13792                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13793                }
13794                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13795                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13796                }
13797            }
13798
13799            next_offset += envelope_size;
13800            _next_ordinal_to_read += 1;
13801            if next_offset >= end_offset {
13802                return Ok(());
13803            }
13804
13805            // Decode unknown envelopes for gaps in ordinals.
13806            while _next_ordinal_to_read < 3 {
13807                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13808                _next_ordinal_to_read += 1;
13809                next_offset += envelope_size;
13810            }
13811
13812            let next_out_of_line = decoder.next_out_of_line();
13813            let handles_before = decoder.remaining_handles();
13814            if let Some((inlined, num_bytes, num_handles)) =
13815                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13816            {
13817                let member_inline_size = <fidl_fuchsia_component_sandbox::DictionaryRef as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13818                if inlined != (member_inline_size <= 4) {
13819                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13820                }
13821                let inner_offset;
13822                let mut inner_depth = depth.clone();
13823                if inlined {
13824                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13825                    inner_offset = next_offset;
13826                } else {
13827                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13828                    inner_depth.increment()?;
13829                }
13830                let val_ref = self.dictionary.get_or_insert_with(|| {
13831                    fidl::new_empty!(
13832                        fidl_fuchsia_component_sandbox::DictionaryRef,
13833                        fidl::encoding::DefaultFuchsiaResourceDialect
13834                    )
13835                });
13836                fidl::decode!(
13837                    fidl_fuchsia_component_sandbox::DictionaryRef,
13838                    fidl::encoding::DefaultFuchsiaResourceDialect,
13839                    val_ref,
13840                    decoder,
13841                    inner_offset,
13842                    inner_depth
13843                )?;
13844                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13845                {
13846                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13847                }
13848                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13849                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13850                }
13851            }
13852
13853            next_offset += envelope_size;
13854            _next_ordinal_to_read += 1;
13855            if next_offset >= end_offset {
13856                return Ok(());
13857            }
13858
13859            // Decode unknown envelopes for gaps in ordinals.
13860            while _next_ordinal_to_read < 4 {
13861                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13862                _next_ordinal_to_read += 1;
13863                next_offset += envelope_size;
13864            }
13865
13866            let next_out_of_line = decoder.next_out_of_line();
13867            let handles_before = decoder.remaining_handles();
13868            if let Some((inlined, num_bytes, num_handles)) =
13869                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13870            {
13871                let member_inline_size = <fidl::encoding::HandleType<
13872                    fidl::EventPair,
13873                    { fidl::ObjectType::EVENTPAIR.into_raw() },
13874                    2147483648,
13875                > as fidl::encoding::TypeMarker>::inline_size(
13876                    decoder.context
13877                );
13878                if inlined != (member_inline_size <= 4) {
13879                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13880                }
13881                let inner_offset;
13882                let mut inner_depth = depth.clone();
13883                if inlined {
13884                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13885                    inner_offset = next_offset;
13886                } else {
13887                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13888                    inner_depth.increment()?;
13889                }
13890                let val_ref =
13891                self.additional_inputs.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect));
13892                fidl::decode!(fidl::encoding::HandleType<fidl::EventPair, { fidl::ObjectType::EVENTPAIR.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
13893                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13894                {
13895                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13896                }
13897                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13898                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13899                }
13900            }
13901
13902            next_offset += envelope_size;
13903
13904            // Decode the remaining unknown envelopes.
13905            while next_offset < end_offset {
13906                _next_ordinal_to_read += 1;
13907                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13908                next_offset += envelope_size;
13909            }
13910
13911            Ok(())
13912        }
13913    }
13914
13915    impl fidl::encoding::ResourceTypeMarker for EventPayload {
13916        type Borrowed<'a> = &'a mut Self;
13917        fn take_or_borrow<'a>(
13918            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13919        ) -> Self::Borrowed<'a> {
13920            value
13921        }
13922    }
13923
13924    unsafe impl fidl::encoding::TypeMarker for EventPayload {
13925        type Owned = Self;
13926
13927        #[inline(always)]
13928        fn inline_align(_context: fidl::encoding::Context) -> usize {
13929            8
13930        }
13931
13932        #[inline(always)]
13933        fn inline_size(_context: fidl::encoding::Context) -> usize {
13934            16
13935        }
13936    }
13937
13938    unsafe impl fidl::encoding::Encode<EventPayload, fidl::encoding::DefaultFuchsiaResourceDialect>
13939        for &mut EventPayload
13940    {
13941        #[inline]
13942        unsafe fn encode(
13943            self,
13944            encoder: &mut fidl::encoding::Encoder<
13945                '_,
13946                fidl::encoding::DefaultFuchsiaResourceDialect,
13947            >,
13948            offset: usize,
13949            _depth: fidl::encoding::Depth,
13950        ) -> fidl::Result<()> {
13951            encoder.debug_check_bounds::<EventPayload>(offset);
13952            encoder.write_num::<u64>(self.ordinal(), offset);
13953            match self {
13954            EventPayload::CapabilityRequested(ref mut val) => {
13955                fidl::encoding::encode_in_envelope::<CapabilityRequestedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13956                    <CapabilityRequestedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13957                    encoder, offset + 8, _depth
13958                )
13959            }
13960            EventPayload::Purged(ref val) => {
13961                fidl::encoding::encode_in_envelope::<PurgedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13962                    <PurgedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13963                    encoder, offset + 8, _depth
13964                )
13965            }
13966            EventPayload::Discovered(ref val) => {
13967                fidl::encoding::encode_in_envelope::<DiscoveredPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13968                    <DiscoveredPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13969                    encoder, offset + 8, _depth
13970                )
13971            }
13972            EventPayload::Destroyed(ref val) => {
13973                fidl::encoding::encode_in_envelope::<DestroyedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13974                    <DestroyedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13975                    encoder, offset + 8, _depth
13976                )
13977            }
13978            EventPayload::Resolved(ref val) => {
13979                fidl::encoding::encode_in_envelope::<ResolvedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13980                    <ResolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13981                    encoder, offset + 8, _depth
13982                )
13983            }
13984            EventPayload::Started(ref val) => {
13985                fidl::encoding::encode_in_envelope::<StartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13986                    <StartedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13987                    encoder, offset + 8, _depth
13988                )
13989            }
13990            EventPayload::Stopped(ref val) => {
13991                fidl::encoding::encode_in_envelope::<StoppedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13992                    <StoppedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
13993                    encoder, offset + 8, _depth
13994                )
13995            }
13996            EventPayload::DebugStarted(ref mut val) => {
13997                fidl::encoding::encode_in_envelope::<DebugStartedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
13998                    <DebugStartedPayload as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
13999                    encoder, offset + 8, _depth
14000                )
14001            }
14002            EventPayload::Unresolved(ref val) => {
14003                fidl::encoding::encode_in_envelope::<UnresolvedPayload, fidl::encoding::DefaultFuchsiaResourceDialect>(
14004                    <UnresolvedPayload as fidl::encoding::ValueTypeMarker>::borrow(val),
14005                    encoder, offset + 8, _depth
14006                )
14007            }
14008            EventPayload::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
14009        }
14010        }
14011    }
14012
14013    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for EventPayload {
14014        #[inline(always)]
14015        fn new_empty() -> Self {
14016            Self::__SourceBreaking { unknown_ordinal: 0 }
14017        }
14018
14019        #[inline]
14020        unsafe fn decode(
14021            &mut self,
14022            decoder: &mut fidl::encoding::Decoder<
14023                '_,
14024                fidl::encoding::DefaultFuchsiaResourceDialect,
14025            >,
14026            offset: usize,
14027            mut depth: fidl::encoding::Depth,
14028        ) -> fidl::Result<()> {
14029            decoder.debug_check_bounds::<Self>(offset);
14030            #[allow(unused_variables)]
14031            let next_out_of_line = decoder.next_out_of_line();
14032            let handles_before = decoder.remaining_handles();
14033            let (ordinal, inlined, num_bytes, num_handles) =
14034                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
14035
14036            let member_inline_size = match ordinal {
14037                1 => <CapabilityRequestedPayload as fidl::encoding::TypeMarker>::inline_size(
14038                    decoder.context,
14039                ),
14040                2 => <PurgedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14041                4 => {
14042                    <DiscoveredPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
14043                }
14044                5 => <DestroyedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14045                6 => <ResolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14046                7 => <StartedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14047                8 => <StoppedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context),
14048                9 => <DebugStartedPayload as fidl::encoding::TypeMarker>::inline_size(
14049                    decoder.context,
14050                ),
14051                10 => {
14052                    <UnresolvedPayload as fidl::encoding::TypeMarker>::inline_size(decoder.context)
14053                }
14054                0 => return Err(fidl::Error::UnknownUnionTag),
14055                _ => num_bytes as usize,
14056            };
14057
14058            if inlined != (member_inline_size <= 4) {
14059                return Err(fidl::Error::InvalidInlineBitInEnvelope);
14060            }
14061            let _inner_offset;
14062            if inlined {
14063                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
14064                _inner_offset = offset + 8;
14065            } else {
14066                depth.increment()?;
14067                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14068            }
14069            match ordinal {
14070                1 => {
14071                    #[allow(irrefutable_let_patterns)]
14072                    if let EventPayload::CapabilityRequested(_) = self {
14073                        // Do nothing, read the value into the object
14074                    } else {
14075                        // Initialize `self` to the right variant
14076                        *self = EventPayload::CapabilityRequested(fidl::new_empty!(
14077                            CapabilityRequestedPayload,
14078                            fidl::encoding::DefaultFuchsiaResourceDialect
14079                        ));
14080                    }
14081                    #[allow(irrefutable_let_patterns)]
14082                    if let EventPayload::CapabilityRequested(ref mut val) = self {
14083                        fidl::decode!(
14084                            CapabilityRequestedPayload,
14085                            fidl::encoding::DefaultFuchsiaResourceDialect,
14086                            val,
14087                            decoder,
14088                            _inner_offset,
14089                            depth
14090                        )?;
14091                    } else {
14092                        unreachable!()
14093                    }
14094                }
14095                2 => {
14096                    #[allow(irrefutable_let_patterns)]
14097                    if let EventPayload::Purged(_) = self {
14098                        // Do nothing, read the value into the object
14099                    } else {
14100                        // Initialize `self` to the right variant
14101                        *self = EventPayload::Purged(fidl::new_empty!(
14102                            PurgedPayload,
14103                            fidl::encoding::DefaultFuchsiaResourceDialect
14104                        ));
14105                    }
14106                    #[allow(irrefutable_let_patterns)]
14107                    if let EventPayload::Purged(ref mut val) = self {
14108                        fidl::decode!(
14109                            PurgedPayload,
14110                            fidl::encoding::DefaultFuchsiaResourceDialect,
14111                            val,
14112                            decoder,
14113                            _inner_offset,
14114                            depth
14115                        )?;
14116                    } else {
14117                        unreachable!()
14118                    }
14119                }
14120                4 => {
14121                    #[allow(irrefutable_let_patterns)]
14122                    if let EventPayload::Discovered(_) = self {
14123                        // Do nothing, read the value into the object
14124                    } else {
14125                        // Initialize `self` to the right variant
14126                        *self = EventPayload::Discovered(fidl::new_empty!(
14127                            DiscoveredPayload,
14128                            fidl::encoding::DefaultFuchsiaResourceDialect
14129                        ));
14130                    }
14131                    #[allow(irrefutable_let_patterns)]
14132                    if let EventPayload::Discovered(ref mut val) = self {
14133                        fidl::decode!(
14134                            DiscoveredPayload,
14135                            fidl::encoding::DefaultFuchsiaResourceDialect,
14136                            val,
14137                            decoder,
14138                            _inner_offset,
14139                            depth
14140                        )?;
14141                    } else {
14142                        unreachable!()
14143                    }
14144                }
14145                5 => {
14146                    #[allow(irrefutable_let_patterns)]
14147                    if let EventPayload::Destroyed(_) = self {
14148                        // Do nothing, read the value into the object
14149                    } else {
14150                        // Initialize `self` to the right variant
14151                        *self = EventPayload::Destroyed(fidl::new_empty!(
14152                            DestroyedPayload,
14153                            fidl::encoding::DefaultFuchsiaResourceDialect
14154                        ));
14155                    }
14156                    #[allow(irrefutable_let_patterns)]
14157                    if let EventPayload::Destroyed(ref mut val) = self {
14158                        fidl::decode!(
14159                            DestroyedPayload,
14160                            fidl::encoding::DefaultFuchsiaResourceDialect,
14161                            val,
14162                            decoder,
14163                            _inner_offset,
14164                            depth
14165                        )?;
14166                    } else {
14167                        unreachable!()
14168                    }
14169                }
14170                6 => {
14171                    #[allow(irrefutable_let_patterns)]
14172                    if let EventPayload::Resolved(_) = self {
14173                        // Do nothing, read the value into the object
14174                    } else {
14175                        // Initialize `self` to the right variant
14176                        *self = EventPayload::Resolved(fidl::new_empty!(
14177                            ResolvedPayload,
14178                            fidl::encoding::DefaultFuchsiaResourceDialect
14179                        ));
14180                    }
14181                    #[allow(irrefutable_let_patterns)]
14182                    if let EventPayload::Resolved(ref mut val) = self {
14183                        fidl::decode!(
14184                            ResolvedPayload,
14185                            fidl::encoding::DefaultFuchsiaResourceDialect,
14186                            val,
14187                            decoder,
14188                            _inner_offset,
14189                            depth
14190                        )?;
14191                    } else {
14192                        unreachable!()
14193                    }
14194                }
14195                7 => {
14196                    #[allow(irrefutable_let_patterns)]
14197                    if let EventPayload::Started(_) = self {
14198                        // Do nothing, read the value into the object
14199                    } else {
14200                        // Initialize `self` to the right variant
14201                        *self = EventPayload::Started(fidl::new_empty!(
14202                            StartedPayload,
14203                            fidl::encoding::DefaultFuchsiaResourceDialect
14204                        ));
14205                    }
14206                    #[allow(irrefutable_let_patterns)]
14207                    if let EventPayload::Started(ref mut val) = self {
14208                        fidl::decode!(
14209                            StartedPayload,
14210                            fidl::encoding::DefaultFuchsiaResourceDialect,
14211                            val,
14212                            decoder,
14213                            _inner_offset,
14214                            depth
14215                        )?;
14216                    } else {
14217                        unreachable!()
14218                    }
14219                }
14220                8 => {
14221                    #[allow(irrefutable_let_patterns)]
14222                    if let EventPayload::Stopped(_) = self {
14223                        // Do nothing, read the value into the object
14224                    } else {
14225                        // Initialize `self` to the right variant
14226                        *self = EventPayload::Stopped(fidl::new_empty!(
14227                            StoppedPayload,
14228                            fidl::encoding::DefaultFuchsiaResourceDialect
14229                        ));
14230                    }
14231                    #[allow(irrefutable_let_patterns)]
14232                    if let EventPayload::Stopped(ref mut val) = self {
14233                        fidl::decode!(
14234                            StoppedPayload,
14235                            fidl::encoding::DefaultFuchsiaResourceDialect,
14236                            val,
14237                            decoder,
14238                            _inner_offset,
14239                            depth
14240                        )?;
14241                    } else {
14242                        unreachable!()
14243                    }
14244                }
14245                9 => {
14246                    #[allow(irrefutable_let_patterns)]
14247                    if let EventPayload::DebugStarted(_) = self {
14248                        // Do nothing, read the value into the object
14249                    } else {
14250                        // Initialize `self` to the right variant
14251                        *self = EventPayload::DebugStarted(fidl::new_empty!(
14252                            DebugStartedPayload,
14253                            fidl::encoding::DefaultFuchsiaResourceDialect
14254                        ));
14255                    }
14256                    #[allow(irrefutable_let_patterns)]
14257                    if let EventPayload::DebugStarted(ref mut val) = self {
14258                        fidl::decode!(
14259                            DebugStartedPayload,
14260                            fidl::encoding::DefaultFuchsiaResourceDialect,
14261                            val,
14262                            decoder,
14263                            _inner_offset,
14264                            depth
14265                        )?;
14266                    } else {
14267                        unreachable!()
14268                    }
14269                }
14270                10 => {
14271                    #[allow(irrefutable_let_patterns)]
14272                    if let EventPayload::Unresolved(_) = self {
14273                        // Do nothing, read the value into the object
14274                    } else {
14275                        // Initialize `self` to the right variant
14276                        *self = EventPayload::Unresolved(fidl::new_empty!(
14277                            UnresolvedPayload,
14278                            fidl::encoding::DefaultFuchsiaResourceDialect
14279                        ));
14280                    }
14281                    #[allow(irrefutable_let_patterns)]
14282                    if let EventPayload::Unresolved(ref mut val) = self {
14283                        fidl::decode!(
14284                            UnresolvedPayload,
14285                            fidl::encoding::DefaultFuchsiaResourceDialect,
14286                            val,
14287                            decoder,
14288                            _inner_offset,
14289                            depth
14290                        )?;
14291                    } else {
14292                        unreachable!()
14293                    }
14294                }
14295                #[allow(deprecated)]
14296                ordinal => {
14297                    for _ in 0..num_handles {
14298                        decoder.drop_next_handle()?;
14299                    }
14300                    *self = EventPayload::__SourceBreaking { unknown_ordinal: ordinal };
14301                }
14302            }
14303            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
14304                return Err(fidl::Error::InvalidNumBytesInEnvelope);
14305            }
14306            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14307                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14308            }
14309            Ok(())
14310        }
14311    }
14312}