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