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