fidl_fuchsia_sys2/
fidl_fuchsia_sys2.rs

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