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