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