Skip to main content

fidl_fuchsia_fs_startup/
fidl_fuchsia_fs_startup.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_fs_startup_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct StartupCheckRequest {
16    pub device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
17    pub options: CheckOptions,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StartupCheckRequest {}
21
22#[derive(Debug, PartialEq)]
23pub struct StartupFormatRequest {
24    pub device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
25    pub options: FormatOptions,
26}
27
28impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StartupFormatRequest {}
29
30#[derive(Debug, PartialEq)]
31pub struct StartupStartRequest {
32    pub device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
33    pub options: StartOptions,
34}
35
36impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for StartupStartRequest {}
37
38#[derive(Debug, PartialEq)]
39pub struct VolumeCheckRequest {
40    pub options: CheckOptions,
41}
42
43impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VolumeCheckRequest {}
44
45#[derive(Debug, PartialEq)]
46pub struct VolumeMountRemoteRequest {
47    pub options: MountOptions,
48    pub volume: fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
49}
50
51impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VolumeMountRemoteRequest {}
52
53#[derive(Debug, PartialEq)]
54pub struct VolumeMountRequest {
55    pub outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
56    pub options: MountOptions,
57}
58
59impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VolumeMountRequest {}
60
61#[derive(Debug, PartialEq)]
62pub struct VolumeMountRemoteResponse {
63    pub info: fidl_fuchsia_fxfs::VolumeInfo,
64    pub initial_layers: fidl_fuchsia_fxfs::LayerSet,
65    pub guid: [u8; 16],
66}
67
68impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VolumeMountRemoteResponse {}
69
70#[derive(Debug, PartialEq)]
71pub struct VolumesCreateRequest {
72    pub name: String,
73    pub outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
74    pub create_options: CreateOptions,
75    pub mount_options: MountOptions,
76}
77
78impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for VolumesCreateRequest {}
79
80/// Options for running consistency checks on filesystems.
81#[derive(Debug, Default, PartialEq)]
82pub struct CheckOptions {
83    /// An optional connection to a crypt client (for encrypted volumes).
84    pub crypt: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>>,
85    /// URI containing implementation specific options.  For example, for FVM backed volumes, this
86    /// indicates the component URL of the filesystem that we should run fsck with.  It must be
87    /// provided for FVM backed volumes.  At time of writing, this is ignored by Fxfs.
88    pub uri: Option<String>,
89    #[doc(hidden)]
90    pub __source_breaking: fidl::marker::SourceBreaking,
91}
92
93impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CheckOptions {}
94
95/// Not all options are recognized by all implementations.  For example, at time of writing, Fxfs
96/// ignores all options.
97#[derive(Debug, Default, PartialEq)]
98pub struct CreateOptions {
99    /// Byte count for the initial size of the volume.  Some implementations might ignore this
100    /// setting.
101    pub initial_size: Option<u64>,
102    /// Unique GUID for the volume.  If unspecified, a GUID will be generated.
103    pub guid: Option<[u8; 16]>,
104    /// Type GUID for the volume.  If unspecified, an implementation default is chosen.  Some
105    /// implementations might not support arbitrary volume types.
106    pub type_guid: Option<[u8; 16]>,
107    /// If true, inode IDs will be restricted to 32 bits.
108    pub restrict_inode_ids_to_32_bit: Option<bool>,
109    #[doc(hidden)]
110    pub __source_breaking: fidl::marker::SourceBreaking,
111}
112
113impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for CreateOptions {}
114
115#[derive(Debug, Default, PartialEq)]
116pub struct MountOptions {
117    /// An optional connection to a crypt client (for encrypted volumes).
118    pub crypt: Option<fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>>,
119    /// If true, mount as a blob filesystem.
120    pub as_blob: Option<bool>,
121    /// URI containing implementation specific options.  For example, for FVM backed volumes, if
122    /// specified, this indicates the component URL for the filesystem should be mounted.  If
123    /// unspecified, FVM backed volumes will expose the volume as a block device.  At time of
124    /// writing, this is ignored by Fxfs.
125    pub uri: Option<String>,
126    /// If true, blob page requests for this volume are handled in the block driver rather than by
127    /// the filesystem. Only applicable when `as_blob` is true.
128    pub use_driver_blob_paging: Option<bool>,
129    #[doc(hidden)]
130    pub __source_breaking: fidl::marker::SourceBreaking,
131}
132
133impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for MountOptions {}
134
135#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
136pub struct StartupMarker;
137
138impl fidl::endpoints::ProtocolMarker for StartupMarker {
139    type Proxy = StartupProxy;
140    type RequestStream = StartupRequestStream;
141    #[cfg(target_os = "fuchsia")]
142    type SynchronousProxy = StartupSynchronousProxy;
143
144    const DEBUG_NAME: &'static str = "fuchsia.fs.startup.Startup";
145}
146impl fidl::endpoints::DiscoverableProtocolMarker for StartupMarker {}
147pub type StartupStartResult = Result<(), i32>;
148pub type StartupFormatResult = Result<(), i32>;
149pub type StartupCheckResult = Result<(), i32>;
150
151pub trait StartupProxyInterface: Send + Sync {
152    type StartResponseFut: std::future::Future<Output = Result<StartupStartResult, fidl::Error>>
153        + Send;
154    fn r#start(
155        &self,
156        device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
157        options: &StartOptions,
158    ) -> Self::StartResponseFut;
159    type FormatResponseFut: std::future::Future<Output = Result<StartupFormatResult, fidl::Error>>
160        + Send;
161    fn r#format(
162        &self,
163        device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
164        options: &FormatOptions,
165    ) -> Self::FormatResponseFut;
166    type CheckResponseFut: std::future::Future<Output = Result<StartupCheckResult, fidl::Error>>
167        + Send;
168    fn r#check(
169        &self,
170        device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
171        options: CheckOptions,
172    ) -> Self::CheckResponseFut;
173}
174#[derive(Debug)]
175#[cfg(target_os = "fuchsia")]
176pub struct StartupSynchronousProxy {
177    client: fidl::client::sync::Client,
178}
179
180#[cfg(target_os = "fuchsia")]
181impl fidl::endpoints::SynchronousProxy for StartupSynchronousProxy {
182    type Proxy = StartupProxy;
183    type Protocol = StartupMarker;
184
185    fn from_channel(inner: fidl::Channel) -> Self {
186        Self::new(inner)
187    }
188
189    fn into_channel(self) -> fidl::Channel {
190        self.client.into_channel()
191    }
192
193    fn as_channel(&self) -> &fidl::Channel {
194        self.client.as_channel()
195    }
196}
197
198#[cfg(target_os = "fuchsia")]
199impl StartupSynchronousProxy {
200    pub fn new(channel: fidl::Channel) -> Self {
201        Self { client: fidl::client::sync::Client::new(channel) }
202    }
203
204    pub fn into_channel(self) -> fidl::Channel {
205        self.client.into_channel()
206    }
207
208    /// Waits until an event arrives and returns it. It is safe for other
209    /// threads to make concurrent requests while waiting for an event.
210    pub fn wait_for_event(
211        &self,
212        deadline: zx::MonotonicInstant,
213    ) -> Result<StartupEvent, fidl::Error> {
214        StartupEvent::decode(self.client.wait_for_event::<StartupMarker>(deadline)?)
215    }
216
217    /// Start this filesystem, using the provided block device and Start options. When start is
218    /// called, the filesystem will populate its outgoing directory and then return.
219    pub fn r#start(
220        &self,
221        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
222        mut options: &StartOptions,
223        ___deadline: zx::MonotonicInstant,
224    ) -> Result<StartupStartResult, fidl::Error> {
225        let _response = self.client.send_query::<
226            StartupStartRequest,
227            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
228            StartupMarker,
229        >(
230            (device, options,),
231            0x317aa9458d3190c8,
232            fidl::encoding::DynamicFlags::empty(),
233            ___deadline,
234        )?;
235        Ok(_response.map(|x| x))
236    }
237
238    /// Format the provided block device with this filesystem.
239    pub fn r#format(
240        &self,
241        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
242        mut options: &FormatOptions,
243        ___deadline: zx::MonotonicInstant,
244    ) -> Result<StartupFormatResult, fidl::Error> {
245        let _response = self.client.send_query::<
246            StartupFormatRequest,
247            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
248            StartupMarker,
249        >(
250            (device, options,),
251            0x3124676dd91933de,
252            fidl::encoding::DynamicFlags::empty(),
253            ___deadline,
254        )?;
255        Ok(_response.map(|x| x))
256    }
257
258    /// Check the provided block device for filesystem consistency.
259    /// Note that some filesystems (e.g. Fxfs) support online fsck, in which case they can be
260    /// checked after being started.  In this case, the passed block device is ignored.
261    pub fn r#check(
262        &self,
263        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
264        mut options: CheckOptions,
265        ___deadline: zx::MonotonicInstant,
266    ) -> Result<StartupCheckResult, fidl::Error> {
267        let _response = self.client.send_query::<
268            StartupCheckRequest,
269            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
270            StartupMarker,
271        >(
272            (device, &mut options,),
273            0x81e85b3190e7db3,
274            fidl::encoding::DynamicFlags::empty(),
275            ___deadline,
276        )?;
277        Ok(_response.map(|x| x))
278    }
279}
280
281#[cfg(target_os = "fuchsia")]
282impl From<StartupSynchronousProxy> for zx::NullableHandle {
283    fn from(value: StartupSynchronousProxy) -> Self {
284        value.into_channel().into()
285    }
286}
287
288#[cfg(target_os = "fuchsia")]
289impl From<fidl::Channel> for StartupSynchronousProxy {
290    fn from(value: fidl::Channel) -> Self {
291        Self::new(value)
292    }
293}
294
295#[cfg(target_os = "fuchsia")]
296impl fidl::endpoints::FromClient for StartupSynchronousProxy {
297    type Protocol = StartupMarker;
298
299    fn from_client(value: fidl::endpoints::ClientEnd<StartupMarker>) -> Self {
300        Self::new(value.into_channel())
301    }
302}
303
304#[derive(Debug, Clone)]
305pub struct StartupProxy {
306    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
307}
308
309impl fidl::endpoints::Proxy for StartupProxy {
310    type Protocol = StartupMarker;
311
312    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
313        Self::new(inner)
314    }
315
316    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
317        self.client.into_channel().map_err(|client| Self { client })
318    }
319
320    fn as_channel(&self) -> &::fidl::AsyncChannel {
321        self.client.as_channel()
322    }
323}
324
325impl StartupProxy {
326    /// Create a new Proxy for fuchsia.fs.startup/Startup.
327    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
328        let protocol_name = <StartupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
329        Self { client: fidl::client::Client::new(channel, protocol_name) }
330    }
331
332    /// Get a Stream of events from the remote end of the protocol.
333    ///
334    /// # Panics
335    ///
336    /// Panics if the event stream was already taken.
337    pub fn take_event_stream(&self) -> StartupEventStream {
338        StartupEventStream { event_receiver: self.client.take_event_receiver() }
339    }
340
341    /// Start this filesystem, using the provided block device and Start options. When start is
342    /// called, the filesystem will populate its outgoing directory and then return.
343    pub fn r#start(
344        &self,
345        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
346        mut options: &StartOptions,
347    ) -> fidl::client::QueryResponseFut<
348        StartupStartResult,
349        fidl::encoding::DefaultFuchsiaResourceDialect,
350    > {
351        StartupProxyInterface::r#start(self, device, options)
352    }
353
354    /// Format the provided block device with this filesystem.
355    pub fn r#format(
356        &self,
357        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
358        mut options: &FormatOptions,
359    ) -> fidl::client::QueryResponseFut<
360        StartupFormatResult,
361        fidl::encoding::DefaultFuchsiaResourceDialect,
362    > {
363        StartupProxyInterface::r#format(self, device, options)
364    }
365
366    /// Check the provided block device for filesystem consistency.
367    /// Note that some filesystems (e.g. Fxfs) support online fsck, in which case they can be
368    /// checked after being started.  In this case, the passed block device is ignored.
369    pub fn r#check(
370        &self,
371        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
372        mut options: CheckOptions,
373    ) -> fidl::client::QueryResponseFut<
374        StartupCheckResult,
375        fidl::encoding::DefaultFuchsiaResourceDialect,
376    > {
377        StartupProxyInterface::r#check(self, device, options)
378    }
379}
380
381impl StartupProxyInterface for StartupProxy {
382    type StartResponseFut = fidl::client::QueryResponseFut<
383        StartupStartResult,
384        fidl::encoding::DefaultFuchsiaResourceDialect,
385    >;
386    fn r#start(
387        &self,
388        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
389        mut options: &StartOptions,
390    ) -> Self::StartResponseFut {
391        fn _decode(
392            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
393        ) -> Result<StartupStartResult, fidl::Error> {
394            let _response = fidl::client::decode_transaction_body::<
395                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
396                fidl::encoding::DefaultFuchsiaResourceDialect,
397                0x317aa9458d3190c8,
398            >(_buf?)?;
399            Ok(_response.map(|x| x))
400        }
401        self.client.send_query_and_decode::<StartupStartRequest, StartupStartResult>(
402            (device, options),
403            0x317aa9458d3190c8,
404            fidl::encoding::DynamicFlags::empty(),
405            _decode,
406        )
407    }
408
409    type FormatResponseFut = fidl::client::QueryResponseFut<
410        StartupFormatResult,
411        fidl::encoding::DefaultFuchsiaResourceDialect,
412    >;
413    fn r#format(
414        &self,
415        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
416        mut options: &FormatOptions,
417    ) -> Self::FormatResponseFut {
418        fn _decode(
419            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
420        ) -> Result<StartupFormatResult, fidl::Error> {
421            let _response = fidl::client::decode_transaction_body::<
422                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
423                fidl::encoding::DefaultFuchsiaResourceDialect,
424                0x3124676dd91933de,
425            >(_buf?)?;
426            Ok(_response.map(|x| x))
427        }
428        self.client.send_query_and_decode::<StartupFormatRequest, StartupFormatResult>(
429            (device, options),
430            0x3124676dd91933de,
431            fidl::encoding::DynamicFlags::empty(),
432            _decode,
433        )
434    }
435
436    type CheckResponseFut = fidl::client::QueryResponseFut<
437        StartupCheckResult,
438        fidl::encoding::DefaultFuchsiaResourceDialect,
439    >;
440    fn r#check(
441        &self,
442        mut device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
443        mut options: CheckOptions,
444    ) -> Self::CheckResponseFut {
445        fn _decode(
446            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
447        ) -> Result<StartupCheckResult, fidl::Error> {
448            let _response = fidl::client::decode_transaction_body::<
449                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
450                fidl::encoding::DefaultFuchsiaResourceDialect,
451                0x81e85b3190e7db3,
452            >(_buf?)?;
453            Ok(_response.map(|x| x))
454        }
455        self.client.send_query_and_decode::<StartupCheckRequest, StartupCheckResult>(
456            (device, &mut options),
457            0x81e85b3190e7db3,
458            fidl::encoding::DynamicFlags::empty(),
459            _decode,
460        )
461    }
462}
463
464pub struct StartupEventStream {
465    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
466}
467
468impl std::marker::Unpin for StartupEventStream {}
469
470impl futures::stream::FusedStream for StartupEventStream {
471    fn is_terminated(&self) -> bool {
472        self.event_receiver.is_terminated()
473    }
474}
475
476impl futures::Stream for StartupEventStream {
477    type Item = Result<StartupEvent, fidl::Error>;
478
479    fn poll_next(
480        mut self: std::pin::Pin<&mut Self>,
481        cx: &mut std::task::Context<'_>,
482    ) -> std::task::Poll<Option<Self::Item>> {
483        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
484            &mut self.event_receiver,
485            cx
486        )?) {
487            Some(buf) => std::task::Poll::Ready(Some(StartupEvent::decode(buf))),
488            None => std::task::Poll::Ready(None),
489        }
490    }
491}
492
493#[derive(Debug)]
494pub enum StartupEvent {}
495
496impl StartupEvent {
497    /// Decodes a message buffer as a [`StartupEvent`].
498    fn decode(
499        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
500    ) -> Result<StartupEvent, fidl::Error> {
501        let (bytes, _handles) = buf.split_mut();
502        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
503        debug_assert_eq!(tx_header.tx_id, 0);
504        match tx_header.ordinal {
505            _ => Err(fidl::Error::UnknownOrdinal {
506                ordinal: tx_header.ordinal,
507                protocol_name: <StartupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
508            }),
509        }
510    }
511}
512
513/// A Stream of incoming requests for fuchsia.fs.startup/Startup.
514pub struct StartupRequestStream {
515    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
516    is_terminated: bool,
517}
518
519impl std::marker::Unpin for StartupRequestStream {}
520
521impl futures::stream::FusedStream for StartupRequestStream {
522    fn is_terminated(&self) -> bool {
523        self.is_terminated
524    }
525}
526
527impl fidl::endpoints::RequestStream for StartupRequestStream {
528    type Protocol = StartupMarker;
529    type ControlHandle = StartupControlHandle;
530
531    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
532        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
533    }
534
535    fn control_handle(&self) -> Self::ControlHandle {
536        StartupControlHandle { inner: self.inner.clone() }
537    }
538
539    fn into_inner(
540        self,
541    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
542    {
543        (self.inner, self.is_terminated)
544    }
545
546    fn from_inner(
547        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
548        is_terminated: bool,
549    ) -> Self {
550        Self { inner, is_terminated }
551    }
552}
553
554impl futures::Stream for StartupRequestStream {
555    type Item = Result<StartupRequest, fidl::Error>;
556
557    fn poll_next(
558        mut self: std::pin::Pin<&mut Self>,
559        cx: &mut std::task::Context<'_>,
560    ) -> std::task::Poll<Option<Self::Item>> {
561        let this = &mut *self;
562        if this.inner.check_shutdown(cx) {
563            this.is_terminated = true;
564            return std::task::Poll::Ready(None);
565        }
566        if this.is_terminated {
567            panic!("polled StartupRequestStream after completion");
568        }
569        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
570            |bytes, handles| {
571                match this.inner.channel().read_etc(cx, bytes, handles) {
572                    std::task::Poll::Ready(Ok(())) => {}
573                    std::task::Poll::Pending => return std::task::Poll::Pending,
574                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
575                        this.is_terminated = true;
576                        return std::task::Poll::Ready(None);
577                    }
578                    std::task::Poll::Ready(Err(e)) => {
579                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
580                            e.into(),
581                        ))));
582                    }
583                }
584
585                // A message has been received from the channel
586                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
587
588                std::task::Poll::Ready(Some(match header.ordinal {
589                    0x317aa9458d3190c8 => {
590                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
591                        let mut req = fidl::new_empty!(
592                            StartupStartRequest,
593                            fidl::encoding::DefaultFuchsiaResourceDialect
594                        );
595                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StartupStartRequest>(&header, _body_bytes, handles, &mut req)?;
596                        let control_handle = StartupControlHandle { inner: this.inner.clone() };
597                        Ok(StartupRequest::Start {
598                            device: req.device,
599                            options: req.options,
600
601                            responder: StartupStartResponder {
602                                control_handle: std::mem::ManuallyDrop::new(control_handle),
603                                tx_id: header.tx_id,
604                            },
605                        })
606                    }
607                    0x3124676dd91933de => {
608                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
609                        let mut req = fidl::new_empty!(
610                            StartupFormatRequest,
611                            fidl::encoding::DefaultFuchsiaResourceDialect
612                        );
613                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StartupFormatRequest>(&header, _body_bytes, handles, &mut req)?;
614                        let control_handle = StartupControlHandle { inner: this.inner.clone() };
615                        Ok(StartupRequest::Format {
616                            device: req.device,
617                            options: req.options,
618
619                            responder: StartupFormatResponder {
620                                control_handle: std::mem::ManuallyDrop::new(control_handle),
621                                tx_id: header.tx_id,
622                            },
623                        })
624                    }
625                    0x81e85b3190e7db3 => {
626                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
627                        let mut req = fidl::new_empty!(
628                            StartupCheckRequest,
629                            fidl::encoding::DefaultFuchsiaResourceDialect
630                        );
631                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StartupCheckRequest>(&header, _body_bytes, handles, &mut req)?;
632                        let control_handle = StartupControlHandle { inner: this.inner.clone() };
633                        Ok(StartupRequest::Check {
634                            device: req.device,
635                            options: req.options,
636
637                            responder: StartupCheckResponder {
638                                control_handle: std::mem::ManuallyDrop::new(control_handle),
639                                tx_id: header.tx_id,
640                            },
641                        })
642                    }
643                    _ => Err(fidl::Error::UnknownOrdinal {
644                        ordinal: header.ordinal,
645                        protocol_name:
646                            <StartupMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
647                    }),
648                }))
649            },
650        )
651    }
652}
653
654#[derive(Debug)]
655pub enum StartupRequest {
656    /// Start this filesystem, using the provided block device and Start options. When start is
657    /// called, the filesystem will populate its outgoing directory and then return.
658    Start {
659        device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
660        options: StartOptions,
661        responder: StartupStartResponder,
662    },
663    /// Format the provided block device with this filesystem.
664    Format {
665        device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
666        options: FormatOptions,
667        responder: StartupFormatResponder,
668    },
669    /// Check the provided block device for filesystem consistency.
670    /// Note that some filesystems (e.g. Fxfs) support online fsck, in which case they can be
671    /// checked after being started.  In this case, the passed block device is ignored.
672    Check {
673        device: fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
674        options: CheckOptions,
675        responder: StartupCheckResponder,
676    },
677}
678
679impl StartupRequest {
680    #[allow(irrefutable_let_patterns)]
681    pub fn into_start(
682        self,
683    ) -> Option<(
684        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
685        StartOptions,
686        StartupStartResponder,
687    )> {
688        if let StartupRequest::Start { device, options, responder } = self {
689            Some((device, options, responder))
690        } else {
691            None
692        }
693    }
694
695    #[allow(irrefutable_let_patterns)]
696    pub fn into_format(
697        self,
698    ) -> Option<(
699        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
700        FormatOptions,
701        StartupFormatResponder,
702    )> {
703        if let StartupRequest::Format { device, options, responder } = self {
704            Some((device, options, responder))
705        } else {
706            None
707        }
708    }
709
710    #[allow(irrefutable_let_patterns)]
711    pub fn into_check(
712        self,
713    ) -> Option<(
714        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
715        CheckOptions,
716        StartupCheckResponder,
717    )> {
718        if let StartupRequest::Check { device, options, responder } = self {
719            Some((device, options, responder))
720        } else {
721            None
722        }
723    }
724
725    /// Name of the method defined in FIDL
726    pub fn method_name(&self) -> &'static str {
727        match *self {
728            StartupRequest::Start { .. } => "start",
729            StartupRequest::Format { .. } => "format",
730            StartupRequest::Check { .. } => "check",
731        }
732    }
733}
734
735#[derive(Debug, Clone)]
736pub struct StartupControlHandle {
737    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
738}
739
740impl StartupControlHandle {
741    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
742        self.inner.shutdown_with_epitaph(status.into())
743    }
744}
745
746impl fidl::endpoints::ControlHandle for StartupControlHandle {
747    fn shutdown(&self) {
748        self.inner.shutdown()
749    }
750
751    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
752        self.inner.shutdown_with_epitaph(status)
753    }
754
755    fn is_closed(&self) -> bool {
756        self.inner.channel().is_closed()
757    }
758    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
759        self.inner.channel().on_closed()
760    }
761
762    #[cfg(target_os = "fuchsia")]
763    fn signal_peer(
764        &self,
765        clear_mask: zx::Signals,
766        set_mask: zx::Signals,
767    ) -> Result<(), zx_status::Status> {
768        use fidl::Peered;
769        self.inner.channel().signal_peer(clear_mask, set_mask)
770    }
771}
772
773impl StartupControlHandle {}
774
775#[must_use = "FIDL methods require a response to be sent"]
776#[derive(Debug)]
777pub struct StartupStartResponder {
778    control_handle: std::mem::ManuallyDrop<StartupControlHandle>,
779    tx_id: u32,
780}
781
782/// Set the the channel to be shutdown (see [`StartupControlHandle::shutdown`])
783/// if the responder is dropped without sending a response, so that the client
784/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
785impl std::ops::Drop for StartupStartResponder {
786    fn drop(&mut self) {
787        self.control_handle.shutdown();
788        // Safety: drops once, never accessed again
789        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
790    }
791}
792
793impl fidl::endpoints::Responder for StartupStartResponder {
794    type ControlHandle = StartupControlHandle;
795
796    fn control_handle(&self) -> &StartupControlHandle {
797        &self.control_handle
798    }
799
800    fn drop_without_shutdown(mut self) {
801        // Safety: drops once, never accessed again due to mem::forget
802        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
803        // Prevent Drop from running (which would shut down the channel)
804        std::mem::forget(self);
805    }
806}
807
808impl StartupStartResponder {
809    /// Sends a response to the FIDL transaction.
810    ///
811    /// Sets the channel to shutdown if an error occurs.
812    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
813        let _result = self.send_raw(result);
814        if _result.is_err() {
815            self.control_handle.shutdown();
816        }
817        self.drop_without_shutdown();
818        _result
819    }
820
821    /// Similar to "send" but does not shutdown the channel if an error occurs.
822    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
823        let _result = self.send_raw(result);
824        self.drop_without_shutdown();
825        _result
826    }
827
828    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
829        self.control_handle
830            .inner
831            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
832                result,
833                self.tx_id,
834                0x317aa9458d3190c8,
835                fidl::encoding::DynamicFlags::empty(),
836            )
837    }
838}
839
840#[must_use = "FIDL methods require a response to be sent"]
841#[derive(Debug)]
842pub struct StartupFormatResponder {
843    control_handle: std::mem::ManuallyDrop<StartupControlHandle>,
844    tx_id: u32,
845}
846
847/// Set the the channel to be shutdown (see [`StartupControlHandle::shutdown`])
848/// if the responder is dropped without sending a response, so that the client
849/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
850impl std::ops::Drop for StartupFormatResponder {
851    fn drop(&mut self) {
852        self.control_handle.shutdown();
853        // Safety: drops once, never accessed again
854        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
855    }
856}
857
858impl fidl::endpoints::Responder for StartupFormatResponder {
859    type ControlHandle = StartupControlHandle;
860
861    fn control_handle(&self) -> &StartupControlHandle {
862        &self.control_handle
863    }
864
865    fn drop_without_shutdown(mut self) {
866        // Safety: drops once, never accessed again due to mem::forget
867        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
868        // Prevent Drop from running (which would shut down the channel)
869        std::mem::forget(self);
870    }
871}
872
873impl StartupFormatResponder {
874    /// Sends a response to the FIDL transaction.
875    ///
876    /// Sets the channel to shutdown if an error occurs.
877    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
878        let _result = self.send_raw(result);
879        if _result.is_err() {
880            self.control_handle.shutdown();
881        }
882        self.drop_without_shutdown();
883        _result
884    }
885
886    /// Similar to "send" but does not shutdown the channel if an error occurs.
887    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
888        let _result = self.send_raw(result);
889        self.drop_without_shutdown();
890        _result
891    }
892
893    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
894        self.control_handle
895            .inner
896            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
897                result,
898                self.tx_id,
899                0x3124676dd91933de,
900                fidl::encoding::DynamicFlags::empty(),
901            )
902    }
903}
904
905#[must_use = "FIDL methods require a response to be sent"]
906#[derive(Debug)]
907pub struct StartupCheckResponder {
908    control_handle: std::mem::ManuallyDrop<StartupControlHandle>,
909    tx_id: u32,
910}
911
912/// Set the the channel to be shutdown (see [`StartupControlHandle::shutdown`])
913/// if the responder is dropped without sending a response, so that the client
914/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
915impl std::ops::Drop for StartupCheckResponder {
916    fn drop(&mut self) {
917        self.control_handle.shutdown();
918        // Safety: drops once, never accessed again
919        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
920    }
921}
922
923impl fidl::endpoints::Responder for StartupCheckResponder {
924    type ControlHandle = StartupControlHandle;
925
926    fn control_handle(&self) -> &StartupControlHandle {
927        &self.control_handle
928    }
929
930    fn drop_without_shutdown(mut self) {
931        // Safety: drops once, never accessed again due to mem::forget
932        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
933        // Prevent Drop from running (which would shut down the channel)
934        std::mem::forget(self);
935    }
936}
937
938impl StartupCheckResponder {
939    /// Sends a response to the FIDL transaction.
940    ///
941    /// Sets the channel to shutdown if an error occurs.
942    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
943        let _result = self.send_raw(result);
944        if _result.is_err() {
945            self.control_handle.shutdown();
946        }
947        self.drop_without_shutdown();
948        _result
949    }
950
951    /// Similar to "send" but does not shutdown the channel if an error occurs.
952    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
953        let _result = self.send_raw(result);
954        self.drop_without_shutdown();
955        _result
956    }
957
958    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
959        self.control_handle
960            .inner
961            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
962                result,
963                self.tx_id,
964                0x81e85b3190e7db3,
965                fidl::encoding::DynamicFlags::empty(),
966            )
967    }
968}
969
970#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
971pub struct VolumeMarker;
972
973impl fidl::endpoints::ProtocolMarker for VolumeMarker {
974    type Proxy = VolumeProxy;
975    type RequestStream = VolumeRequestStream;
976    #[cfg(target_os = "fuchsia")]
977    type SynchronousProxy = VolumeSynchronousProxy;
978
979    const DEBUG_NAME: &'static str = "(anonymous) Volume";
980}
981pub type VolumeMountResult = Result<(), i32>;
982pub type VolumeMountRemoteResult =
983    Result<(fidl_fuchsia_fxfs::VolumeInfo, fidl_fuchsia_fxfs::LayerSet, [u8; 16]), i32>;
984pub type VolumeCheckResult = Result<(), i32>;
985pub type VolumeSetLimitResult = Result<(), i32>;
986pub type VolumeGetLimitResult = Result<u64, i32>;
987pub type VolumeGetInfoResult = Result<VolumeInfo, i32>;
988
989pub trait VolumeProxyInterface: Send + Sync {
990    type MountResponseFut: std::future::Future<Output = Result<VolumeMountResult, fidl::Error>>
991        + Send;
992    fn r#mount(
993        &self,
994        outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
995        options: MountOptions,
996    ) -> Self::MountResponseFut;
997    type MountRemoteResponseFut: std::future::Future<Output = Result<VolumeMountRemoteResult, fidl::Error>>
998        + Send;
999    fn r#mount_remote(
1000        &self,
1001        options: MountOptions,
1002        volume: fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
1003    ) -> Self::MountRemoteResponseFut;
1004    type CheckResponseFut: std::future::Future<Output = Result<VolumeCheckResult, fidl::Error>>
1005        + Send;
1006    fn r#check(&self, options: CheckOptions) -> Self::CheckResponseFut;
1007    type SetLimitResponseFut: std::future::Future<Output = Result<VolumeSetLimitResult, fidl::Error>>
1008        + Send;
1009    fn r#set_limit(&self, bytes: u64) -> Self::SetLimitResponseFut;
1010    type GetLimitResponseFut: std::future::Future<Output = Result<VolumeGetLimitResult, fidl::Error>>
1011        + Send;
1012    fn r#get_limit(&self) -> Self::GetLimitResponseFut;
1013    type GetInfoResponseFut: std::future::Future<Output = Result<VolumeGetInfoResult, fidl::Error>>
1014        + Send;
1015    fn r#get_info(&self) -> Self::GetInfoResponseFut;
1016}
1017#[derive(Debug)]
1018#[cfg(target_os = "fuchsia")]
1019pub struct VolumeSynchronousProxy {
1020    client: fidl::client::sync::Client,
1021}
1022
1023#[cfg(target_os = "fuchsia")]
1024impl fidl::endpoints::SynchronousProxy for VolumeSynchronousProxy {
1025    type Proxy = VolumeProxy;
1026    type Protocol = VolumeMarker;
1027
1028    fn from_channel(inner: fidl::Channel) -> Self {
1029        Self::new(inner)
1030    }
1031
1032    fn into_channel(self) -> fidl::Channel {
1033        self.client.into_channel()
1034    }
1035
1036    fn as_channel(&self) -> &fidl::Channel {
1037        self.client.as_channel()
1038    }
1039}
1040
1041#[cfg(target_os = "fuchsia")]
1042impl VolumeSynchronousProxy {
1043    pub fn new(channel: fidl::Channel) -> Self {
1044        Self { client: fidl::client::sync::Client::new(channel) }
1045    }
1046
1047    pub fn into_channel(self) -> fidl::Channel {
1048        self.client.into_channel()
1049    }
1050
1051    /// Waits until an event arrives and returns it. It is safe for other
1052    /// threads to make concurrent requests while waiting for an event.
1053    pub fn wait_for_event(
1054        &self,
1055        deadline: zx::MonotonicInstant,
1056    ) -> Result<VolumeEvent, fidl::Error> {
1057        VolumeEvent::decode(self.client.wait_for_event::<VolumeMarker>(deadline)?)
1058    }
1059
1060    /// Mounts the volume.  If the volume is encrypted, `options.crypt` should provide all key
1061    /// access for the given volume.  `outgoing_directory` will contain the root and other services
1062    /// exposed by the volume.  To lock the volume, call fuchsia.fs.Admin.Shutdown on the returned
1063    /// handle.
1064    pub fn r#mount(
1065        &self,
1066        mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1067        mut options: MountOptions,
1068        ___deadline: zx::MonotonicInstant,
1069    ) -> Result<VolumeMountResult, fidl::Error> {
1070        let _response = self.client.send_query::<
1071            VolumeMountRequest,
1072            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1073            VolumeMarker,
1074        >(
1075            (outgoing_directory, &mut options,),
1076            0x3470ab56d455af0,
1077            fidl::encoding::DynamicFlags::empty(),
1078            ___deadline,
1079        )?;
1080        Ok(_response.map(|x| x))
1081    }
1082
1083    /// Mounts the volume for remote in-process serving.
1084    pub fn r#mount_remote(
1085        &self,
1086        mut options: MountOptions,
1087        mut volume: fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
1088        ___deadline: zx::MonotonicInstant,
1089    ) -> Result<VolumeMountRemoteResult, fidl::Error> {
1090        let _response = self.client.send_query::<
1091            VolumeMountRemoteRequest,
1092            fidl::encoding::ResultType<VolumeMountRemoteResponse, i32>,
1093            VolumeMarker,
1094        >(
1095            (&mut options, volume,),
1096            0x7ab50617c9b40e59,
1097            fidl::encoding::DynamicFlags::empty(),
1098            ___deadline,
1099        )?;
1100        Ok(_response.map(|x| (x.info, x.initial_layers, x.guid)))
1101    }
1102
1103    /// Check the volume for consistency.  If the volume is encrypted, `options.crypt` should
1104    /// provide all key access for the given volume.
1105    pub fn r#check(
1106        &self,
1107        mut options: CheckOptions,
1108        ___deadline: zx::MonotonicInstant,
1109    ) -> Result<VolumeCheckResult, fidl::Error> {
1110        let _response = self.client.send_query::<
1111            VolumeCheckRequest,
1112            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1113            VolumeMarker,
1114        >(
1115            (&mut options,),
1116            0x5b638348f5e0418c,
1117            fidl::encoding::DynamicFlags::empty(),
1118            ___deadline,
1119        )?;
1120        Ok(_response.map(|x| x))
1121    }
1122
1123    /// Set the limit in bytes on the volume. Setting it lower than current usage is accepted but
1124    /// will prevent further increases.
1125    pub fn r#set_limit(
1126        &self,
1127        mut bytes: u64,
1128        ___deadline: zx::MonotonicInstant,
1129    ) -> Result<VolumeSetLimitResult, fidl::Error> {
1130        let _response = self.client.send_query::<
1131            VolumeSetLimitRequest,
1132            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1133            VolumeMarker,
1134        >(
1135            (bytes,),
1136            0x19286d83eb3cd137,
1137            fidl::encoding::DynamicFlags::empty(),
1138            ___deadline,
1139        )?;
1140        Ok(_response.map(|x| x))
1141    }
1142
1143    /// Get the allocation limit for the volume. A return value of 0 indicates that there
1144    /// is no limit and the volume can be extended as long as there is available space on the
1145    /// device.
1146    ///
1147    /// The volume may be larger than this limit if a smaller limit was applied after the
1148    /// volume had already grown to the current size.
1149    ///
1150    /// The volume limit persists across reboots.
1151    pub fn r#get_limit(
1152        &self,
1153        ___deadline: zx::MonotonicInstant,
1154    ) -> Result<VolumeGetLimitResult, fidl::Error> {
1155        let _response = self.client.send_query::<
1156            fidl::encoding::EmptyPayload,
1157            fidl::encoding::ResultType<VolumeGetLimitResponse, i32>,
1158            VolumeMarker,
1159        >(
1160            (),
1161            0xb14e4950939f16,
1162            fidl::encoding::DynamicFlags::empty(),
1163            ___deadline,
1164        )?;
1165        Ok(_response.map(|x| x.bytes))
1166    }
1167
1168    /// Returns information about the volume.
1169    pub fn r#get_info(
1170        &self,
1171        ___deadline: zx::MonotonicInstant,
1172    ) -> Result<VolumeGetInfoResult, fidl::Error> {
1173        let _response = self.client.send_query::<
1174            fidl::encoding::EmptyPayload,
1175            fidl::encoding::ResultType<VolumeInfo, i32>,
1176            VolumeMarker,
1177        >(
1178            (),
1179            0x481018250e109f53,
1180            fidl::encoding::DynamicFlags::empty(),
1181            ___deadline,
1182        )?;
1183        Ok(_response.map(|x| x))
1184    }
1185}
1186
1187#[cfg(target_os = "fuchsia")]
1188impl From<VolumeSynchronousProxy> for zx::NullableHandle {
1189    fn from(value: VolumeSynchronousProxy) -> Self {
1190        value.into_channel().into()
1191    }
1192}
1193
1194#[cfg(target_os = "fuchsia")]
1195impl From<fidl::Channel> for VolumeSynchronousProxy {
1196    fn from(value: fidl::Channel) -> Self {
1197        Self::new(value)
1198    }
1199}
1200
1201#[cfg(target_os = "fuchsia")]
1202impl fidl::endpoints::FromClient for VolumeSynchronousProxy {
1203    type Protocol = VolumeMarker;
1204
1205    fn from_client(value: fidl::endpoints::ClientEnd<VolumeMarker>) -> Self {
1206        Self::new(value.into_channel())
1207    }
1208}
1209
1210#[derive(Debug, Clone)]
1211pub struct VolumeProxy {
1212    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1213}
1214
1215impl fidl::endpoints::Proxy for VolumeProxy {
1216    type Protocol = VolumeMarker;
1217
1218    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1219        Self::new(inner)
1220    }
1221
1222    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1223        self.client.into_channel().map_err(|client| Self { client })
1224    }
1225
1226    fn as_channel(&self) -> &::fidl::AsyncChannel {
1227        self.client.as_channel()
1228    }
1229}
1230
1231impl VolumeProxy {
1232    /// Create a new Proxy for fuchsia.fs.startup/Volume.
1233    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1234        let protocol_name = <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1235        Self { client: fidl::client::Client::new(channel, protocol_name) }
1236    }
1237
1238    /// Get a Stream of events from the remote end of the protocol.
1239    ///
1240    /// # Panics
1241    ///
1242    /// Panics if the event stream was already taken.
1243    pub fn take_event_stream(&self) -> VolumeEventStream {
1244        VolumeEventStream { event_receiver: self.client.take_event_receiver() }
1245    }
1246
1247    /// Mounts the volume.  If the volume is encrypted, `options.crypt` should provide all key
1248    /// access for the given volume.  `outgoing_directory` will contain the root and other services
1249    /// exposed by the volume.  To lock the volume, call fuchsia.fs.Admin.Shutdown on the returned
1250    /// handle.
1251    pub fn r#mount(
1252        &self,
1253        mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1254        mut options: MountOptions,
1255    ) -> fidl::client::QueryResponseFut<
1256        VolumeMountResult,
1257        fidl::encoding::DefaultFuchsiaResourceDialect,
1258    > {
1259        VolumeProxyInterface::r#mount(self, outgoing_directory, options)
1260    }
1261
1262    /// Mounts the volume for remote in-process serving.
1263    pub fn r#mount_remote(
1264        &self,
1265        mut options: MountOptions,
1266        mut volume: fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
1267    ) -> fidl::client::QueryResponseFut<
1268        VolumeMountRemoteResult,
1269        fidl::encoding::DefaultFuchsiaResourceDialect,
1270    > {
1271        VolumeProxyInterface::r#mount_remote(self, options, volume)
1272    }
1273
1274    /// Check the volume for consistency.  If the volume is encrypted, `options.crypt` should
1275    /// provide all key access for the given volume.
1276    pub fn r#check(
1277        &self,
1278        mut options: CheckOptions,
1279    ) -> fidl::client::QueryResponseFut<
1280        VolumeCheckResult,
1281        fidl::encoding::DefaultFuchsiaResourceDialect,
1282    > {
1283        VolumeProxyInterface::r#check(self, options)
1284    }
1285
1286    /// Set the limit in bytes on the volume. Setting it lower than current usage is accepted but
1287    /// will prevent further increases.
1288    pub fn r#set_limit(
1289        &self,
1290        mut bytes: u64,
1291    ) -> fidl::client::QueryResponseFut<
1292        VolumeSetLimitResult,
1293        fidl::encoding::DefaultFuchsiaResourceDialect,
1294    > {
1295        VolumeProxyInterface::r#set_limit(self, bytes)
1296    }
1297
1298    /// Get the allocation limit for the volume. A return value of 0 indicates that there
1299    /// is no limit and the volume can be extended as long as there is available space on the
1300    /// device.
1301    ///
1302    /// The volume may be larger than this limit if a smaller limit was applied after the
1303    /// volume had already grown to the current size.
1304    ///
1305    /// The volume limit persists across reboots.
1306    pub fn r#get_limit(
1307        &self,
1308    ) -> fidl::client::QueryResponseFut<
1309        VolumeGetLimitResult,
1310        fidl::encoding::DefaultFuchsiaResourceDialect,
1311    > {
1312        VolumeProxyInterface::r#get_limit(self)
1313    }
1314
1315    /// Returns information about the volume.
1316    pub fn r#get_info(
1317        &self,
1318    ) -> fidl::client::QueryResponseFut<
1319        VolumeGetInfoResult,
1320        fidl::encoding::DefaultFuchsiaResourceDialect,
1321    > {
1322        VolumeProxyInterface::r#get_info(self)
1323    }
1324}
1325
1326impl VolumeProxyInterface for VolumeProxy {
1327    type MountResponseFut = fidl::client::QueryResponseFut<
1328        VolumeMountResult,
1329        fidl::encoding::DefaultFuchsiaResourceDialect,
1330    >;
1331    fn r#mount(
1332        &self,
1333        mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1334        mut options: MountOptions,
1335    ) -> Self::MountResponseFut {
1336        fn _decode(
1337            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1338        ) -> Result<VolumeMountResult, fidl::Error> {
1339            let _response = fidl::client::decode_transaction_body::<
1340                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1341                fidl::encoding::DefaultFuchsiaResourceDialect,
1342                0x3470ab56d455af0,
1343            >(_buf?)?;
1344            Ok(_response.map(|x| x))
1345        }
1346        self.client.send_query_and_decode::<VolumeMountRequest, VolumeMountResult>(
1347            (outgoing_directory, &mut options),
1348            0x3470ab56d455af0,
1349            fidl::encoding::DynamicFlags::empty(),
1350            _decode,
1351        )
1352    }
1353
1354    type MountRemoteResponseFut = fidl::client::QueryResponseFut<
1355        VolumeMountRemoteResult,
1356        fidl::encoding::DefaultFuchsiaResourceDialect,
1357    >;
1358    fn r#mount_remote(
1359        &self,
1360        mut options: MountOptions,
1361        mut volume: fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
1362    ) -> Self::MountRemoteResponseFut {
1363        fn _decode(
1364            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1365        ) -> Result<VolumeMountRemoteResult, fidl::Error> {
1366            let _response = fidl::client::decode_transaction_body::<
1367                fidl::encoding::ResultType<VolumeMountRemoteResponse, i32>,
1368                fidl::encoding::DefaultFuchsiaResourceDialect,
1369                0x7ab50617c9b40e59,
1370            >(_buf?)?;
1371            Ok(_response.map(|x| (x.info, x.initial_layers, x.guid)))
1372        }
1373        self.client.send_query_and_decode::<VolumeMountRemoteRequest, VolumeMountRemoteResult>(
1374            (&mut options, volume),
1375            0x7ab50617c9b40e59,
1376            fidl::encoding::DynamicFlags::empty(),
1377            _decode,
1378        )
1379    }
1380
1381    type CheckResponseFut = fidl::client::QueryResponseFut<
1382        VolumeCheckResult,
1383        fidl::encoding::DefaultFuchsiaResourceDialect,
1384    >;
1385    fn r#check(&self, mut options: CheckOptions) -> Self::CheckResponseFut {
1386        fn _decode(
1387            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1388        ) -> Result<VolumeCheckResult, fidl::Error> {
1389            let _response = fidl::client::decode_transaction_body::<
1390                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1391                fidl::encoding::DefaultFuchsiaResourceDialect,
1392                0x5b638348f5e0418c,
1393            >(_buf?)?;
1394            Ok(_response.map(|x| x))
1395        }
1396        self.client.send_query_and_decode::<VolumeCheckRequest, VolumeCheckResult>(
1397            (&mut options,),
1398            0x5b638348f5e0418c,
1399            fidl::encoding::DynamicFlags::empty(),
1400            _decode,
1401        )
1402    }
1403
1404    type SetLimitResponseFut = fidl::client::QueryResponseFut<
1405        VolumeSetLimitResult,
1406        fidl::encoding::DefaultFuchsiaResourceDialect,
1407    >;
1408    fn r#set_limit(&self, mut bytes: u64) -> Self::SetLimitResponseFut {
1409        fn _decode(
1410            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1411        ) -> Result<VolumeSetLimitResult, fidl::Error> {
1412            let _response = fidl::client::decode_transaction_body::<
1413                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1414                fidl::encoding::DefaultFuchsiaResourceDialect,
1415                0x19286d83eb3cd137,
1416            >(_buf?)?;
1417            Ok(_response.map(|x| x))
1418        }
1419        self.client.send_query_and_decode::<VolumeSetLimitRequest, VolumeSetLimitResult>(
1420            (bytes,),
1421            0x19286d83eb3cd137,
1422            fidl::encoding::DynamicFlags::empty(),
1423            _decode,
1424        )
1425    }
1426
1427    type GetLimitResponseFut = fidl::client::QueryResponseFut<
1428        VolumeGetLimitResult,
1429        fidl::encoding::DefaultFuchsiaResourceDialect,
1430    >;
1431    fn r#get_limit(&self) -> Self::GetLimitResponseFut {
1432        fn _decode(
1433            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1434        ) -> Result<VolumeGetLimitResult, fidl::Error> {
1435            let _response = fidl::client::decode_transaction_body::<
1436                fidl::encoding::ResultType<VolumeGetLimitResponse, i32>,
1437                fidl::encoding::DefaultFuchsiaResourceDialect,
1438                0xb14e4950939f16,
1439            >(_buf?)?;
1440            Ok(_response.map(|x| x.bytes))
1441        }
1442        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, VolumeGetLimitResult>(
1443            (),
1444            0xb14e4950939f16,
1445            fidl::encoding::DynamicFlags::empty(),
1446            _decode,
1447        )
1448    }
1449
1450    type GetInfoResponseFut = fidl::client::QueryResponseFut<
1451        VolumeGetInfoResult,
1452        fidl::encoding::DefaultFuchsiaResourceDialect,
1453    >;
1454    fn r#get_info(&self) -> Self::GetInfoResponseFut {
1455        fn _decode(
1456            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1457        ) -> Result<VolumeGetInfoResult, fidl::Error> {
1458            let _response = fidl::client::decode_transaction_body::<
1459                fidl::encoding::ResultType<VolumeInfo, i32>,
1460                fidl::encoding::DefaultFuchsiaResourceDialect,
1461                0x481018250e109f53,
1462            >(_buf?)?;
1463            Ok(_response.map(|x| x))
1464        }
1465        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, VolumeGetInfoResult>(
1466            (),
1467            0x481018250e109f53,
1468            fidl::encoding::DynamicFlags::empty(),
1469            _decode,
1470        )
1471    }
1472}
1473
1474pub struct VolumeEventStream {
1475    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1476}
1477
1478impl std::marker::Unpin for VolumeEventStream {}
1479
1480impl futures::stream::FusedStream for VolumeEventStream {
1481    fn is_terminated(&self) -> bool {
1482        self.event_receiver.is_terminated()
1483    }
1484}
1485
1486impl futures::Stream for VolumeEventStream {
1487    type Item = Result<VolumeEvent, fidl::Error>;
1488
1489    fn poll_next(
1490        mut self: std::pin::Pin<&mut Self>,
1491        cx: &mut std::task::Context<'_>,
1492    ) -> std::task::Poll<Option<Self::Item>> {
1493        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1494            &mut self.event_receiver,
1495            cx
1496        )?) {
1497            Some(buf) => std::task::Poll::Ready(Some(VolumeEvent::decode(buf))),
1498            None => std::task::Poll::Ready(None),
1499        }
1500    }
1501}
1502
1503#[derive(Debug)]
1504pub enum VolumeEvent {}
1505
1506impl VolumeEvent {
1507    /// Decodes a message buffer as a [`VolumeEvent`].
1508    fn decode(
1509        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1510    ) -> Result<VolumeEvent, fidl::Error> {
1511        let (bytes, _handles) = buf.split_mut();
1512        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1513        debug_assert_eq!(tx_header.tx_id, 0);
1514        match tx_header.ordinal {
1515            _ => Err(fidl::Error::UnknownOrdinal {
1516                ordinal: tx_header.ordinal,
1517                protocol_name: <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1518            }),
1519        }
1520    }
1521}
1522
1523/// A Stream of incoming requests for fuchsia.fs.startup/Volume.
1524pub struct VolumeRequestStream {
1525    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1526    is_terminated: bool,
1527}
1528
1529impl std::marker::Unpin for VolumeRequestStream {}
1530
1531impl futures::stream::FusedStream for VolumeRequestStream {
1532    fn is_terminated(&self) -> bool {
1533        self.is_terminated
1534    }
1535}
1536
1537impl fidl::endpoints::RequestStream for VolumeRequestStream {
1538    type Protocol = VolumeMarker;
1539    type ControlHandle = VolumeControlHandle;
1540
1541    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1542        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1543    }
1544
1545    fn control_handle(&self) -> Self::ControlHandle {
1546        VolumeControlHandle { inner: self.inner.clone() }
1547    }
1548
1549    fn into_inner(
1550        self,
1551    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1552    {
1553        (self.inner, self.is_terminated)
1554    }
1555
1556    fn from_inner(
1557        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1558        is_terminated: bool,
1559    ) -> Self {
1560        Self { inner, is_terminated }
1561    }
1562}
1563
1564impl futures::Stream for VolumeRequestStream {
1565    type Item = Result<VolumeRequest, fidl::Error>;
1566
1567    fn poll_next(
1568        mut self: std::pin::Pin<&mut Self>,
1569        cx: &mut std::task::Context<'_>,
1570    ) -> std::task::Poll<Option<Self::Item>> {
1571        let this = &mut *self;
1572        if this.inner.check_shutdown(cx) {
1573            this.is_terminated = true;
1574            return std::task::Poll::Ready(None);
1575        }
1576        if this.is_terminated {
1577            panic!("polled VolumeRequestStream after completion");
1578        }
1579        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1580            |bytes, handles| {
1581                match this.inner.channel().read_etc(cx, bytes, handles) {
1582                    std::task::Poll::Ready(Ok(())) => {}
1583                    std::task::Poll::Pending => return std::task::Poll::Pending,
1584                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1585                        this.is_terminated = true;
1586                        return std::task::Poll::Ready(None);
1587                    }
1588                    std::task::Poll::Ready(Err(e)) => {
1589                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1590                            e.into(),
1591                        ))));
1592                    }
1593                }
1594
1595                // A message has been received from the channel
1596                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1597
1598                std::task::Poll::Ready(Some(match header.ordinal {
1599                    0x3470ab56d455af0 => {
1600                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1601                        let mut req = fidl::new_empty!(
1602                            VolumeMountRequest,
1603                            fidl::encoding::DefaultFuchsiaResourceDialect
1604                        );
1605                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeMountRequest>(&header, _body_bytes, handles, &mut req)?;
1606                        let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1607                        Ok(VolumeRequest::Mount {
1608                            outgoing_directory: req.outgoing_directory,
1609                            options: req.options,
1610
1611                            responder: VolumeMountResponder {
1612                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1613                                tx_id: header.tx_id,
1614                            },
1615                        })
1616                    }
1617                    0x7ab50617c9b40e59 => {
1618                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1619                        let mut req = fidl::new_empty!(
1620                            VolumeMountRemoteRequest,
1621                            fidl::encoding::DefaultFuchsiaResourceDialect
1622                        );
1623                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeMountRemoteRequest>(&header, _body_bytes, handles, &mut req)?;
1624                        let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1625                        Ok(VolumeRequest::MountRemote {
1626                            options: req.options,
1627                            volume: req.volume,
1628
1629                            responder: VolumeMountRemoteResponder {
1630                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1631                                tx_id: header.tx_id,
1632                            },
1633                        })
1634                    }
1635                    0x5b638348f5e0418c => {
1636                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1637                        let mut req = fidl::new_empty!(
1638                            VolumeCheckRequest,
1639                            fidl::encoding::DefaultFuchsiaResourceDialect
1640                        );
1641                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeCheckRequest>(&header, _body_bytes, handles, &mut req)?;
1642                        let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1643                        Ok(VolumeRequest::Check {
1644                            options: req.options,
1645
1646                            responder: VolumeCheckResponder {
1647                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1648                                tx_id: header.tx_id,
1649                            },
1650                        })
1651                    }
1652                    0x19286d83eb3cd137 => {
1653                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1654                        let mut req = fidl::new_empty!(
1655                            VolumeSetLimitRequest,
1656                            fidl::encoding::DefaultFuchsiaResourceDialect
1657                        );
1658                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeSetLimitRequest>(&header, _body_bytes, handles, &mut req)?;
1659                        let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1660                        Ok(VolumeRequest::SetLimit {
1661                            bytes: req.bytes,
1662
1663                            responder: VolumeSetLimitResponder {
1664                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1665                                tx_id: header.tx_id,
1666                            },
1667                        })
1668                    }
1669                    0xb14e4950939f16 => {
1670                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1671                        let mut req = fidl::new_empty!(
1672                            fidl::encoding::EmptyPayload,
1673                            fidl::encoding::DefaultFuchsiaResourceDialect
1674                        );
1675                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1676                        let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1677                        Ok(VolumeRequest::GetLimit {
1678                            responder: VolumeGetLimitResponder {
1679                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1680                                tx_id: header.tx_id,
1681                            },
1682                        })
1683                    }
1684                    0x481018250e109f53 => {
1685                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1686                        let mut req = fidl::new_empty!(
1687                            fidl::encoding::EmptyPayload,
1688                            fidl::encoding::DefaultFuchsiaResourceDialect
1689                        );
1690                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1691                        let control_handle = VolumeControlHandle { inner: this.inner.clone() };
1692                        Ok(VolumeRequest::GetInfo {
1693                            responder: VolumeGetInfoResponder {
1694                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1695                                tx_id: header.tx_id,
1696                            },
1697                        })
1698                    }
1699                    _ => Err(fidl::Error::UnknownOrdinal {
1700                        ordinal: header.ordinal,
1701                        protocol_name:
1702                            <VolumeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1703                    }),
1704                }))
1705            },
1706        )
1707    }
1708}
1709
1710#[derive(Debug)]
1711pub enum VolumeRequest {
1712    /// Mounts the volume.  If the volume is encrypted, `options.crypt` should provide all key
1713    /// access for the given volume.  `outgoing_directory` will contain the root and other services
1714    /// exposed by the volume.  To lock the volume, call fuchsia.fs.Admin.Shutdown on the returned
1715    /// handle.
1716    Mount {
1717        outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1718        options: MountOptions,
1719        responder: VolumeMountResponder,
1720    },
1721    /// Mounts the volume for remote in-process serving.
1722    MountRemote {
1723        options: MountOptions,
1724        volume: fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
1725        responder: VolumeMountRemoteResponder,
1726    },
1727    /// Check the volume for consistency.  If the volume is encrypted, `options.crypt` should
1728    /// provide all key access for the given volume.
1729    Check { options: CheckOptions, responder: VolumeCheckResponder },
1730    /// Set the limit in bytes on the volume. Setting it lower than current usage is accepted but
1731    /// will prevent further increases.
1732    SetLimit { bytes: u64, responder: VolumeSetLimitResponder },
1733    /// Get the allocation limit for the volume. A return value of 0 indicates that there
1734    /// is no limit and the volume can be extended as long as there is available space on the
1735    /// device.
1736    ///
1737    /// The volume may be larger than this limit if a smaller limit was applied after the
1738    /// volume had already grown to the current size.
1739    ///
1740    /// The volume limit persists across reboots.
1741    GetLimit { responder: VolumeGetLimitResponder },
1742    /// Returns information about the volume.
1743    GetInfo { responder: VolumeGetInfoResponder },
1744}
1745
1746impl VolumeRequest {
1747    #[allow(irrefutable_let_patterns)]
1748    pub fn into_mount(
1749        self,
1750    ) -> Option<(
1751        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
1752        MountOptions,
1753        VolumeMountResponder,
1754    )> {
1755        if let VolumeRequest::Mount { outgoing_directory, options, responder } = self {
1756            Some((outgoing_directory, options, responder))
1757        } else {
1758            None
1759        }
1760    }
1761
1762    #[allow(irrefutable_let_patterns)]
1763    pub fn into_mount_remote(
1764        self,
1765    ) -> Option<(
1766        MountOptions,
1767        fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
1768        VolumeMountRemoteResponder,
1769    )> {
1770        if let VolumeRequest::MountRemote { options, volume, responder } = self {
1771            Some((options, volume, responder))
1772        } else {
1773            None
1774        }
1775    }
1776
1777    #[allow(irrefutable_let_patterns)]
1778    pub fn into_check(self) -> Option<(CheckOptions, VolumeCheckResponder)> {
1779        if let VolumeRequest::Check { options, responder } = self {
1780            Some((options, responder))
1781        } else {
1782            None
1783        }
1784    }
1785
1786    #[allow(irrefutable_let_patterns)]
1787    pub fn into_set_limit(self) -> Option<(u64, VolumeSetLimitResponder)> {
1788        if let VolumeRequest::SetLimit { bytes, responder } = self {
1789            Some((bytes, responder))
1790        } else {
1791            None
1792        }
1793    }
1794
1795    #[allow(irrefutable_let_patterns)]
1796    pub fn into_get_limit(self) -> Option<(VolumeGetLimitResponder)> {
1797        if let VolumeRequest::GetLimit { responder } = self { Some((responder)) } else { None }
1798    }
1799
1800    #[allow(irrefutable_let_patterns)]
1801    pub fn into_get_info(self) -> Option<(VolumeGetInfoResponder)> {
1802        if let VolumeRequest::GetInfo { responder } = self { Some((responder)) } else { None }
1803    }
1804
1805    /// Name of the method defined in FIDL
1806    pub fn method_name(&self) -> &'static str {
1807        match *self {
1808            VolumeRequest::Mount { .. } => "mount",
1809            VolumeRequest::MountRemote { .. } => "mount_remote",
1810            VolumeRequest::Check { .. } => "check",
1811            VolumeRequest::SetLimit { .. } => "set_limit",
1812            VolumeRequest::GetLimit { .. } => "get_limit",
1813            VolumeRequest::GetInfo { .. } => "get_info",
1814        }
1815    }
1816}
1817
1818#[derive(Debug, Clone)]
1819pub struct VolumeControlHandle {
1820    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1821}
1822
1823impl VolumeControlHandle {
1824    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
1825        self.inner.shutdown_with_epitaph(status.into())
1826    }
1827}
1828
1829impl fidl::endpoints::ControlHandle for VolumeControlHandle {
1830    fn shutdown(&self) {
1831        self.inner.shutdown()
1832    }
1833
1834    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
1835        self.inner.shutdown_with_epitaph(status)
1836    }
1837
1838    fn is_closed(&self) -> bool {
1839        self.inner.channel().is_closed()
1840    }
1841    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1842        self.inner.channel().on_closed()
1843    }
1844
1845    #[cfg(target_os = "fuchsia")]
1846    fn signal_peer(
1847        &self,
1848        clear_mask: zx::Signals,
1849        set_mask: zx::Signals,
1850    ) -> Result<(), zx_status::Status> {
1851        use fidl::Peered;
1852        self.inner.channel().signal_peer(clear_mask, set_mask)
1853    }
1854}
1855
1856impl VolumeControlHandle {}
1857
1858#[must_use = "FIDL methods require a response to be sent"]
1859#[derive(Debug)]
1860pub struct VolumeMountResponder {
1861    control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1862    tx_id: u32,
1863}
1864
1865/// Set the the channel to be shutdown (see [`VolumeControlHandle::shutdown`])
1866/// if the responder is dropped without sending a response, so that the client
1867/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1868impl std::ops::Drop for VolumeMountResponder {
1869    fn drop(&mut self) {
1870        self.control_handle.shutdown();
1871        // Safety: drops once, never accessed again
1872        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1873    }
1874}
1875
1876impl fidl::endpoints::Responder for VolumeMountResponder {
1877    type ControlHandle = VolumeControlHandle;
1878
1879    fn control_handle(&self) -> &VolumeControlHandle {
1880        &self.control_handle
1881    }
1882
1883    fn drop_without_shutdown(mut self) {
1884        // Safety: drops once, never accessed again due to mem::forget
1885        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1886        // Prevent Drop from running (which would shut down the channel)
1887        std::mem::forget(self);
1888    }
1889}
1890
1891impl VolumeMountResponder {
1892    /// Sends a response to the FIDL transaction.
1893    ///
1894    /// Sets the channel to shutdown if an error occurs.
1895    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1896        let _result = self.send_raw(result);
1897        if _result.is_err() {
1898            self.control_handle.shutdown();
1899        }
1900        self.drop_without_shutdown();
1901        _result
1902    }
1903
1904    /// Similar to "send" but does not shutdown the channel if an error occurs.
1905    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1906        let _result = self.send_raw(result);
1907        self.drop_without_shutdown();
1908        _result
1909    }
1910
1911    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1912        self.control_handle
1913            .inner
1914            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1915                result,
1916                self.tx_id,
1917                0x3470ab56d455af0,
1918                fidl::encoding::DynamicFlags::empty(),
1919            )
1920    }
1921}
1922
1923#[must_use = "FIDL methods require a response to be sent"]
1924#[derive(Debug)]
1925pub struct VolumeMountRemoteResponder {
1926    control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
1927    tx_id: u32,
1928}
1929
1930/// Set the the channel to be shutdown (see [`VolumeControlHandle::shutdown`])
1931/// if the responder is dropped without sending a response, so that the client
1932/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1933impl std::ops::Drop for VolumeMountRemoteResponder {
1934    fn drop(&mut self) {
1935        self.control_handle.shutdown();
1936        // Safety: drops once, never accessed again
1937        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1938    }
1939}
1940
1941impl fidl::endpoints::Responder for VolumeMountRemoteResponder {
1942    type ControlHandle = VolumeControlHandle;
1943
1944    fn control_handle(&self) -> &VolumeControlHandle {
1945        &self.control_handle
1946    }
1947
1948    fn drop_without_shutdown(mut self) {
1949        // Safety: drops once, never accessed again due to mem::forget
1950        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1951        // Prevent Drop from running (which would shut down the channel)
1952        std::mem::forget(self);
1953    }
1954}
1955
1956impl VolumeMountRemoteResponder {
1957    /// Sends a response to the FIDL transaction.
1958    ///
1959    /// Sets the channel to shutdown if an error occurs.
1960    pub fn send(
1961        self,
1962        mut result: Result<
1963            (fidl_fuchsia_fxfs::VolumeInfo, fidl_fuchsia_fxfs::LayerSet, &[u8; 16]),
1964            i32,
1965        >,
1966    ) -> Result<(), fidl::Error> {
1967        let _result = self.send_raw(result);
1968        if _result.is_err() {
1969            self.control_handle.shutdown();
1970        }
1971        self.drop_without_shutdown();
1972        _result
1973    }
1974
1975    /// Similar to "send" but does not shutdown the channel if an error occurs.
1976    pub fn send_no_shutdown_on_err(
1977        self,
1978        mut result: Result<
1979            (fidl_fuchsia_fxfs::VolumeInfo, fidl_fuchsia_fxfs::LayerSet, &[u8; 16]),
1980            i32,
1981        >,
1982    ) -> Result<(), fidl::Error> {
1983        let _result = self.send_raw(result);
1984        self.drop_without_shutdown();
1985        _result
1986    }
1987
1988    fn send_raw(
1989        &self,
1990        mut result: Result<
1991            (fidl_fuchsia_fxfs::VolumeInfo, fidl_fuchsia_fxfs::LayerSet, &[u8; 16]),
1992            i32,
1993        >,
1994    ) -> Result<(), fidl::Error> {
1995        self.control_handle
1996            .inner
1997            .send::<fidl::encoding::ResultType<VolumeMountRemoteResponse, i32>>(
1998                result
1999                    .as_mut()
2000                    .map_err(|e| *e)
2001                    .map(|(info, initial_layers, guid)| (info, initial_layers, *guid)),
2002                self.tx_id,
2003                0x7ab50617c9b40e59,
2004                fidl::encoding::DynamicFlags::empty(),
2005            )
2006    }
2007}
2008
2009#[must_use = "FIDL methods require a response to be sent"]
2010#[derive(Debug)]
2011pub struct VolumeCheckResponder {
2012    control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2013    tx_id: u32,
2014}
2015
2016/// Set the the channel to be shutdown (see [`VolumeControlHandle::shutdown`])
2017/// if the responder is dropped without sending a response, so that the client
2018/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2019impl std::ops::Drop for VolumeCheckResponder {
2020    fn drop(&mut self) {
2021        self.control_handle.shutdown();
2022        // Safety: drops once, never accessed again
2023        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2024    }
2025}
2026
2027impl fidl::endpoints::Responder for VolumeCheckResponder {
2028    type ControlHandle = VolumeControlHandle;
2029
2030    fn control_handle(&self) -> &VolumeControlHandle {
2031        &self.control_handle
2032    }
2033
2034    fn drop_without_shutdown(mut self) {
2035        // Safety: drops once, never accessed again due to mem::forget
2036        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2037        // Prevent Drop from running (which would shut down the channel)
2038        std::mem::forget(self);
2039    }
2040}
2041
2042impl VolumeCheckResponder {
2043    /// Sends a response to the FIDL transaction.
2044    ///
2045    /// Sets the channel to shutdown if an error occurs.
2046    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2047        let _result = self.send_raw(result);
2048        if _result.is_err() {
2049            self.control_handle.shutdown();
2050        }
2051        self.drop_without_shutdown();
2052        _result
2053    }
2054
2055    /// Similar to "send" but does not shutdown the channel if an error occurs.
2056    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2057        let _result = self.send_raw(result);
2058        self.drop_without_shutdown();
2059        _result
2060    }
2061
2062    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2063        self.control_handle
2064            .inner
2065            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2066                result,
2067                self.tx_id,
2068                0x5b638348f5e0418c,
2069                fidl::encoding::DynamicFlags::empty(),
2070            )
2071    }
2072}
2073
2074#[must_use = "FIDL methods require a response to be sent"]
2075#[derive(Debug)]
2076pub struct VolumeSetLimitResponder {
2077    control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2078    tx_id: u32,
2079}
2080
2081/// Set the the channel to be shutdown (see [`VolumeControlHandle::shutdown`])
2082/// if the responder is dropped without sending a response, so that the client
2083/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2084impl std::ops::Drop for VolumeSetLimitResponder {
2085    fn drop(&mut self) {
2086        self.control_handle.shutdown();
2087        // Safety: drops once, never accessed again
2088        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2089    }
2090}
2091
2092impl fidl::endpoints::Responder for VolumeSetLimitResponder {
2093    type ControlHandle = VolumeControlHandle;
2094
2095    fn control_handle(&self) -> &VolumeControlHandle {
2096        &self.control_handle
2097    }
2098
2099    fn drop_without_shutdown(mut self) {
2100        // Safety: drops once, never accessed again due to mem::forget
2101        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2102        // Prevent Drop from running (which would shut down the channel)
2103        std::mem::forget(self);
2104    }
2105}
2106
2107impl VolumeSetLimitResponder {
2108    /// Sends a response to the FIDL transaction.
2109    ///
2110    /// Sets the channel to shutdown if an error occurs.
2111    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2112        let _result = self.send_raw(result);
2113        if _result.is_err() {
2114            self.control_handle.shutdown();
2115        }
2116        self.drop_without_shutdown();
2117        _result
2118    }
2119
2120    /// Similar to "send" but does not shutdown the channel if an error occurs.
2121    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2122        let _result = self.send_raw(result);
2123        self.drop_without_shutdown();
2124        _result
2125    }
2126
2127    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2128        self.control_handle
2129            .inner
2130            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2131                result,
2132                self.tx_id,
2133                0x19286d83eb3cd137,
2134                fidl::encoding::DynamicFlags::empty(),
2135            )
2136    }
2137}
2138
2139#[must_use = "FIDL methods require a response to be sent"]
2140#[derive(Debug)]
2141pub struct VolumeGetLimitResponder {
2142    control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2143    tx_id: u32,
2144}
2145
2146/// Set the the channel to be shutdown (see [`VolumeControlHandle::shutdown`])
2147/// if the responder is dropped without sending a response, so that the client
2148/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2149impl std::ops::Drop for VolumeGetLimitResponder {
2150    fn drop(&mut self) {
2151        self.control_handle.shutdown();
2152        // Safety: drops once, never accessed again
2153        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2154    }
2155}
2156
2157impl fidl::endpoints::Responder for VolumeGetLimitResponder {
2158    type ControlHandle = VolumeControlHandle;
2159
2160    fn control_handle(&self) -> &VolumeControlHandle {
2161        &self.control_handle
2162    }
2163
2164    fn drop_without_shutdown(mut self) {
2165        // Safety: drops once, never accessed again due to mem::forget
2166        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2167        // Prevent Drop from running (which would shut down the channel)
2168        std::mem::forget(self);
2169    }
2170}
2171
2172impl VolumeGetLimitResponder {
2173    /// Sends a response to the FIDL transaction.
2174    ///
2175    /// Sets the channel to shutdown if an error occurs.
2176    pub fn send(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
2177        let _result = self.send_raw(result);
2178        if _result.is_err() {
2179            self.control_handle.shutdown();
2180        }
2181        self.drop_without_shutdown();
2182        _result
2183    }
2184
2185    /// Similar to "send" but does not shutdown the channel if an error occurs.
2186    pub fn send_no_shutdown_on_err(self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
2187        let _result = self.send_raw(result);
2188        self.drop_without_shutdown();
2189        _result
2190    }
2191
2192    fn send_raw(&self, mut result: Result<u64, i32>) -> Result<(), fidl::Error> {
2193        self.control_handle.inner.send::<fidl::encoding::ResultType<VolumeGetLimitResponse, i32>>(
2194            result.map(|bytes| (bytes,)),
2195            self.tx_id,
2196            0xb14e4950939f16,
2197            fidl::encoding::DynamicFlags::empty(),
2198        )
2199    }
2200}
2201
2202#[must_use = "FIDL methods require a response to be sent"]
2203#[derive(Debug)]
2204pub struct VolumeGetInfoResponder {
2205    control_handle: std::mem::ManuallyDrop<VolumeControlHandle>,
2206    tx_id: u32,
2207}
2208
2209/// Set the the channel to be shutdown (see [`VolumeControlHandle::shutdown`])
2210/// if the responder is dropped without sending a response, so that the client
2211/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2212impl std::ops::Drop for VolumeGetInfoResponder {
2213    fn drop(&mut self) {
2214        self.control_handle.shutdown();
2215        // Safety: drops once, never accessed again
2216        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2217    }
2218}
2219
2220impl fidl::endpoints::Responder for VolumeGetInfoResponder {
2221    type ControlHandle = VolumeControlHandle;
2222
2223    fn control_handle(&self) -> &VolumeControlHandle {
2224        &self.control_handle
2225    }
2226
2227    fn drop_without_shutdown(mut self) {
2228        // Safety: drops once, never accessed again due to mem::forget
2229        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2230        // Prevent Drop from running (which would shut down the channel)
2231        std::mem::forget(self);
2232    }
2233}
2234
2235impl VolumeGetInfoResponder {
2236    /// Sends a response to the FIDL transaction.
2237    ///
2238    /// Sets the channel to shutdown if an error occurs.
2239    pub fn send(self, mut result: Result<&VolumeInfo, i32>) -> Result<(), fidl::Error> {
2240        let _result = self.send_raw(result);
2241        if _result.is_err() {
2242            self.control_handle.shutdown();
2243        }
2244        self.drop_without_shutdown();
2245        _result
2246    }
2247
2248    /// Similar to "send" but does not shutdown the channel if an error occurs.
2249    pub fn send_no_shutdown_on_err(
2250        self,
2251        mut result: Result<&VolumeInfo, i32>,
2252    ) -> Result<(), fidl::Error> {
2253        let _result = self.send_raw(result);
2254        self.drop_without_shutdown();
2255        _result
2256    }
2257
2258    fn send_raw(&self, mut result: Result<&VolumeInfo, i32>) -> Result<(), fidl::Error> {
2259        self.control_handle.inner.send::<fidl::encoding::ResultType<VolumeInfo, i32>>(
2260            result,
2261            self.tx_id,
2262            0x481018250e109f53,
2263            fidl::encoding::DynamicFlags::empty(),
2264        )
2265    }
2266}
2267
2268#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2269pub struct VolumesMarker;
2270
2271impl fidl::endpoints::ProtocolMarker for VolumesMarker {
2272    type Proxy = VolumesProxy;
2273    type RequestStream = VolumesRequestStream;
2274    #[cfg(target_os = "fuchsia")]
2275    type SynchronousProxy = VolumesSynchronousProxy;
2276
2277    const DEBUG_NAME: &'static str = "fuchsia.fs.startup.Volumes";
2278}
2279impl fidl::endpoints::DiscoverableProtocolMarker for VolumesMarker {}
2280pub type VolumesCreateResult = Result<(), i32>;
2281pub type VolumesRemoveResult = Result<(), i32>;
2282pub type VolumesGetInfoResult =
2283    Result<Option<Box<fidl_fuchsia_storage_block::VolumeManagerInfo>>, i32>;
2284
2285pub trait VolumesProxyInterface: Send + Sync {
2286    type CreateResponseFut: std::future::Future<Output = Result<VolumesCreateResult, fidl::Error>>
2287        + Send;
2288    fn r#create(
2289        &self,
2290        name: &str,
2291        outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2292        create_options: CreateOptions,
2293        mount_options: MountOptions,
2294    ) -> Self::CreateResponseFut;
2295    type RemoveResponseFut: std::future::Future<Output = Result<VolumesRemoveResult, fidl::Error>>
2296        + Send;
2297    fn r#remove(&self, name: &str) -> Self::RemoveResponseFut;
2298    type GetInfoResponseFut: std::future::Future<Output = Result<VolumesGetInfoResult, fidl::Error>>
2299        + Send;
2300    fn r#get_info(&self) -> Self::GetInfoResponseFut;
2301}
2302#[derive(Debug)]
2303#[cfg(target_os = "fuchsia")]
2304pub struct VolumesSynchronousProxy {
2305    client: fidl::client::sync::Client,
2306}
2307
2308#[cfg(target_os = "fuchsia")]
2309impl fidl::endpoints::SynchronousProxy for VolumesSynchronousProxy {
2310    type Proxy = VolumesProxy;
2311    type Protocol = VolumesMarker;
2312
2313    fn from_channel(inner: fidl::Channel) -> Self {
2314        Self::new(inner)
2315    }
2316
2317    fn into_channel(self) -> fidl::Channel {
2318        self.client.into_channel()
2319    }
2320
2321    fn as_channel(&self) -> &fidl::Channel {
2322        self.client.as_channel()
2323    }
2324}
2325
2326#[cfg(target_os = "fuchsia")]
2327impl VolumesSynchronousProxy {
2328    pub fn new(channel: fidl::Channel) -> Self {
2329        Self { client: fidl::client::sync::Client::new(channel) }
2330    }
2331
2332    pub fn into_channel(self) -> fidl::Channel {
2333        self.client.into_channel()
2334    }
2335
2336    /// Waits until an event arrives and returns it. It is safe for other
2337    /// threads to make concurrent requests while waiting for an event.
2338    pub fn wait_for_event(
2339        &self,
2340        deadline: zx::MonotonicInstant,
2341    ) -> Result<VolumesEvent, fidl::Error> {
2342        VolumesEvent::decode(self.client.wait_for_event::<VolumesMarker>(deadline)?)
2343    }
2344
2345    /// Creates and mounts a new volume identified by `name`. `mount_options` affects how the
2346    /// resulting volume is mounted. For encrypted volumes, `mount_options.crypt` is also used when
2347    /// creating the volume. `outgoing_directory` will be connected to the root directory of the
2348    /// volume.
2349    pub fn r#create(
2350        &self,
2351        mut name: &str,
2352        mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2353        mut create_options: CreateOptions,
2354        mut mount_options: MountOptions,
2355        ___deadline: zx::MonotonicInstant,
2356    ) -> Result<VolumesCreateResult, fidl::Error> {
2357        let _response = self.client.send_query::<
2358            VolumesCreateRequest,
2359            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2360            VolumesMarker,
2361        >(
2362            (name, outgoing_directory, &mut create_options, &mut mount_options,),
2363            0x11a55097834b38e8,
2364            fidl::encoding::DynamicFlags::empty(),
2365            ___deadline,
2366        )?;
2367        Ok(_response.map(|x| x))
2368    }
2369
2370    /// Permanently deletes a volume identified by `name`.  If the volume is mounted, this call will
2371    /// fail.
2372    pub fn r#remove(
2373        &self,
2374        mut name: &str,
2375        ___deadline: zx::MonotonicInstant,
2376    ) -> Result<VolumesRemoveResult, fidl::Error> {
2377        let _response = self.client.send_query::<
2378            VolumesRemoveRequest,
2379            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2380            VolumesMarker,
2381        >(
2382            (name,),
2383            0x70983b9344dc2292,
2384            fidl::encoding::DynamicFlags::empty(),
2385            ___deadline,
2386        )?;
2387        Ok(_response.map(|x| x))
2388    }
2389
2390    /// Get general info about the volume manager.
2391    pub fn r#get_info(
2392        &self,
2393        ___deadline: zx::MonotonicInstant,
2394    ) -> Result<VolumesGetInfoResult, fidl::Error> {
2395        let _response = self.client.send_query::<
2396            fidl::encoding::EmptyPayload,
2397            fidl::encoding::ResultType<VolumesGetInfoResponse, i32>,
2398            VolumesMarker,
2399        >(
2400            (),
2401            0x50d2962df9a0746e,
2402            fidl::encoding::DynamicFlags::empty(),
2403            ___deadline,
2404        )?;
2405        Ok(_response.map(|x| x.info))
2406    }
2407}
2408
2409#[cfg(target_os = "fuchsia")]
2410impl From<VolumesSynchronousProxy> for zx::NullableHandle {
2411    fn from(value: VolumesSynchronousProxy) -> Self {
2412        value.into_channel().into()
2413    }
2414}
2415
2416#[cfg(target_os = "fuchsia")]
2417impl From<fidl::Channel> for VolumesSynchronousProxy {
2418    fn from(value: fidl::Channel) -> Self {
2419        Self::new(value)
2420    }
2421}
2422
2423#[cfg(target_os = "fuchsia")]
2424impl fidl::endpoints::FromClient for VolumesSynchronousProxy {
2425    type Protocol = VolumesMarker;
2426
2427    fn from_client(value: fidl::endpoints::ClientEnd<VolumesMarker>) -> Self {
2428        Self::new(value.into_channel())
2429    }
2430}
2431
2432#[derive(Debug, Clone)]
2433pub struct VolumesProxy {
2434    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2435}
2436
2437impl fidl::endpoints::Proxy for VolumesProxy {
2438    type Protocol = VolumesMarker;
2439
2440    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2441        Self::new(inner)
2442    }
2443
2444    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2445        self.client.into_channel().map_err(|client| Self { client })
2446    }
2447
2448    fn as_channel(&self) -> &::fidl::AsyncChannel {
2449        self.client.as_channel()
2450    }
2451}
2452
2453impl VolumesProxy {
2454    /// Create a new Proxy for fuchsia.fs.startup/Volumes.
2455    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2456        let protocol_name = <VolumesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2457        Self { client: fidl::client::Client::new(channel, protocol_name) }
2458    }
2459
2460    /// Get a Stream of events from the remote end of the protocol.
2461    ///
2462    /// # Panics
2463    ///
2464    /// Panics if the event stream was already taken.
2465    pub fn take_event_stream(&self) -> VolumesEventStream {
2466        VolumesEventStream { event_receiver: self.client.take_event_receiver() }
2467    }
2468
2469    /// Creates and mounts a new volume identified by `name`. `mount_options` affects how the
2470    /// resulting volume is mounted. For encrypted volumes, `mount_options.crypt` is also used when
2471    /// creating the volume. `outgoing_directory` will be connected to the root directory of the
2472    /// volume.
2473    pub fn r#create(
2474        &self,
2475        mut name: &str,
2476        mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2477        mut create_options: CreateOptions,
2478        mut mount_options: MountOptions,
2479    ) -> fidl::client::QueryResponseFut<
2480        VolumesCreateResult,
2481        fidl::encoding::DefaultFuchsiaResourceDialect,
2482    > {
2483        VolumesProxyInterface::r#create(
2484            self,
2485            name,
2486            outgoing_directory,
2487            create_options,
2488            mount_options,
2489        )
2490    }
2491
2492    /// Permanently deletes a volume identified by `name`.  If the volume is mounted, this call will
2493    /// fail.
2494    pub fn r#remove(
2495        &self,
2496        mut name: &str,
2497    ) -> fidl::client::QueryResponseFut<
2498        VolumesRemoveResult,
2499        fidl::encoding::DefaultFuchsiaResourceDialect,
2500    > {
2501        VolumesProxyInterface::r#remove(self, name)
2502    }
2503
2504    /// Get general info about the volume manager.
2505    pub fn r#get_info(
2506        &self,
2507    ) -> fidl::client::QueryResponseFut<
2508        VolumesGetInfoResult,
2509        fidl::encoding::DefaultFuchsiaResourceDialect,
2510    > {
2511        VolumesProxyInterface::r#get_info(self)
2512    }
2513}
2514
2515impl VolumesProxyInterface for VolumesProxy {
2516    type CreateResponseFut = fidl::client::QueryResponseFut<
2517        VolumesCreateResult,
2518        fidl::encoding::DefaultFuchsiaResourceDialect,
2519    >;
2520    fn r#create(
2521        &self,
2522        mut name: &str,
2523        mut outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2524        mut create_options: CreateOptions,
2525        mut mount_options: MountOptions,
2526    ) -> Self::CreateResponseFut {
2527        fn _decode(
2528            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2529        ) -> Result<VolumesCreateResult, fidl::Error> {
2530            let _response = fidl::client::decode_transaction_body::<
2531                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2532                fidl::encoding::DefaultFuchsiaResourceDialect,
2533                0x11a55097834b38e8,
2534            >(_buf?)?;
2535            Ok(_response.map(|x| x))
2536        }
2537        self.client.send_query_and_decode::<VolumesCreateRequest, VolumesCreateResult>(
2538            (name, outgoing_directory, &mut create_options, &mut mount_options),
2539            0x11a55097834b38e8,
2540            fidl::encoding::DynamicFlags::empty(),
2541            _decode,
2542        )
2543    }
2544
2545    type RemoveResponseFut = fidl::client::QueryResponseFut<
2546        VolumesRemoveResult,
2547        fidl::encoding::DefaultFuchsiaResourceDialect,
2548    >;
2549    fn r#remove(&self, mut name: &str) -> Self::RemoveResponseFut {
2550        fn _decode(
2551            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2552        ) -> Result<VolumesRemoveResult, fidl::Error> {
2553            let _response = fidl::client::decode_transaction_body::<
2554                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2555                fidl::encoding::DefaultFuchsiaResourceDialect,
2556                0x70983b9344dc2292,
2557            >(_buf?)?;
2558            Ok(_response.map(|x| x))
2559        }
2560        self.client.send_query_and_decode::<VolumesRemoveRequest, VolumesRemoveResult>(
2561            (name,),
2562            0x70983b9344dc2292,
2563            fidl::encoding::DynamicFlags::empty(),
2564            _decode,
2565        )
2566    }
2567
2568    type GetInfoResponseFut = fidl::client::QueryResponseFut<
2569        VolumesGetInfoResult,
2570        fidl::encoding::DefaultFuchsiaResourceDialect,
2571    >;
2572    fn r#get_info(&self) -> Self::GetInfoResponseFut {
2573        fn _decode(
2574            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2575        ) -> Result<VolumesGetInfoResult, fidl::Error> {
2576            let _response = fidl::client::decode_transaction_body::<
2577                fidl::encoding::ResultType<VolumesGetInfoResponse, i32>,
2578                fidl::encoding::DefaultFuchsiaResourceDialect,
2579                0x50d2962df9a0746e,
2580            >(_buf?)?;
2581            Ok(_response.map(|x| x.info))
2582        }
2583        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, VolumesGetInfoResult>(
2584            (),
2585            0x50d2962df9a0746e,
2586            fidl::encoding::DynamicFlags::empty(),
2587            _decode,
2588        )
2589    }
2590}
2591
2592pub struct VolumesEventStream {
2593    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2594}
2595
2596impl std::marker::Unpin for VolumesEventStream {}
2597
2598impl futures::stream::FusedStream for VolumesEventStream {
2599    fn is_terminated(&self) -> bool {
2600        self.event_receiver.is_terminated()
2601    }
2602}
2603
2604impl futures::Stream for VolumesEventStream {
2605    type Item = Result<VolumesEvent, fidl::Error>;
2606
2607    fn poll_next(
2608        mut self: std::pin::Pin<&mut Self>,
2609        cx: &mut std::task::Context<'_>,
2610    ) -> std::task::Poll<Option<Self::Item>> {
2611        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2612            &mut self.event_receiver,
2613            cx
2614        )?) {
2615            Some(buf) => std::task::Poll::Ready(Some(VolumesEvent::decode(buf))),
2616            None => std::task::Poll::Ready(None),
2617        }
2618    }
2619}
2620
2621#[derive(Debug)]
2622pub enum VolumesEvent {}
2623
2624impl VolumesEvent {
2625    /// Decodes a message buffer as a [`VolumesEvent`].
2626    fn decode(
2627        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2628    ) -> Result<VolumesEvent, fidl::Error> {
2629        let (bytes, _handles) = buf.split_mut();
2630        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2631        debug_assert_eq!(tx_header.tx_id, 0);
2632        match tx_header.ordinal {
2633            _ => Err(fidl::Error::UnknownOrdinal {
2634                ordinal: tx_header.ordinal,
2635                protocol_name: <VolumesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2636            }),
2637        }
2638    }
2639}
2640
2641/// A Stream of incoming requests for fuchsia.fs.startup/Volumes.
2642pub struct VolumesRequestStream {
2643    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2644    is_terminated: bool,
2645}
2646
2647impl std::marker::Unpin for VolumesRequestStream {}
2648
2649impl futures::stream::FusedStream for VolumesRequestStream {
2650    fn is_terminated(&self) -> bool {
2651        self.is_terminated
2652    }
2653}
2654
2655impl fidl::endpoints::RequestStream for VolumesRequestStream {
2656    type Protocol = VolumesMarker;
2657    type ControlHandle = VolumesControlHandle;
2658
2659    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2660        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2661    }
2662
2663    fn control_handle(&self) -> Self::ControlHandle {
2664        VolumesControlHandle { inner: self.inner.clone() }
2665    }
2666
2667    fn into_inner(
2668        self,
2669    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2670    {
2671        (self.inner, self.is_terminated)
2672    }
2673
2674    fn from_inner(
2675        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2676        is_terminated: bool,
2677    ) -> Self {
2678        Self { inner, is_terminated }
2679    }
2680}
2681
2682impl futures::Stream for VolumesRequestStream {
2683    type Item = Result<VolumesRequest, fidl::Error>;
2684
2685    fn poll_next(
2686        mut self: std::pin::Pin<&mut Self>,
2687        cx: &mut std::task::Context<'_>,
2688    ) -> std::task::Poll<Option<Self::Item>> {
2689        let this = &mut *self;
2690        if this.inner.check_shutdown(cx) {
2691            this.is_terminated = true;
2692            return std::task::Poll::Ready(None);
2693        }
2694        if this.is_terminated {
2695            panic!("polled VolumesRequestStream after completion");
2696        }
2697        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2698            |bytes, handles| {
2699                match this.inner.channel().read_etc(cx, bytes, handles) {
2700                    std::task::Poll::Ready(Ok(())) => {}
2701                    std::task::Poll::Pending => return std::task::Poll::Pending,
2702                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2703                        this.is_terminated = true;
2704                        return std::task::Poll::Ready(None);
2705                    }
2706                    std::task::Poll::Ready(Err(e)) => {
2707                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2708                            e.into(),
2709                        ))));
2710                    }
2711                }
2712
2713                // A message has been received from the channel
2714                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2715
2716                std::task::Poll::Ready(Some(match header.ordinal {
2717                    0x11a55097834b38e8 => {
2718                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2719                        let mut req = fidl::new_empty!(
2720                            VolumesCreateRequest,
2721                            fidl::encoding::DefaultFuchsiaResourceDialect
2722                        );
2723                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumesCreateRequest>(&header, _body_bytes, handles, &mut req)?;
2724                        let control_handle = VolumesControlHandle { inner: this.inner.clone() };
2725                        Ok(VolumesRequest::Create {
2726                            name: req.name,
2727                            outgoing_directory: req.outgoing_directory,
2728                            create_options: req.create_options,
2729                            mount_options: req.mount_options,
2730
2731                            responder: VolumesCreateResponder {
2732                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2733                                tx_id: header.tx_id,
2734                            },
2735                        })
2736                    }
2737                    0x70983b9344dc2292 => {
2738                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2739                        let mut req = fidl::new_empty!(
2740                            VolumesRemoveRequest,
2741                            fidl::encoding::DefaultFuchsiaResourceDialect
2742                        );
2743                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumesRemoveRequest>(&header, _body_bytes, handles, &mut req)?;
2744                        let control_handle = VolumesControlHandle { inner: this.inner.clone() };
2745                        Ok(VolumesRequest::Remove {
2746                            name: req.name,
2747
2748                            responder: VolumesRemoveResponder {
2749                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2750                                tx_id: header.tx_id,
2751                            },
2752                        })
2753                    }
2754                    0x50d2962df9a0746e => {
2755                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2756                        let mut req = fidl::new_empty!(
2757                            fidl::encoding::EmptyPayload,
2758                            fidl::encoding::DefaultFuchsiaResourceDialect
2759                        );
2760                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2761                        let control_handle = VolumesControlHandle { inner: this.inner.clone() };
2762                        Ok(VolumesRequest::GetInfo {
2763                            responder: VolumesGetInfoResponder {
2764                                control_handle: std::mem::ManuallyDrop::new(control_handle),
2765                                tx_id: header.tx_id,
2766                            },
2767                        })
2768                    }
2769                    _ => Err(fidl::Error::UnknownOrdinal {
2770                        ordinal: header.ordinal,
2771                        protocol_name:
2772                            <VolumesMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2773                    }),
2774                }))
2775            },
2776        )
2777    }
2778}
2779
2780/// fuchsia.fs.startup.Volumes is used for creating and deleting volumes, and getting some general
2781/// information about the manager.  Other operations (e.g. enumeration and access) are serviced by
2782/// the `volumes` directory offered by filesystems in their export root.  Volumes appear as files
2783/// within this directory, and these files should also speak the `fuchsia.fs.startup.Volume`
2784/// protocol.
2785///
2786/// `mount_options` affects how the resulting volume is mounted. For encrypted volumes, the crypt
2787/// setting in the `mount_options` is also used when creating the volume. `outgoing_directory` will
2788/// be connected to the root directory of the volume.
2789#[derive(Debug)]
2790pub enum VolumesRequest {
2791    /// Creates and mounts a new volume identified by `name`. `mount_options` affects how the
2792    /// resulting volume is mounted. For encrypted volumes, `mount_options.crypt` is also used when
2793    /// creating the volume. `outgoing_directory` will be connected to the root directory of the
2794    /// volume.
2795    Create {
2796        name: String,
2797        outgoing_directory: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2798        create_options: CreateOptions,
2799        mount_options: MountOptions,
2800        responder: VolumesCreateResponder,
2801    },
2802    /// Permanently deletes a volume identified by `name`.  If the volume is mounted, this call will
2803    /// fail.
2804    Remove { name: String, responder: VolumesRemoveResponder },
2805    /// Get general info about the volume manager.
2806    GetInfo { responder: VolumesGetInfoResponder },
2807}
2808
2809impl VolumesRequest {
2810    #[allow(irrefutable_let_patterns)]
2811    pub fn into_create(
2812        self,
2813    ) -> Option<(
2814        String,
2815        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
2816        CreateOptions,
2817        MountOptions,
2818        VolumesCreateResponder,
2819    )> {
2820        if let VolumesRequest::Create {
2821            name,
2822            outgoing_directory,
2823            create_options,
2824            mount_options,
2825            responder,
2826        } = self
2827        {
2828            Some((name, outgoing_directory, create_options, mount_options, responder))
2829        } else {
2830            None
2831        }
2832    }
2833
2834    #[allow(irrefutable_let_patterns)]
2835    pub fn into_remove(self) -> Option<(String, VolumesRemoveResponder)> {
2836        if let VolumesRequest::Remove { name, responder } = self {
2837            Some((name, responder))
2838        } else {
2839            None
2840        }
2841    }
2842
2843    #[allow(irrefutable_let_patterns)]
2844    pub fn into_get_info(self) -> Option<(VolumesGetInfoResponder)> {
2845        if let VolumesRequest::GetInfo { responder } = self { Some((responder)) } else { None }
2846    }
2847
2848    /// Name of the method defined in FIDL
2849    pub fn method_name(&self) -> &'static str {
2850        match *self {
2851            VolumesRequest::Create { .. } => "create",
2852            VolumesRequest::Remove { .. } => "remove",
2853            VolumesRequest::GetInfo { .. } => "get_info",
2854        }
2855    }
2856}
2857
2858#[derive(Debug, Clone)]
2859pub struct VolumesControlHandle {
2860    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2861}
2862
2863impl VolumesControlHandle {
2864    pub fn shutdown_with_epitaph(&self, status: impl Into<fidl::Epitaph>) {
2865        self.inner.shutdown_with_epitaph(status.into())
2866    }
2867}
2868
2869impl fidl::endpoints::ControlHandle for VolumesControlHandle {
2870    fn shutdown(&self) {
2871        self.inner.shutdown()
2872    }
2873
2874    fn shutdown_with_epitaph(&self, status: fidl::Epitaph) {
2875        self.inner.shutdown_with_epitaph(status)
2876    }
2877
2878    fn is_closed(&self) -> bool {
2879        self.inner.channel().is_closed()
2880    }
2881    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2882        self.inner.channel().on_closed()
2883    }
2884
2885    #[cfg(target_os = "fuchsia")]
2886    fn signal_peer(
2887        &self,
2888        clear_mask: zx::Signals,
2889        set_mask: zx::Signals,
2890    ) -> Result<(), zx_status::Status> {
2891        use fidl::Peered;
2892        self.inner.channel().signal_peer(clear_mask, set_mask)
2893    }
2894}
2895
2896impl VolumesControlHandle {}
2897
2898#[must_use = "FIDL methods require a response to be sent"]
2899#[derive(Debug)]
2900pub struct VolumesCreateResponder {
2901    control_handle: std::mem::ManuallyDrop<VolumesControlHandle>,
2902    tx_id: u32,
2903}
2904
2905/// Set the the channel to be shutdown (see [`VolumesControlHandle::shutdown`])
2906/// if the responder is dropped without sending a response, so that the client
2907/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2908impl std::ops::Drop for VolumesCreateResponder {
2909    fn drop(&mut self) {
2910        self.control_handle.shutdown();
2911        // Safety: drops once, never accessed again
2912        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2913    }
2914}
2915
2916impl fidl::endpoints::Responder for VolumesCreateResponder {
2917    type ControlHandle = VolumesControlHandle;
2918
2919    fn control_handle(&self) -> &VolumesControlHandle {
2920        &self.control_handle
2921    }
2922
2923    fn drop_without_shutdown(mut self) {
2924        // Safety: drops once, never accessed again due to mem::forget
2925        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2926        // Prevent Drop from running (which would shut down the channel)
2927        std::mem::forget(self);
2928    }
2929}
2930
2931impl VolumesCreateResponder {
2932    /// Sends a response to the FIDL transaction.
2933    ///
2934    /// Sets the channel to shutdown if an error occurs.
2935    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2936        let _result = self.send_raw(result);
2937        if _result.is_err() {
2938            self.control_handle.shutdown();
2939        }
2940        self.drop_without_shutdown();
2941        _result
2942    }
2943
2944    /// Similar to "send" but does not shutdown the channel if an error occurs.
2945    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2946        let _result = self.send_raw(result);
2947        self.drop_without_shutdown();
2948        _result
2949    }
2950
2951    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
2952        self.control_handle
2953            .inner
2954            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
2955                result,
2956                self.tx_id,
2957                0x11a55097834b38e8,
2958                fidl::encoding::DynamicFlags::empty(),
2959            )
2960    }
2961}
2962
2963#[must_use = "FIDL methods require a response to be sent"]
2964#[derive(Debug)]
2965pub struct VolumesRemoveResponder {
2966    control_handle: std::mem::ManuallyDrop<VolumesControlHandle>,
2967    tx_id: u32,
2968}
2969
2970/// Set the the channel to be shutdown (see [`VolumesControlHandle::shutdown`])
2971/// if the responder is dropped without sending a response, so that the client
2972/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
2973impl std::ops::Drop for VolumesRemoveResponder {
2974    fn drop(&mut self) {
2975        self.control_handle.shutdown();
2976        // Safety: drops once, never accessed again
2977        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2978    }
2979}
2980
2981impl fidl::endpoints::Responder for VolumesRemoveResponder {
2982    type ControlHandle = VolumesControlHandle;
2983
2984    fn control_handle(&self) -> &VolumesControlHandle {
2985        &self.control_handle
2986    }
2987
2988    fn drop_without_shutdown(mut self) {
2989        // Safety: drops once, never accessed again due to mem::forget
2990        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2991        // Prevent Drop from running (which would shut down the channel)
2992        std::mem::forget(self);
2993    }
2994}
2995
2996impl VolumesRemoveResponder {
2997    /// Sends a response to the FIDL transaction.
2998    ///
2999    /// Sets the channel to shutdown if an error occurs.
3000    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3001        let _result = self.send_raw(result);
3002        if _result.is_err() {
3003            self.control_handle.shutdown();
3004        }
3005        self.drop_without_shutdown();
3006        _result
3007    }
3008
3009    /// Similar to "send" but does not shutdown the channel if an error occurs.
3010    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3011        let _result = self.send_raw(result);
3012        self.drop_without_shutdown();
3013        _result
3014    }
3015
3016    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
3017        self.control_handle
3018            .inner
3019            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
3020                result,
3021                self.tx_id,
3022                0x70983b9344dc2292,
3023                fidl::encoding::DynamicFlags::empty(),
3024            )
3025    }
3026}
3027
3028#[must_use = "FIDL methods require a response to be sent"]
3029#[derive(Debug)]
3030pub struct VolumesGetInfoResponder {
3031    control_handle: std::mem::ManuallyDrop<VolumesControlHandle>,
3032    tx_id: u32,
3033}
3034
3035/// Set the the channel to be shutdown (see [`VolumesControlHandle::shutdown`])
3036/// if the responder is dropped without sending a response, so that the client
3037/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
3038impl std::ops::Drop for VolumesGetInfoResponder {
3039    fn drop(&mut self) {
3040        self.control_handle.shutdown();
3041        // Safety: drops once, never accessed again
3042        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3043    }
3044}
3045
3046impl fidl::endpoints::Responder for VolumesGetInfoResponder {
3047    type ControlHandle = VolumesControlHandle;
3048
3049    fn control_handle(&self) -> &VolumesControlHandle {
3050        &self.control_handle
3051    }
3052
3053    fn drop_without_shutdown(mut self) {
3054        // Safety: drops once, never accessed again due to mem::forget
3055        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3056        // Prevent Drop from running (which would shut down the channel)
3057        std::mem::forget(self);
3058    }
3059}
3060
3061impl VolumesGetInfoResponder {
3062    /// Sends a response to the FIDL transaction.
3063    ///
3064    /// Sets the channel to shutdown if an error occurs.
3065    pub fn send(
3066        self,
3067        mut result: Result<Option<&fidl_fuchsia_storage_block::VolumeManagerInfo>, i32>,
3068    ) -> Result<(), fidl::Error> {
3069        let _result = self.send_raw(result);
3070        if _result.is_err() {
3071            self.control_handle.shutdown();
3072        }
3073        self.drop_without_shutdown();
3074        _result
3075    }
3076
3077    /// Similar to "send" but does not shutdown the channel if an error occurs.
3078    pub fn send_no_shutdown_on_err(
3079        self,
3080        mut result: Result<Option<&fidl_fuchsia_storage_block::VolumeManagerInfo>, i32>,
3081    ) -> Result<(), fidl::Error> {
3082        let _result = self.send_raw(result);
3083        self.drop_without_shutdown();
3084        _result
3085    }
3086
3087    fn send_raw(
3088        &self,
3089        mut result: Result<Option<&fidl_fuchsia_storage_block::VolumeManagerInfo>, i32>,
3090    ) -> Result<(), fidl::Error> {
3091        self.control_handle.inner.send::<fidl::encoding::ResultType<VolumesGetInfoResponse, i32>>(
3092            result.map(|info| (info,)),
3093            self.tx_id,
3094            0x50d2962df9a0746e,
3095            fidl::encoding::DynamicFlags::empty(),
3096        )
3097    }
3098}
3099
3100mod internal {
3101    use super::*;
3102
3103    impl fidl::encoding::ResourceTypeMarker for StartupCheckRequest {
3104        type Borrowed<'a> = &'a mut Self;
3105        fn take_or_borrow<'a>(
3106            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3107        ) -> Self::Borrowed<'a> {
3108            value
3109        }
3110    }
3111
3112    unsafe impl fidl::encoding::TypeMarker for StartupCheckRequest {
3113        type Owned = Self;
3114
3115        #[inline(always)]
3116        fn inline_align(_context: fidl::encoding::Context) -> usize {
3117            8
3118        }
3119
3120        #[inline(always)]
3121        fn inline_size(_context: fidl::encoding::Context) -> usize {
3122            24
3123        }
3124    }
3125
3126    unsafe impl
3127        fidl::encoding::Encode<StartupCheckRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3128        for &mut StartupCheckRequest
3129    {
3130        #[inline]
3131        unsafe fn encode(
3132            self,
3133            encoder: &mut fidl::encoding::Encoder<
3134                '_,
3135                fidl::encoding::DefaultFuchsiaResourceDialect,
3136            >,
3137            offset: usize,
3138            _depth: fidl::encoding::Depth,
3139        ) -> fidl::Result<()> {
3140            encoder.debug_check_bounds::<StartupCheckRequest>(offset);
3141            // Delegate to tuple encoding.
3142            fidl::encoding::Encode::<
3143                StartupCheckRequest,
3144                fidl::encoding::DefaultFuchsiaResourceDialect,
3145            >::encode(
3146                (
3147                    <fidl::encoding::Endpoint<
3148                        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3149                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3150                        &mut self.device
3151                    ),
3152                    <CheckOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3153                        &mut self.options,
3154                    ),
3155                ),
3156                encoder,
3157                offset,
3158                _depth,
3159            )
3160        }
3161    }
3162    unsafe impl<
3163        T0: fidl::encoding::Encode<
3164                fidl::encoding::Endpoint<
3165                    fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3166                >,
3167                fidl::encoding::DefaultFuchsiaResourceDialect,
3168            >,
3169        T1: fidl::encoding::Encode<CheckOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3170    > fidl::encoding::Encode<StartupCheckRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3171        for (T0, T1)
3172    {
3173        #[inline]
3174        unsafe fn encode(
3175            self,
3176            encoder: &mut fidl::encoding::Encoder<
3177                '_,
3178                fidl::encoding::DefaultFuchsiaResourceDialect,
3179            >,
3180            offset: usize,
3181            depth: fidl::encoding::Depth,
3182        ) -> fidl::Result<()> {
3183            encoder.debug_check_bounds::<StartupCheckRequest>(offset);
3184            // Zero out padding regions. There's no need to apply masks
3185            // because the unmasked parts will be overwritten by fields.
3186            unsafe {
3187                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3188                (ptr as *mut u64).write_unaligned(0);
3189            }
3190            // Write the fields.
3191            self.0.encode(encoder, offset + 0, depth)?;
3192            self.1.encode(encoder, offset + 8, depth)?;
3193            Ok(())
3194        }
3195    }
3196
3197    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3198        for StartupCheckRequest
3199    {
3200        #[inline(always)]
3201        fn new_empty() -> Self {
3202            Self {
3203                device: fidl::new_empty!(
3204                    fidl::encoding::Endpoint<
3205                        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3206                    >,
3207                    fidl::encoding::DefaultFuchsiaResourceDialect
3208                ),
3209                options: fidl::new_empty!(
3210                    CheckOptions,
3211                    fidl::encoding::DefaultFuchsiaResourceDialect
3212                ),
3213            }
3214        }
3215
3216        #[inline]
3217        unsafe fn decode(
3218            &mut self,
3219            decoder: &mut fidl::encoding::Decoder<
3220                '_,
3221                fidl::encoding::DefaultFuchsiaResourceDialect,
3222            >,
3223            offset: usize,
3224            _depth: fidl::encoding::Depth,
3225        ) -> fidl::Result<()> {
3226            decoder.debug_check_bounds::<Self>(offset);
3227            // Verify that padding bytes are zero.
3228            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3229            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3230            let mask = 0xffffffff00000000u64;
3231            let maskedval = padval & mask;
3232            if maskedval != 0 {
3233                return Err(fidl::Error::NonZeroPadding {
3234                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3235                });
3236            }
3237            fidl::decode!(
3238                fidl::encoding::Endpoint<
3239                    fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3240                >,
3241                fidl::encoding::DefaultFuchsiaResourceDialect,
3242                &mut self.device,
3243                decoder,
3244                offset + 0,
3245                _depth
3246            )?;
3247            fidl::decode!(
3248                CheckOptions,
3249                fidl::encoding::DefaultFuchsiaResourceDialect,
3250                &mut self.options,
3251                decoder,
3252                offset + 8,
3253                _depth
3254            )?;
3255            Ok(())
3256        }
3257    }
3258
3259    impl fidl::encoding::ResourceTypeMarker for StartupFormatRequest {
3260        type Borrowed<'a> = &'a mut Self;
3261        fn take_or_borrow<'a>(
3262            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3263        ) -> Self::Borrowed<'a> {
3264            value
3265        }
3266    }
3267
3268    unsafe impl fidl::encoding::TypeMarker for StartupFormatRequest {
3269        type Owned = Self;
3270
3271        #[inline(always)]
3272        fn inline_align(_context: fidl::encoding::Context) -> usize {
3273            8
3274        }
3275
3276        #[inline(always)]
3277        fn inline_size(_context: fidl::encoding::Context) -> usize {
3278            24
3279        }
3280    }
3281
3282    unsafe impl
3283        fidl::encoding::Encode<StartupFormatRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3284        for &mut StartupFormatRequest
3285    {
3286        #[inline]
3287        unsafe fn encode(
3288            self,
3289            encoder: &mut fidl::encoding::Encoder<
3290                '_,
3291                fidl::encoding::DefaultFuchsiaResourceDialect,
3292            >,
3293            offset: usize,
3294            _depth: fidl::encoding::Depth,
3295        ) -> fidl::Result<()> {
3296            encoder.debug_check_bounds::<StartupFormatRequest>(offset);
3297            // Delegate to tuple encoding.
3298            fidl::encoding::Encode::<
3299                StartupFormatRequest,
3300                fidl::encoding::DefaultFuchsiaResourceDialect,
3301            >::encode(
3302                (
3303                    <fidl::encoding::Endpoint<
3304                        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3305                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3306                        &mut self.device
3307                    ),
3308                    <FormatOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
3309                ),
3310                encoder,
3311                offset,
3312                _depth,
3313            )
3314        }
3315    }
3316    unsafe impl<
3317        T0: fidl::encoding::Encode<
3318                fidl::encoding::Endpoint<
3319                    fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3320                >,
3321                fidl::encoding::DefaultFuchsiaResourceDialect,
3322            >,
3323        T1: fidl::encoding::Encode<FormatOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3324    >
3325        fidl::encoding::Encode<StartupFormatRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3326        for (T0, T1)
3327    {
3328        #[inline]
3329        unsafe fn encode(
3330            self,
3331            encoder: &mut fidl::encoding::Encoder<
3332                '_,
3333                fidl::encoding::DefaultFuchsiaResourceDialect,
3334            >,
3335            offset: usize,
3336            depth: fidl::encoding::Depth,
3337        ) -> fidl::Result<()> {
3338            encoder.debug_check_bounds::<StartupFormatRequest>(offset);
3339            // Zero out padding regions. There's no need to apply masks
3340            // because the unmasked parts will be overwritten by fields.
3341            unsafe {
3342                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3343                (ptr as *mut u64).write_unaligned(0);
3344            }
3345            // Write the fields.
3346            self.0.encode(encoder, offset + 0, depth)?;
3347            self.1.encode(encoder, offset + 8, depth)?;
3348            Ok(())
3349        }
3350    }
3351
3352    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3353        for StartupFormatRequest
3354    {
3355        #[inline(always)]
3356        fn new_empty() -> Self {
3357            Self {
3358                device: fidl::new_empty!(
3359                    fidl::encoding::Endpoint<
3360                        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3361                    >,
3362                    fidl::encoding::DefaultFuchsiaResourceDialect
3363                ),
3364                options: fidl::new_empty!(
3365                    FormatOptions,
3366                    fidl::encoding::DefaultFuchsiaResourceDialect
3367                ),
3368            }
3369        }
3370
3371        #[inline]
3372        unsafe fn decode(
3373            &mut self,
3374            decoder: &mut fidl::encoding::Decoder<
3375                '_,
3376                fidl::encoding::DefaultFuchsiaResourceDialect,
3377            >,
3378            offset: usize,
3379            _depth: fidl::encoding::Depth,
3380        ) -> fidl::Result<()> {
3381            decoder.debug_check_bounds::<Self>(offset);
3382            // Verify that padding bytes are zero.
3383            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3384            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3385            let mask = 0xffffffff00000000u64;
3386            let maskedval = padval & mask;
3387            if maskedval != 0 {
3388                return Err(fidl::Error::NonZeroPadding {
3389                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3390                });
3391            }
3392            fidl::decode!(
3393                fidl::encoding::Endpoint<
3394                    fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3395                >,
3396                fidl::encoding::DefaultFuchsiaResourceDialect,
3397                &mut self.device,
3398                decoder,
3399                offset + 0,
3400                _depth
3401            )?;
3402            fidl::decode!(
3403                FormatOptions,
3404                fidl::encoding::DefaultFuchsiaResourceDialect,
3405                &mut self.options,
3406                decoder,
3407                offset + 8,
3408                _depth
3409            )?;
3410            Ok(())
3411        }
3412    }
3413
3414    impl fidl::encoding::ResourceTypeMarker for StartupStartRequest {
3415        type Borrowed<'a> = &'a mut Self;
3416        fn take_or_borrow<'a>(
3417            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3418        ) -> Self::Borrowed<'a> {
3419            value
3420        }
3421    }
3422
3423    unsafe impl fidl::encoding::TypeMarker for StartupStartRequest {
3424        type Owned = Self;
3425
3426        #[inline(always)]
3427        fn inline_align(_context: fidl::encoding::Context) -> usize {
3428            8
3429        }
3430
3431        #[inline(always)]
3432        fn inline_size(_context: fidl::encoding::Context) -> usize {
3433            24
3434        }
3435    }
3436
3437    unsafe impl
3438        fidl::encoding::Encode<StartupStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3439        for &mut StartupStartRequest
3440    {
3441        #[inline]
3442        unsafe fn encode(
3443            self,
3444            encoder: &mut fidl::encoding::Encoder<
3445                '_,
3446                fidl::encoding::DefaultFuchsiaResourceDialect,
3447            >,
3448            offset: usize,
3449            _depth: fidl::encoding::Depth,
3450        ) -> fidl::Result<()> {
3451            encoder.debug_check_bounds::<StartupStartRequest>(offset);
3452            // Delegate to tuple encoding.
3453            fidl::encoding::Encode::<
3454                StartupStartRequest,
3455                fidl::encoding::DefaultFuchsiaResourceDialect,
3456            >::encode(
3457                (
3458                    <fidl::encoding::Endpoint<
3459                        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3460                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3461                        &mut self.device
3462                    ),
3463                    <StartOptions as fidl::encoding::ValueTypeMarker>::borrow(&self.options),
3464                ),
3465                encoder,
3466                offset,
3467                _depth,
3468            )
3469        }
3470    }
3471    unsafe impl<
3472        T0: fidl::encoding::Encode<
3473                fidl::encoding::Endpoint<
3474                    fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3475                >,
3476                fidl::encoding::DefaultFuchsiaResourceDialect,
3477            >,
3478        T1: fidl::encoding::Encode<StartOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3479    > fidl::encoding::Encode<StartupStartRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3480        for (T0, T1)
3481    {
3482        #[inline]
3483        unsafe fn encode(
3484            self,
3485            encoder: &mut fidl::encoding::Encoder<
3486                '_,
3487                fidl::encoding::DefaultFuchsiaResourceDialect,
3488            >,
3489            offset: usize,
3490            depth: fidl::encoding::Depth,
3491        ) -> fidl::Result<()> {
3492            encoder.debug_check_bounds::<StartupStartRequest>(offset);
3493            // Zero out padding regions. There's no need to apply masks
3494            // because the unmasked parts will be overwritten by fields.
3495            unsafe {
3496                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3497                (ptr as *mut u64).write_unaligned(0);
3498            }
3499            // Write the fields.
3500            self.0.encode(encoder, offset + 0, depth)?;
3501            self.1.encode(encoder, offset + 8, depth)?;
3502            Ok(())
3503        }
3504    }
3505
3506    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3507        for StartupStartRequest
3508    {
3509        #[inline(always)]
3510        fn new_empty() -> Self {
3511            Self {
3512                device: fidl::new_empty!(
3513                    fidl::encoding::Endpoint<
3514                        fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3515                    >,
3516                    fidl::encoding::DefaultFuchsiaResourceDialect
3517                ),
3518                options: fidl::new_empty!(
3519                    StartOptions,
3520                    fidl::encoding::DefaultFuchsiaResourceDialect
3521                ),
3522            }
3523        }
3524
3525        #[inline]
3526        unsafe fn decode(
3527            &mut self,
3528            decoder: &mut fidl::encoding::Decoder<
3529                '_,
3530                fidl::encoding::DefaultFuchsiaResourceDialect,
3531            >,
3532            offset: usize,
3533            _depth: fidl::encoding::Depth,
3534        ) -> fidl::Result<()> {
3535            decoder.debug_check_bounds::<Self>(offset);
3536            // Verify that padding bytes are zero.
3537            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3538            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3539            let mask = 0xffffffff00000000u64;
3540            let maskedval = padval & mask;
3541            if maskedval != 0 {
3542                return Err(fidl::Error::NonZeroPadding {
3543                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3544                });
3545            }
3546            fidl::decode!(
3547                fidl::encoding::Endpoint<
3548                    fidl::endpoints::ClientEnd<fidl_fuchsia_storage_block::BlockMarker>,
3549                >,
3550                fidl::encoding::DefaultFuchsiaResourceDialect,
3551                &mut self.device,
3552                decoder,
3553                offset + 0,
3554                _depth
3555            )?;
3556            fidl::decode!(
3557                StartOptions,
3558                fidl::encoding::DefaultFuchsiaResourceDialect,
3559                &mut self.options,
3560                decoder,
3561                offset + 8,
3562                _depth
3563            )?;
3564            Ok(())
3565        }
3566    }
3567
3568    impl fidl::encoding::ResourceTypeMarker for VolumeCheckRequest {
3569        type Borrowed<'a> = &'a mut Self;
3570        fn take_or_borrow<'a>(
3571            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3572        ) -> Self::Borrowed<'a> {
3573            value
3574        }
3575    }
3576
3577    unsafe impl fidl::encoding::TypeMarker for VolumeCheckRequest {
3578        type Owned = Self;
3579
3580        #[inline(always)]
3581        fn inline_align(_context: fidl::encoding::Context) -> usize {
3582            8
3583        }
3584
3585        #[inline(always)]
3586        fn inline_size(_context: fidl::encoding::Context) -> usize {
3587            16
3588        }
3589    }
3590
3591    unsafe impl
3592        fidl::encoding::Encode<VolumeCheckRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3593        for &mut VolumeCheckRequest
3594    {
3595        #[inline]
3596        unsafe fn encode(
3597            self,
3598            encoder: &mut fidl::encoding::Encoder<
3599                '_,
3600                fidl::encoding::DefaultFuchsiaResourceDialect,
3601            >,
3602            offset: usize,
3603            _depth: fidl::encoding::Depth,
3604        ) -> fidl::Result<()> {
3605            encoder.debug_check_bounds::<VolumeCheckRequest>(offset);
3606            // Delegate to tuple encoding.
3607            fidl::encoding::Encode::<
3608                VolumeCheckRequest,
3609                fidl::encoding::DefaultFuchsiaResourceDialect,
3610            >::encode(
3611                (<CheckOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3612                    &mut self.options,
3613                ),),
3614                encoder,
3615                offset,
3616                _depth,
3617            )
3618        }
3619    }
3620    unsafe impl<
3621        T0: fidl::encoding::Encode<CheckOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3622    > fidl::encoding::Encode<VolumeCheckRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3623        for (T0,)
3624    {
3625        #[inline]
3626        unsafe fn encode(
3627            self,
3628            encoder: &mut fidl::encoding::Encoder<
3629                '_,
3630                fidl::encoding::DefaultFuchsiaResourceDialect,
3631            >,
3632            offset: usize,
3633            depth: fidl::encoding::Depth,
3634        ) -> fidl::Result<()> {
3635            encoder.debug_check_bounds::<VolumeCheckRequest>(offset);
3636            // Zero out padding regions. There's no need to apply masks
3637            // because the unmasked parts will be overwritten by fields.
3638            // Write the fields.
3639            self.0.encode(encoder, offset + 0, depth)?;
3640            Ok(())
3641        }
3642    }
3643
3644    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3645        for VolumeCheckRequest
3646    {
3647        #[inline(always)]
3648        fn new_empty() -> Self {
3649            Self {
3650                options: fidl::new_empty!(
3651                    CheckOptions,
3652                    fidl::encoding::DefaultFuchsiaResourceDialect
3653                ),
3654            }
3655        }
3656
3657        #[inline]
3658        unsafe fn decode(
3659            &mut self,
3660            decoder: &mut fidl::encoding::Decoder<
3661                '_,
3662                fidl::encoding::DefaultFuchsiaResourceDialect,
3663            >,
3664            offset: usize,
3665            _depth: fidl::encoding::Depth,
3666        ) -> fidl::Result<()> {
3667            decoder.debug_check_bounds::<Self>(offset);
3668            // Verify that padding bytes are zero.
3669            fidl::decode!(
3670                CheckOptions,
3671                fidl::encoding::DefaultFuchsiaResourceDialect,
3672                &mut self.options,
3673                decoder,
3674                offset + 0,
3675                _depth
3676            )?;
3677            Ok(())
3678        }
3679    }
3680
3681    impl fidl::encoding::ResourceTypeMarker for VolumeMountRemoteRequest {
3682        type Borrowed<'a> = &'a mut Self;
3683        fn take_or_borrow<'a>(
3684            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3685        ) -> Self::Borrowed<'a> {
3686            value
3687        }
3688    }
3689
3690    unsafe impl fidl::encoding::TypeMarker for VolumeMountRemoteRequest {
3691        type Owned = Self;
3692
3693        #[inline(always)]
3694        fn inline_align(_context: fidl::encoding::Context) -> usize {
3695            8
3696        }
3697
3698        #[inline(always)]
3699        fn inline_size(_context: fidl::encoding::Context) -> usize {
3700            24
3701        }
3702    }
3703
3704    unsafe impl
3705        fidl::encoding::Encode<
3706            VolumeMountRemoteRequest,
3707            fidl::encoding::DefaultFuchsiaResourceDialect,
3708        > for &mut VolumeMountRemoteRequest
3709    {
3710        #[inline]
3711        unsafe fn encode(
3712            self,
3713            encoder: &mut fidl::encoding::Encoder<
3714                '_,
3715                fidl::encoding::DefaultFuchsiaResourceDialect,
3716            >,
3717            offset: usize,
3718            _depth: fidl::encoding::Depth,
3719        ) -> fidl::Result<()> {
3720            encoder.debug_check_bounds::<VolumeMountRemoteRequest>(offset);
3721            // Delegate to tuple encoding.
3722            fidl::encoding::Encode::<
3723                VolumeMountRemoteRequest,
3724                fidl::encoding::DefaultFuchsiaResourceDialect,
3725            >::encode(
3726                (
3727                    <MountOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3728                        &mut self.options,
3729                    ),
3730                    <fidl::encoding::Endpoint<
3731                        fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
3732                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3733                        &mut self.volume
3734                    ),
3735                ),
3736                encoder,
3737                offset,
3738                _depth,
3739            )
3740        }
3741    }
3742    unsafe impl<
3743        T0: fidl::encoding::Encode<MountOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3744        T1: fidl::encoding::Encode<
3745                fidl::encoding::Endpoint<
3746                    fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
3747                >,
3748                fidl::encoding::DefaultFuchsiaResourceDialect,
3749            >,
3750    >
3751        fidl::encoding::Encode<
3752            VolumeMountRemoteRequest,
3753            fidl::encoding::DefaultFuchsiaResourceDialect,
3754        > for (T0, T1)
3755    {
3756        #[inline]
3757        unsafe fn encode(
3758            self,
3759            encoder: &mut fidl::encoding::Encoder<
3760                '_,
3761                fidl::encoding::DefaultFuchsiaResourceDialect,
3762            >,
3763            offset: usize,
3764            depth: fidl::encoding::Depth,
3765        ) -> fidl::Result<()> {
3766            encoder.debug_check_bounds::<VolumeMountRemoteRequest>(offset);
3767            // Zero out padding regions. There's no need to apply masks
3768            // because the unmasked parts will be overwritten by fields.
3769            unsafe {
3770                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3771                (ptr as *mut u64).write_unaligned(0);
3772            }
3773            // Write the fields.
3774            self.0.encode(encoder, offset + 0, depth)?;
3775            self.1.encode(encoder, offset + 16, depth)?;
3776            Ok(())
3777        }
3778    }
3779
3780    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3781        for VolumeMountRemoteRequest
3782    {
3783        #[inline(always)]
3784        fn new_empty() -> Self {
3785            Self {
3786                options: fidl::new_empty!(
3787                    MountOptions,
3788                    fidl::encoding::DefaultFuchsiaResourceDialect
3789                ),
3790                volume: fidl::new_empty!(
3791                    fidl::encoding::Endpoint<
3792                        fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
3793                    >,
3794                    fidl::encoding::DefaultFuchsiaResourceDialect
3795                ),
3796            }
3797        }
3798
3799        #[inline]
3800        unsafe fn decode(
3801            &mut self,
3802            decoder: &mut fidl::encoding::Decoder<
3803                '_,
3804                fidl::encoding::DefaultFuchsiaResourceDialect,
3805            >,
3806            offset: usize,
3807            _depth: fidl::encoding::Depth,
3808        ) -> fidl::Result<()> {
3809            decoder.debug_check_bounds::<Self>(offset);
3810            // Verify that padding bytes are zero.
3811            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3812            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3813            let mask = 0xffffffff00000000u64;
3814            let maskedval = padval & mask;
3815            if maskedval != 0 {
3816                return Err(fidl::Error::NonZeroPadding {
3817                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3818                });
3819            }
3820            fidl::decode!(
3821                MountOptions,
3822                fidl::encoding::DefaultFuchsiaResourceDialect,
3823                &mut self.options,
3824                decoder,
3825                offset + 0,
3826                _depth
3827            )?;
3828            fidl::decode!(
3829                fidl::encoding::Endpoint<
3830                    fidl::endpoints::ServerEnd<fidl_fuchsia_fxfs::RemoteVolumeMarker>,
3831                >,
3832                fidl::encoding::DefaultFuchsiaResourceDialect,
3833                &mut self.volume,
3834                decoder,
3835                offset + 16,
3836                _depth
3837            )?;
3838            Ok(())
3839        }
3840    }
3841
3842    impl fidl::encoding::ResourceTypeMarker for VolumeMountRequest {
3843        type Borrowed<'a> = &'a mut Self;
3844        fn take_or_borrow<'a>(
3845            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3846        ) -> Self::Borrowed<'a> {
3847            value
3848        }
3849    }
3850
3851    unsafe impl fidl::encoding::TypeMarker for VolumeMountRequest {
3852        type Owned = Self;
3853
3854        #[inline(always)]
3855        fn inline_align(_context: fidl::encoding::Context) -> usize {
3856            8
3857        }
3858
3859        #[inline(always)]
3860        fn inline_size(_context: fidl::encoding::Context) -> usize {
3861            24
3862        }
3863    }
3864
3865    unsafe impl
3866        fidl::encoding::Encode<VolumeMountRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3867        for &mut VolumeMountRequest
3868    {
3869        #[inline]
3870        unsafe fn encode(
3871            self,
3872            encoder: &mut fidl::encoding::Encoder<
3873                '_,
3874                fidl::encoding::DefaultFuchsiaResourceDialect,
3875            >,
3876            offset: usize,
3877            _depth: fidl::encoding::Depth,
3878        ) -> fidl::Result<()> {
3879            encoder.debug_check_bounds::<VolumeMountRequest>(offset);
3880            // Delegate to tuple encoding.
3881            fidl::encoding::Encode::<
3882                VolumeMountRequest,
3883                fidl::encoding::DefaultFuchsiaResourceDialect,
3884            >::encode(
3885                (
3886                    <fidl::encoding::Endpoint<
3887                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3888                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3889                        &mut self.outgoing_directory,
3890                    ),
3891                    <MountOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
3892                        &mut self.options,
3893                    ),
3894                ),
3895                encoder,
3896                offset,
3897                _depth,
3898            )
3899        }
3900    }
3901    unsafe impl<
3902        T0: fidl::encoding::Encode<
3903                fidl::encoding::Endpoint<
3904                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3905                >,
3906                fidl::encoding::DefaultFuchsiaResourceDialect,
3907            >,
3908        T1: fidl::encoding::Encode<MountOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
3909    > fidl::encoding::Encode<VolumeMountRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
3910        for (T0, T1)
3911    {
3912        #[inline]
3913        unsafe fn encode(
3914            self,
3915            encoder: &mut fidl::encoding::Encoder<
3916                '_,
3917                fidl::encoding::DefaultFuchsiaResourceDialect,
3918            >,
3919            offset: usize,
3920            depth: fidl::encoding::Depth,
3921        ) -> fidl::Result<()> {
3922            encoder.debug_check_bounds::<VolumeMountRequest>(offset);
3923            // Zero out padding regions. There's no need to apply masks
3924            // because the unmasked parts will be overwritten by fields.
3925            unsafe {
3926                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3927                (ptr as *mut u64).write_unaligned(0);
3928            }
3929            // Write the fields.
3930            self.0.encode(encoder, offset + 0, depth)?;
3931            self.1.encode(encoder, offset + 8, depth)?;
3932            Ok(())
3933        }
3934    }
3935
3936    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3937        for VolumeMountRequest
3938    {
3939        #[inline(always)]
3940        fn new_empty() -> Self {
3941            Self {
3942                outgoing_directory: fidl::new_empty!(
3943                    fidl::encoding::Endpoint<
3944                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3945                    >,
3946                    fidl::encoding::DefaultFuchsiaResourceDialect
3947                ),
3948                options: fidl::new_empty!(
3949                    MountOptions,
3950                    fidl::encoding::DefaultFuchsiaResourceDialect
3951                ),
3952            }
3953        }
3954
3955        #[inline]
3956        unsafe fn decode(
3957            &mut self,
3958            decoder: &mut fidl::encoding::Decoder<
3959                '_,
3960                fidl::encoding::DefaultFuchsiaResourceDialect,
3961            >,
3962            offset: usize,
3963            _depth: fidl::encoding::Depth,
3964        ) -> fidl::Result<()> {
3965            decoder.debug_check_bounds::<Self>(offset);
3966            // Verify that padding bytes are zero.
3967            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3968            let padval = unsafe { (ptr as *const u64).read_unaligned() };
3969            let mask = 0xffffffff00000000u64;
3970            let maskedval = padval & mask;
3971            if maskedval != 0 {
3972                return Err(fidl::Error::NonZeroPadding {
3973                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3974                });
3975            }
3976            fidl::decode!(
3977                fidl::encoding::Endpoint<
3978                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
3979                >,
3980                fidl::encoding::DefaultFuchsiaResourceDialect,
3981                &mut self.outgoing_directory,
3982                decoder,
3983                offset + 0,
3984                _depth
3985            )?;
3986            fidl::decode!(
3987                MountOptions,
3988                fidl::encoding::DefaultFuchsiaResourceDialect,
3989                &mut self.options,
3990                decoder,
3991                offset + 8,
3992                _depth
3993            )?;
3994            Ok(())
3995        }
3996    }
3997
3998    impl fidl::encoding::ResourceTypeMarker for VolumeMountRemoteResponse {
3999        type Borrowed<'a> = &'a mut Self;
4000        fn take_or_borrow<'a>(
4001            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4002        ) -> Self::Borrowed<'a> {
4003            value
4004        }
4005    }
4006
4007    unsafe impl fidl::encoding::TypeMarker for VolumeMountRemoteResponse {
4008        type Owned = Self;
4009
4010        #[inline(always)]
4011        fn inline_align(_context: fidl::encoding::Context) -> usize {
4012            8
4013        }
4014
4015        #[inline(always)]
4016        fn inline_size(_context: fidl::encoding::Context) -> usize {
4017            56
4018        }
4019    }
4020
4021    unsafe impl
4022        fidl::encoding::Encode<
4023            VolumeMountRemoteResponse,
4024            fidl::encoding::DefaultFuchsiaResourceDialect,
4025        > for &mut VolumeMountRemoteResponse
4026    {
4027        #[inline]
4028        unsafe fn encode(
4029            self,
4030            encoder: &mut fidl::encoding::Encoder<
4031                '_,
4032                fidl::encoding::DefaultFuchsiaResourceDialect,
4033            >,
4034            offset: usize,
4035            _depth: fidl::encoding::Depth,
4036        ) -> fidl::Result<()> {
4037            encoder.debug_check_bounds::<VolumeMountRemoteResponse>(offset);
4038            // Delegate to tuple encoding.
4039            fidl::encoding::Encode::<VolumeMountRemoteResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4040                (
4041                    <fidl_fuchsia_fxfs::VolumeInfo as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.info),
4042                    <fidl_fuchsia_fxfs::LayerSet as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.initial_layers),
4043                    <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.guid),
4044                ),
4045                encoder, offset, _depth
4046            )
4047        }
4048    }
4049    unsafe impl<
4050        T0: fidl::encoding::Encode<
4051                fidl_fuchsia_fxfs::VolumeInfo,
4052                fidl::encoding::DefaultFuchsiaResourceDialect,
4053            >,
4054        T1: fidl::encoding::Encode<
4055                fidl_fuchsia_fxfs::LayerSet,
4056                fidl::encoding::DefaultFuchsiaResourceDialect,
4057            >,
4058        T2: fidl::encoding::Encode<
4059                fidl::encoding::Array<u8, 16>,
4060                fidl::encoding::DefaultFuchsiaResourceDialect,
4061            >,
4062    >
4063        fidl::encoding::Encode<
4064            VolumeMountRemoteResponse,
4065            fidl::encoding::DefaultFuchsiaResourceDialect,
4066        > for (T0, T1, T2)
4067    {
4068        #[inline]
4069        unsafe fn encode(
4070            self,
4071            encoder: &mut fidl::encoding::Encoder<
4072                '_,
4073                fidl::encoding::DefaultFuchsiaResourceDialect,
4074            >,
4075            offset: usize,
4076            depth: fidl::encoding::Depth,
4077        ) -> fidl::Result<()> {
4078            encoder.debug_check_bounds::<VolumeMountRemoteResponse>(offset);
4079            // Zero out padding regions. There's no need to apply masks
4080            // because the unmasked parts will be overwritten by fields.
4081            // Write the fields.
4082            self.0.encode(encoder, offset + 0, depth)?;
4083            self.1.encode(encoder, offset + 24, depth)?;
4084            self.2.encode(encoder, offset + 40, depth)?;
4085            Ok(())
4086        }
4087    }
4088
4089    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4090        for VolumeMountRemoteResponse
4091    {
4092        #[inline(always)]
4093        fn new_empty() -> Self {
4094            Self {
4095                info: fidl::new_empty!(
4096                    fidl_fuchsia_fxfs::VolumeInfo,
4097                    fidl::encoding::DefaultFuchsiaResourceDialect
4098                ),
4099                initial_layers: fidl::new_empty!(
4100                    fidl_fuchsia_fxfs::LayerSet,
4101                    fidl::encoding::DefaultFuchsiaResourceDialect
4102                ),
4103                guid: fidl::new_empty!(fidl::encoding::Array<u8, 16>, fidl::encoding::DefaultFuchsiaResourceDialect),
4104            }
4105        }
4106
4107        #[inline]
4108        unsafe fn decode(
4109            &mut self,
4110            decoder: &mut fidl::encoding::Decoder<
4111                '_,
4112                fidl::encoding::DefaultFuchsiaResourceDialect,
4113            >,
4114            offset: usize,
4115            _depth: fidl::encoding::Depth,
4116        ) -> fidl::Result<()> {
4117            decoder.debug_check_bounds::<Self>(offset);
4118            // Verify that padding bytes are zero.
4119            fidl::decode!(
4120                fidl_fuchsia_fxfs::VolumeInfo,
4121                fidl::encoding::DefaultFuchsiaResourceDialect,
4122                &mut self.info,
4123                decoder,
4124                offset + 0,
4125                _depth
4126            )?;
4127            fidl::decode!(
4128                fidl_fuchsia_fxfs::LayerSet,
4129                fidl::encoding::DefaultFuchsiaResourceDialect,
4130                &mut self.initial_layers,
4131                decoder,
4132                offset + 24,
4133                _depth
4134            )?;
4135            fidl::decode!(fidl::encoding::Array<u8, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.guid, decoder, offset + 40, _depth)?;
4136            Ok(())
4137        }
4138    }
4139
4140    impl fidl::encoding::ResourceTypeMarker for VolumesCreateRequest {
4141        type Borrowed<'a> = &'a mut Self;
4142        fn take_or_borrow<'a>(
4143            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4144        ) -> Self::Borrowed<'a> {
4145            value
4146        }
4147    }
4148
4149    unsafe impl fidl::encoding::TypeMarker for VolumesCreateRequest {
4150        type Owned = Self;
4151
4152        #[inline(always)]
4153        fn inline_align(_context: fidl::encoding::Context) -> usize {
4154            8
4155        }
4156
4157        #[inline(always)]
4158        fn inline_size(_context: fidl::encoding::Context) -> usize {
4159            56
4160        }
4161    }
4162
4163    unsafe impl
4164        fidl::encoding::Encode<VolumesCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4165        for &mut VolumesCreateRequest
4166    {
4167        #[inline]
4168        unsafe fn encode(
4169            self,
4170            encoder: &mut fidl::encoding::Encoder<
4171                '_,
4172                fidl::encoding::DefaultFuchsiaResourceDialect,
4173            >,
4174            offset: usize,
4175            _depth: fidl::encoding::Depth,
4176        ) -> fidl::Result<()> {
4177            encoder.debug_check_bounds::<VolumesCreateRequest>(offset);
4178            // Delegate to tuple encoding.
4179            fidl::encoding::Encode::<
4180                VolumesCreateRequest,
4181                fidl::encoding::DefaultFuchsiaResourceDialect,
4182            >::encode(
4183                (
4184                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
4185                        &self.name,
4186                    ),
4187                    <fidl::encoding::Endpoint<
4188                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4189                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4190                        &mut self.outgoing_directory,
4191                    ),
4192                    <CreateOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4193                        &mut self.create_options,
4194                    ),
4195                    <MountOptions as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4196                        &mut self.mount_options,
4197                    ),
4198                ),
4199                encoder,
4200                offset,
4201                _depth,
4202            )
4203        }
4204    }
4205    unsafe impl<
4206        T0: fidl::encoding::Encode<
4207                fidl::encoding::BoundedString<255>,
4208                fidl::encoding::DefaultFuchsiaResourceDialect,
4209            >,
4210        T1: fidl::encoding::Encode<
4211                fidl::encoding::Endpoint<
4212                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4213                >,
4214                fidl::encoding::DefaultFuchsiaResourceDialect,
4215            >,
4216        T2: fidl::encoding::Encode<CreateOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
4217        T3: fidl::encoding::Encode<MountOptions, fidl::encoding::DefaultFuchsiaResourceDialect>,
4218    >
4219        fidl::encoding::Encode<VolumesCreateRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
4220        for (T0, T1, T2, T3)
4221    {
4222        #[inline]
4223        unsafe fn encode(
4224            self,
4225            encoder: &mut fidl::encoding::Encoder<
4226                '_,
4227                fidl::encoding::DefaultFuchsiaResourceDialect,
4228            >,
4229            offset: usize,
4230            depth: fidl::encoding::Depth,
4231        ) -> fidl::Result<()> {
4232            encoder.debug_check_bounds::<VolumesCreateRequest>(offset);
4233            // Zero out padding regions. There's no need to apply masks
4234            // because the unmasked parts will be overwritten by fields.
4235            unsafe {
4236                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4237                (ptr as *mut u64).write_unaligned(0);
4238            }
4239            // Write the fields.
4240            self.0.encode(encoder, offset + 0, depth)?;
4241            self.1.encode(encoder, offset + 16, depth)?;
4242            self.2.encode(encoder, offset + 24, depth)?;
4243            self.3.encode(encoder, offset + 40, depth)?;
4244            Ok(())
4245        }
4246    }
4247
4248    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4249        for VolumesCreateRequest
4250    {
4251        #[inline(always)]
4252        fn new_empty() -> Self {
4253            Self {
4254                name: fidl::new_empty!(
4255                    fidl::encoding::BoundedString<255>,
4256                    fidl::encoding::DefaultFuchsiaResourceDialect
4257                ),
4258                outgoing_directory: fidl::new_empty!(
4259                    fidl::encoding::Endpoint<
4260                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4261                    >,
4262                    fidl::encoding::DefaultFuchsiaResourceDialect
4263                ),
4264                create_options: fidl::new_empty!(
4265                    CreateOptions,
4266                    fidl::encoding::DefaultFuchsiaResourceDialect
4267                ),
4268                mount_options: fidl::new_empty!(
4269                    MountOptions,
4270                    fidl::encoding::DefaultFuchsiaResourceDialect
4271                ),
4272            }
4273        }
4274
4275        #[inline]
4276        unsafe fn decode(
4277            &mut self,
4278            decoder: &mut fidl::encoding::Decoder<
4279                '_,
4280                fidl::encoding::DefaultFuchsiaResourceDialect,
4281            >,
4282            offset: usize,
4283            _depth: fidl::encoding::Depth,
4284        ) -> fidl::Result<()> {
4285            decoder.debug_check_bounds::<Self>(offset);
4286            // Verify that padding bytes are zero.
4287            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4288            let padval = unsafe { (ptr as *const u64).read_unaligned() };
4289            let mask = 0xffffffff00000000u64;
4290            let maskedval = padval & mask;
4291            if maskedval != 0 {
4292                return Err(fidl::Error::NonZeroPadding {
4293                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4294                });
4295            }
4296            fidl::decode!(
4297                fidl::encoding::BoundedString<255>,
4298                fidl::encoding::DefaultFuchsiaResourceDialect,
4299                &mut self.name,
4300                decoder,
4301                offset + 0,
4302                _depth
4303            )?;
4304            fidl::decode!(
4305                fidl::encoding::Endpoint<
4306                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
4307                >,
4308                fidl::encoding::DefaultFuchsiaResourceDialect,
4309                &mut self.outgoing_directory,
4310                decoder,
4311                offset + 16,
4312                _depth
4313            )?;
4314            fidl::decode!(
4315                CreateOptions,
4316                fidl::encoding::DefaultFuchsiaResourceDialect,
4317                &mut self.create_options,
4318                decoder,
4319                offset + 24,
4320                _depth
4321            )?;
4322            fidl::decode!(
4323                MountOptions,
4324                fidl::encoding::DefaultFuchsiaResourceDialect,
4325                &mut self.mount_options,
4326                decoder,
4327                offset + 40,
4328                _depth
4329            )?;
4330            Ok(())
4331        }
4332    }
4333
4334    impl CheckOptions {
4335        #[inline(always)]
4336        fn max_ordinal_present(&self) -> u64 {
4337            if let Some(_) = self.uri {
4338                return 2;
4339            }
4340            if let Some(_) = self.crypt {
4341                return 1;
4342            }
4343            0
4344        }
4345    }
4346
4347    impl fidl::encoding::ResourceTypeMarker for CheckOptions {
4348        type Borrowed<'a> = &'a mut Self;
4349        fn take_or_borrow<'a>(
4350            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4351        ) -> Self::Borrowed<'a> {
4352            value
4353        }
4354    }
4355
4356    unsafe impl fidl::encoding::TypeMarker for CheckOptions {
4357        type Owned = Self;
4358
4359        #[inline(always)]
4360        fn inline_align(_context: fidl::encoding::Context) -> usize {
4361            8
4362        }
4363
4364        #[inline(always)]
4365        fn inline_size(_context: fidl::encoding::Context) -> usize {
4366            16
4367        }
4368    }
4369
4370    unsafe impl fidl::encoding::Encode<CheckOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
4371        for &mut CheckOptions
4372    {
4373        unsafe fn encode(
4374            self,
4375            encoder: &mut fidl::encoding::Encoder<
4376                '_,
4377                fidl::encoding::DefaultFuchsiaResourceDialect,
4378            >,
4379            offset: usize,
4380            mut depth: fidl::encoding::Depth,
4381        ) -> fidl::Result<()> {
4382            encoder.debug_check_bounds::<CheckOptions>(offset);
4383            // Vector header
4384            let max_ordinal: u64 = self.max_ordinal_present();
4385            encoder.write_num(max_ordinal, offset);
4386            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4387            // Calling encoder.out_of_line_offset(0) is not allowed.
4388            if max_ordinal == 0 {
4389                return Ok(());
4390            }
4391            depth.increment()?;
4392            let envelope_size = 8;
4393            let bytes_len = max_ordinal as usize * envelope_size;
4394            #[allow(unused_variables)]
4395            let offset = encoder.out_of_line_offset(bytes_len);
4396            let mut _prev_end_offset: usize = 0;
4397            if 1 > max_ordinal {
4398                return Ok(());
4399            }
4400
4401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4402            // are envelope_size bytes.
4403            let cur_offset: usize = (1 - 1) * envelope_size;
4404
4405            // Zero reserved fields.
4406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4407
4408            // Safety:
4409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4411            //   envelope_size bytes, there is always sufficient room.
4412            fidl::encoding::encode_in_envelope_optional::<
4413                fidl::encoding::Endpoint<
4414                    fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
4415                >,
4416                fidl::encoding::DefaultFuchsiaResourceDialect,
4417            >(
4418                self.crypt.as_mut().map(
4419                    <fidl::encoding::Endpoint<
4420                        fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
4421                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
4422                ),
4423                encoder,
4424                offset + cur_offset,
4425                depth,
4426            )?;
4427
4428            _prev_end_offset = cur_offset + envelope_size;
4429            if 2 > max_ordinal {
4430                return Ok(());
4431            }
4432
4433            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4434            // are envelope_size bytes.
4435            let cur_offset: usize = (2 - 1) * envelope_size;
4436
4437            // Zero reserved fields.
4438            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4439
4440            // Safety:
4441            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4442            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4443            //   envelope_size bytes, there is always sufficient room.
4444            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4445            self.uri.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
4446            encoder, offset + cur_offset, depth
4447        )?;
4448
4449            _prev_end_offset = cur_offset + envelope_size;
4450
4451            Ok(())
4452        }
4453    }
4454
4455    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CheckOptions {
4456        #[inline(always)]
4457        fn new_empty() -> Self {
4458            Self::default()
4459        }
4460
4461        unsafe fn decode(
4462            &mut self,
4463            decoder: &mut fidl::encoding::Decoder<
4464                '_,
4465                fidl::encoding::DefaultFuchsiaResourceDialect,
4466            >,
4467            offset: usize,
4468            mut depth: fidl::encoding::Depth,
4469        ) -> fidl::Result<()> {
4470            decoder.debug_check_bounds::<Self>(offset);
4471            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4472                None => return Err(fidl::Error::NotNullable),
4473                Some(len) => len,
4474            };
4475            // Calling decoder.out_of_line_offset(0) is not allowed.
4476            if len == 0 {
4477                return Ok(());
4478            };
4479            depth.increment()?;
4480            let envelope_size = 8;
4481            let bytes_len = len * envelope_size;
4482            let offset = decoder.out_of_line_offset(bytes_len)?;
4483            // Decode the envelope for each type.
4484            let mut _next_ordinal_to_read = 0;
4485            let mut next_offset = offset;
4486            let end_offset = offset + bytes_len;
4487            _next_ordinal_to_read += 1;
4488            if next_offset >= end_offset {
4489                return Ok(());
4490            }
4491
4492            // Decode unknown envelopes for gaps in ordinals.
4493            while _next_ordinal_to_read < 1 {
4494                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4495                _next_ordinal_to_read += 1;
4496                next_offset += envelope_size;
4497            }
4498
4499            let next_out_of_line = decoder.next_out_of_line();
4500            let handles_before = decoder.remaining_handles();
4501            if let Some((inlined, num_bytes, num_handles)) =
4502                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4503            {
4504                let member_inline_size = <fidl::encoding::Endpoint<
4505                    fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
4506                > as fidl::encoding::TypeMarker>::inline_size(
4507                    decoder.context
4508                );
4509                if inlined != (member_inline_size <= 4) {
4510                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4511                }
4512                let inner_offset;
4513                let mut inner_depth = depth.clone();
4514                if inlined {
4515                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4516                    inner_offset = next_offset;
4517                } else {
4518                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4519                    inner_depth.increment()?;
4520                }
4521                let val_ref = self.crypt.get_or_insert_with(|| {
4522                    fidl::new_empty!(
4523                        fidl::encoding::Endpoint<
4524                            fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
4525                        >,
4526                        fidl::encoding::DefaultFuchsiaResourceDialect
4527                    )
4528                });
4529                fidl::decode!(
4530                    fidl::encoding::Endpoint<
4531                        fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
4532                    >,
4533                    fidl::encoding::DefaultFuchsiaResourceDialect,
4534                    val_ref,
4535                    decoder,
4536                    inner_offset,
4537                    inner_depth
4538                )?;
4539                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4540                {
4541                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4542                }
4543                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4544                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4545                }
4546            }
4547
4548            next_offset += envelope_size;
4549            _next_ordinal_to_read += 1;
4550            if next_offset >= end_offset {
4551                return Ok(());
4552            }
4553
4554            // Decode unknown envelopes for gaps in ordinals.
4555            while _next_ordinal_to_read < 2 {
4556                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4557                _next_ordinal_to_read += 1;
4558                next_offset += envelope_size;
4559            }
4560
4561            let next_out_of_line = decoder.next_out_of_line();
4562            let handles_before = decoder.remaining_handles();
4563            if let Some((inlined, num_bytes, num_handles)) =
4564                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4565            {
4566                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4567                if inlined != (member_inline_size <= 4) {
4568                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4569                }
4570                let inner_offset;
4571                let mut inner_depth = depth.clone();
4572                if inlined {
4573                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4574                    inner_offset = next_offset;
4575                } else {
4576                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4577                    inner_depth.increment()?;
4578                }
4579                let val_ref = self.uri.get_or_insert_with(|| {
4580                    fidl::new_empty!(
4581                        fidl::encoding::BoundedString<1024>,
4582                        fidl::encoding::DefaultFuchsiaResourceDialect
4583                    )
4584                });
4585                fidl::decode!(
4586                    fidl::encoding::BoundedString<1024>,
4587                    fidl::encoding::DefaultFuchsiaResourceDialect,
4588                    val_ref,
4589                    decoder,
4590                    inner_offset,
4591                    inner_depth
4592                )?;
4593                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4594                {
4595                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4596                }
4597                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4598                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4599                }
4600            }
4601
4602            next_offset += envelope_size;
4603
4604            // Decode the remaining unknown envelopes.
4605            while next_offset < end_offset {
4606                _next_ordinal_to_read += 1;
4607                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4608                next_offset += envelope_size;
4609            }
4610
4611            Ok(())
4612        }
4613    }
4614
4615    impl CreateOptions {
4616        #[inline(always)]
4617        fn max_ordinal_present(&self) -> u64 {
4618            if let Some(_) = self.restrict_inode_ids_to_32_bit {
4619                return 4;
4620            }
4621            if let Some(_) = self.type_guid {
4622                return 3;
4623            }
4624            if let Some(_) = self.guid {
4625                return 2;
4626            }
4627            if let Some(_) = self.initial_size {
4628                return 1;
4629            }
4630            0
4631        }
4632    }
4633
4634    impl fidl::encoding::ResourceTypeMarker for CreateOptions {
4635        type Borrowed<'a> = &'a mut Self;
4636        fn take_or_borrow<'a>(
4637            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4638        ) -> Self::Borrowed<'a> {
4639            value
4640        }
4641    }
4642
4643    unsafe impl fidl::encoding::TypeMarker for CreateOptions {
4644        type Owned = Self;
4645
4646        #[inline(always)]
4647        fn inline_align(_context: fidl::encoding::Context) -> usize {
4648            8
4649        }
4650
4651        #[inline(always)]
4652        fn inline_size(_context: fidl::encoding::Context) -> usize {
4653            16
4654        }
4655    }
4656
4657    unsafe impl fidl::encoding::Encode<CreateOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
4658        for &mut CreateOptions
4659    {
4660        unsafe fn encode(
4661            self,
4662            encoder: &mut fidl::encoding::Encoder<
4663                '_,
4664                fidl::encoding::DefaultFuchsiaResourceDialect,
4665            >,
4666            offset: usize,
4667            mut depth: fidl::encoding::Depth,
4668        ) -> fidl::Result<()> {
4669            encoder.debug_check_bounds::<CreateOptions>(offset);
4670            // Vector header
4671            let max_ordinal: u64 = self.max_ordinal_present();
4672            encoder.write_num(max_ordinal, offset);
4673            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4674            // Calling encoder.out_of_line_offset(0) is not allowed.
4675            if max_ordinal == 0 {
4676                return Ok(());
4677            }
4678            depth.increment()?;
4679            let envelope_size = 8;
4680            let bytes_len = max_ordinal as usize * envelope_size;
4681            #[allow(unused_variables)]
4682            let offset = encoder.out_of_line_offset(bytes_len);
4683            let mut _prev_end_offset: usize = 0;
4684            if 1 > max_ordinal {
4685                return Ok(());
4686            }
4687
4688            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4689            // are envelope_size bytes.
4690            let cur_offset: usize = (1 - 1) * envelope_size;
4691
4692            // Zero reserved fields.
4693            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4694
4695            // Safety:
4696            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4697            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4698            //   envelope_size bytes, there is always sufficient room.
4699            fidl::encoding::encode_in_envelope_optional::<
4700                u64,
4701                fidl::encoding::DefaultFuchsiaResourceDialect,
4702            >(
4703                self.initial_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4704                encoder,
4705                offset + cur_offset,
4706                depth,
4707            )?;
4708
4709            _prev_end_offset = cur_offset + envelope_size;
4710            if 2 > max_ordinal {
4711                return Ok(());
4712            }
4713
4714            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4715            // are envelope_size bytes.
4716            let cur_offset: usize = (2 - 1) * envelope_size;
4717
4718            // Zero reserved fields.
4719            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4720
4721            // Safety:
4722            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4723            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4724            //   envelope_size bytes, there is always sufficient room.
4725            fidl::encoding::encode_in_envelope_optional::<
4726                fidl::encoding::Array<u8, 16>,
4727                fidl::encoding::DefaultFuchsiaResourceDialect,
4728            >(
4729                self.guid.as_ref().map(
4730                    <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
4731                ),
4732                encoder,
4733                offset + cur_offset,
4734                depth,
4735            )?;
4736
4737            _prev_end_offset = cur_offset + envelope_size;
4738            if 3 > max_ordinal {
4739                return Ok(());
4740            }
4741
4742            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4743            // are envelope_size bytes.
4744            let cur_offset: usize = (3 - 1) * envelope_size;
4745
4746            // Zero reserved fields.
4747            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4748
4749            // Safety:
4750            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4751            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4752            //   envelope_size bytes, there is always sufficient room.
4753            fidl::encoding::encode_in_envelope_optional::<
4754                fidl::encoding::Array<u8, 16>,
4755                fidl::encoding::DefaultFuchsiaResourceDialect,
4756            >(
4757                self.type_guid.as_ref().map(
4758                    <fidl::encoding::Array<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
4759                ),
4760                encoder,
4761                offset + cur_offset,
4762                depth,
4763            )?;
4764
4765            _prev_end_offset = cur_offset + envelope_size;
4766            if 4 > max_ordinal {
4767                return Ok(());
4768            }
4769
4770            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4771            // are envelope_size bytes.
4772            let cur_offset: usize = (4 - 1) * envelope_size;
4773
4774            // Zero reserved fields.
4775            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4776
4777            // Safety:
4778            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4779            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4780            //   envelope_size bytes, there is always sufficient room.
4781            fidl::encoding::encode_in_envelope_optional::<
4782                bool,
4783                fidl::encoding::DefaultFuchsiaResourceDialect,
4784            >(
4785                self.restrict_inode_ids_to_32_bit
4786                    .as_ref()
4787                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
4788                encoder,
4789                offset + cur_offset,
4790                depth,
4791            )?;
4792
4793            _prev_end_offset = cur_offset + envelope_size;
4794
4795            Ok(())
4796        }
4797    }
4798
4799    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for CreateOptions {
4800        #[inline(always)]
4801        fn new_empty() -> Self {
4802            Self::default()
4803        }
4804
4805        unsafe fn decode(
4806            &mut self,
4807            decoder: &mut fidl::encoding::Decoder<
4808                '_,
4809                fidl::encoding::DefaultFuchsiaResourceDialect,
4810            >,
4811            offset: usize,
4812            mut depth: fidl::encoding::Depth,
4813        ) -> fidl::Result<()> {
4814            decoder.debug_check_bounds::<Self>(offset);
4815            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4816                None => return Err(fidl::Error::NotNullable),
4817                Some(len) => len,
4818            };
4819            // Calling decoder.out_of_line_offset(0) is not allowed.
4820            if len == 0 {
4821                return Ok(());
4822            };
4823            depth.increment()?;
4824            let envelope_size = 8;
4825            let bytes_len = len * envelope_size;
4826            let offset = decoder.out_of_line_offset(bytes_len)?;
4827            // Decode the envelope for each type.
4828            let mut _next_ordinal_to_read = 0;
4829            let mut next_offset = offset;
4830            let end_offset = offset + bytes_len;
4831            _next_ordinal_to_read += 1;
4832            if next_offset >= end_offset {
4833                return Ok(());
4834            }
4835
4836            // Decode unknown envelopes for gaps in ordinals.
4837            while _next_ordinal_to_read < 1 {
4838                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4839                _next_ordinal_to_read += 1;
4840                next_offset += envelope_size;
4841            }
4842
4843            let next_out_of_line = decoder.next_out_of_line();
4844            let handles_before = decoder.remaining_handles();
4845            if let Some((inlined, num_bytes, num_handles)) =
4846                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4847            {
4848                let member_inline_size =
4849                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4850                if inlined != (member_inline_size <= 4) {
4851                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4852                }
4853                let inner_offset;
4854                let mut inner_depth = depth.clone();
4855                if inlined {
4856                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4857                    inner_offset = next_offset;
4858                } else {
4859                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4860                    inner_depth.increment()?;
4861                }
4862                let val_ref = self.initial_size.get_or_insert_with(|| {
4863                    fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect)
4864                });
4865                fidl::decode!(
4866                    u64,
4867                    fidl::encoding::DefaultFuchsiaResourceDialect,
4868                    val_ref,
4869                    decoder,
4870                    inner_offset,
4871                    inner_depth
4872                )?;
4873                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4874                {
4875                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4876                }
4877                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4878                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4879                }
4880            }
4881
4882            next_offset += envelope_size;
4883            _next_ordinal_to_read += 1;
4884            if next_offset >= end_offset {
4885                return Ok(());
4886            }
4887
4888            // Decode unknown envelopes for gaps in ordinals.
4889            while _next_ordinal_to_read < 2 {
4890                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4891                _next_ordinal_to_read += 1;
4892                next_offset += envelope_size;
4893            }
4894
4895            let next_out_of_line = decoder.next_out_of_line();
4896            let handles_before = decoder.remaining_handles();
4897            if let Some((inlined, num_bytes, num_handles)) =
4898                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4899            {
4900                let member_inline_size =
4901                    <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
4902                        decoder.context,
4903                    );
4904                if inlined != (member_inline_size <= 4) {
4905                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4906                }
4907                let inner_offset;
4908                let mut inner_depth = depth.clone();
4909                if inlined {
4910                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4911                    inner_offset = next_offset;
4912                } else {
4913                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4914                    inner_depth.increment()?;
4915                }
4916                let val_ref =
4917                self.guid.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
4918                fidl::decode!(fidl::encoding::Array<u8, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4919                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4920                {
4921                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4922                }
4923                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4924                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4925                }
4926            }
4927
4928            next_offset += envelope_size;
4929            _next_ordinal_to_read += 1;
4930            if next_offset >= end_offset {
4931                return Ok(());
4932            }
4933
4934            // Decode unknown envelopes for gaps in ordinals.
4935            while _next_ordinal_to_read < 3 {
4936                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4937                _next_ordinal_to_read += 1;
4938                next_offset += envelope_size;
4939            }
4940
4941            let next_out_of_line = decoder.next_out_of_line();
4942            let handles_before = decoder.remaining_handles();
4943            if let Some((inlined, num_bytes, num_handles)) =
4944                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4945            {
4946                let member_inline_size =
4947                    <fidl::encoding::Array<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
4948                        decoder.context,
4949                    );
4950                if inlined != (member_inline_size <= 4) {
4951                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4952                }
4953                let inner_offset;
4954                let mut inner_depth = depth.clone();
4955                if inlined {
4956                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4957                    inner_offset = next_offset;
4958                } else {
4959                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4960                    inner_depth.increment()?;
4961                }
4962                let val_ref =
4963                self.type_guid.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, fidl::encoding::DefaultFuchsiaResourceDialect));
4964                fidl::decode!(fidl::encoding::Array<u8, 16>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4965                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4966                {
4967                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4968                }
4969                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4970                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4971                }
4972            }
4973
4974            next_offset += envelope_size;
4975            _next_ordinal_to_read += 1;
4976            if next_offset >= end_offset {
4977                return Ok(());
4978            }
4979
4980            // Decode unknown envelopes for gaps in ordinals.
4981            while _next_ordinal_to_read < 4 {
4982                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4983                _next_ordinal_to_read += 1;
4984                next_offset += envelope_size;
4985            }
4986
4987            let next_out_of_line = decoder.next_out_of_line();
4988            let handles_before = decoder.remaining_handles();
4989            if let Some((inlined, num_bytes, num_handles)) =
4990                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4991            {
4992                let member_inline_size =
4993                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4994                if inlined != (member_inline_size <= 4) {
4995                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4996                }
4997                let inner_offset;
4998                let mut inner_depth = depth.clone();
4999                if inlined {
5000                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5001                    inner_offset = next_offset;
5002                } else {
5003                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5004                    inner_depth.increment()?;
5005                }
5006                let val_ref = self.restrict_inode_ids_to_32_bit.get_or_insert_with(|| {
5007                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
5008                });
5009                fidl::decode!(
5010                    bool,
5011                    fidl::encoding::DefaultFuchsiaResourceDialect,
5012                    val_ref,
5013                    decoder,
5014                    inner_offset,
5015                    inner_depth
5016                )?;
5017                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5018                {
5019                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5020                }
5021                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5022                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5023                }
5024            }
5025
5026            next_offset += envelope_size;
5027
5028            // Decode the remaining unknown envelopes.
5029            while next_offset < end_offset {
5030                _next_ordinal_to_read += 1;
5031                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5032                next_offset += envelope_size;
5033            }
5034
5035            Ok(())
5036        }
5037    }
5038
5039    impl MountOptions {
5040        #[inline(always)]
5041        fn max_ordinal_present(&self) -> u64 {
5042            if let Some(_) = self.use_driver_blob_paging {
5043                return 4;
5044            }
5045            if let Some(_) = self.uri {
5046                return 3;
5047            }
5048            if let Some(_) = self.as_blob {
5049                return 2;
5050            }
5051            if let Some(_) = self.crypt {
5052                return 1;
5053            }
5054            0
5055        }
5056    }
5057
5058    impl fidl::encoding::ResourceTypeMarker for MountOptions {
5059        type Borrowed<'a> = &'a mut Self;
5060        fn take_or_borrow<'a>(
5061            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5062        ) -> Self::Borrowed<'a> {
5063            value
5064        }
5065    }
5066
5067    unsafe impl fidl::encoding::TypeMarker for MountOptions {
5068        type Owned = Self;
5069
5070        #[inline(always)]
5071        fn inline_align(_context: fidl::encoding::Context) -> usize {
5072            8
5073        }
5074
5075        #[inline(always)]
5076        fn inline_size(_context: fidl::encoding::Context) -> usize {
5077            16
5078        }
5079    }
5080
5081    unsafe impl fidl::encoding::Encode<MountOptions, fidl::encoding::DefaultFuchsiaResourceDialect>
5082        for &mut MountOptions
5083    {
5084        unsafe fn encode(
5085            self,
5086            encoder: &mut fidl::encoding::Encoder<
5087                '_,
5088                fidl::encoding::DefaultFuchsiaResourceDialect,
5089            >,
5090            offset: usize,
5091            mut depth: fidl::encoding::Depth,
5092        ) -> fidl::Result<()> {
5093            encoder.debug_check_bounds::<MountOptions>(offset);
5094            // Vector header
5095            let max_ordinal: u64 = self.max_ordinal_present();
5096            encoder.write_num(max_ordinal, offset);
5097            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5098            // Calling encoder.out_of_line_offset(0) is not allowed.
5099            if max_ordinal == 0 {
5100                return Ok(());
5101            }
5102            depth.increment()?;
5103            let envelope_size = 8;
5104            let bytes_len = max_ordinal as usize * envelope_size;
5105            #[allow(unused_variables)]
5106            let offset = encoder.out_of_line_offset(bytes_len);
5107            let mut _prev_end_offset: usize = 0;
5108            if 1 > max_ordinal {
5109                return Ok(());
5110            }
5111
5112            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5113            // are envelope_size bytes.
5114            let cur_offset: usize = (1 - 1) * envelope_size;
5115
5116            // Zero reserved fields.
5117            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5118
5119            // Safety:
5120            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5121            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5122            //   envelope_size bytes, there is always sufficient room.
5123            fidl::encoding::encode_in_envelope_optional::<
5124                fidl::encoding::Endpoint<
5125                    fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
5126                >,
5127                fidl::encoding::DefaultFuchsiaResourceDialect,
5128            >(
5129                self.crypt.as_mut().map(
5130                    <fidl::encoding::Endpoint<
5131                        fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
5132                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow,
5133                ),
5134                encoder,
5135                offset + cur_offset,
5136                depth,
5137            )?;
5138
5139            _prev_end_offset = cur_offset + envelope_size;
5140            if 2 > max_ordinal {
5141                return Ok(());
5142            }
5143
5144            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5145            // are envelope_size bytes.
5146            let cur_offset: usize = (2 - 1) * envelope_size;
5147
5148            // Zero reserved fields.
5149            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5150
5151            // Safety:
5152            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5153            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5154            //   envelope_size bytes, there is always sufficient room.
5155            fidl::encoding::encode_in_envelope_optional::<
5156                bool,
5157                fidl::encoding::DefaultFuchsiaResourceDialect,
5158            >(
5159                self.as_blob.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5160                encoder,
5161                offset + cur_offset,
5162                depth,
5163            )?;
5164
5165            _prev_end_offset = cur_offset + envelope_size;
5166            if 3 > max_ordinal {
5167                return Ok(());
5168            }
5169
5170            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5171            // are envelope_size bytes.
5172            let cur_offset: usize = (3 - 1) * envelope_size;
5173
5174            // Zero reserved fields.
5175            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5176
5177            // Safety:
5178            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5179            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5180            //   envelope_size bytes, there is always sufficient room.
5181            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
5182            self.uri.as_ref().map(<fidl::encoding::BoundedString<1024> as fidl::encoding::ValueTypeMarker>::borrow),
5183            encoder, offset + cur_offset, depth
5184        )?;
5185
5186            _prev_end_offset = cur_offset + envelope_size;
5187            if 4 > max_ordinal {
5188                return Ok(());
5189            }
5190
5191            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5192            // are envelope_size bytes.
5193            let cur_offset: usize = (4 - 1) * envelope_size;
5194
5195            // Zero reserved fields.
5196            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5197
5198            // Safety:
5199            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5200            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5201            //   envelope_size bytes, there is always sufficient room.
5202            fidl::encoding::encode_in_envelope_optional::<
5203                bool,
5204                fidl::encoding::DefaultFuchsiaResourceDialect,
5205            >(
5206                self.use_driver_blob_paging
5207                    .as_ref()
5208                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5209                encoder,
5210                offset + cur_offset,
5211                depth,
5212            )?;
5213
5214            _prev_end_offset = cur_offset + envelope_size;
5215
5216            Ok(())
5217        }
5218    }
5219
5220    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for MountOptions {
5221        #[inline(always)]
5222        fn new_empty() -> Self {
5223            Self::default()
5224        }
5225
5226        unsafe fn decode(
5227            &mut self,
5228            decoder: &mut fidl::encoding::Decoder<
5229                '_,
5230                fidl::encoding::DefaultFuchsiaResourceDialect,
5231            >,
5232            offset: usize,
5233            mut depth: fidl::encoding::Depth,
5234        ) -> fidl::Result<()> {
5235            decoder.debug_check_bounds::<Self>(offset);
5236            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5237                None => return Err(fidl::Error::NotNullable),
5238                Some(len) => len,
5239            };
5240            // Calling decoder.out_of_line_offset(0) is not allowed.
5241            if len == 0 {
5242                return Ok(());
5243            };
5244            depth.increment()?;
5245            let envelope_size = 8;
5246            let bytes_len = len * envelope_size;
5247            let offset = decoder.out_of_line_offset(bytes_len)?;
5248            // Decode the envelope for each type.
5249            let mut _next_ordinal_to_read = 0;
5250            let mut next_offset = offset;
5251            let end_offset = offset + bytes_len;
5252            _next_ordinal_to_read += 1;
5253            if next_offset >= end_offset {
5254                return Ok(());
5255            }
5256
5257            // Decode unknown envelopes for gaps in ordinals.
5258            while _next_ordinal_to_read < 1 {
5259                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5260                _next_ordinal_to_read += 1;
5261                next_offset += envelope_size;
5262            }
5263
5264            let next_out_of_line = decoder.next_out_of_line();
5265            let handles_before = decoder.remaining_handles();
5266            if let Some((inlined, num_bytes, num_handles)) =
5267                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5268            {
5269                let member_inline_size = <fidl::encoding::Endpoint<
5270                    fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
5271                > as fidl::encoding::TypeMarker>::inline_size(
5272                    decoder.context
5273                );
5274                if inlined != (member_inline_size <= 4) {
5275                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5276                }
5277                let inner_offset;
5278                let mut inner_depth = depth.clone();
5279                if inlined {
5280                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5281                    inner_offset = next_offset;
5282                } else {
5283                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5284                    inner_depth.increment()?;
5285                }
5286                let val_ref = self.crypt.get_or_insert_with(|| {
5287                    fidl::new_empty!(
5288                        fidl::encoding::Endpoint<
5289                            fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
5290                        >,
5291                        fidl::encoding::DefaultFuchsiaResourceDialect
5292                    )
5293                });
5294                fidl::decode!(
5295                    fidl::encoding::Endpoint<
5296                        fidl::endpoints::ClientEnd<fidl_fuchsia_fxfs::CryptMarker>,
5297                    >,
5298                    fidl::encoding::DefaultFuchsiaResourceDialect,
5299                    val_ref,
5300                    decoder,
5301                    inner_offset,
5302                    inner_depth
5303                )?;
5304                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5305                {
5306                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5307                }
5308                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5309                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5310                }
5311            }
5312
5313            next_offset += envelope_size;
5314            _next_ordinal_to_read += 1;
5315            if next_offset >= end_offset {
5316                return Ok(());
5317            }
5318
5319            // Decode unknown envelopes for gaps in ordinals.
5320            while _next_ordinal_to_read < 2 {
5321                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5322                _next_ordinal_to_read += 1;
5323                next_offset += envelope_size;
5324            }
5325
5326            let next_out_of_line = decoder.next_out_of_line();
5327            let handles_before = decoder.remaining_handles();
5328            if let Some((inlined, num_bytes, num_handles)) =
5329                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5330            {
5331                let member_inline_size =
5332                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5333                if inlined != (member_inline_size <= 4) {
5334                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5335                }
5336                let inner_offset;
5337                let mut inner_depth = depth.clone();
5338                if inlined {
5339                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5340                    inner_offset = next_offset;
5341                } else {
5342                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5343                    inner_depth.increment()?;
5344                }
5345                let val_ref = self.as_blob.get_or_insert_with(|| {
5346                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
5347                });
5348                fidl::decode!(
5349                    bool,
5350                    fidl::encoding::DefaultFuchsiaResourceDialect,
5351                    val_ref,
5352                    decoder,
5353                    inner_offset,
5354                    inner_depth
5355                )?;
5356                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5357                {
5358                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5359                }
5360                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5361                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5362                }
5363            }
5364
5365            next_offset += envelope_size;
5366            _next_ordinal_to_read += 1;
5367            if next_offset >= end_offset {
5368                return Ok(());
5369            }
5370
5371            // Decode unknown envelopes for gaps in ordinals.
5372            while _next_ordinal_to_read < 3 {
5373                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5374                _next_ordinal_to_read += 1;
5375                next_offset += envelope_size;
5376            }
5377
5378            let next_out_of_line = decoder.next_out_of_line();
5379            let handles_before = decoder.remaining_handles();
5380            if let Some((inlined, num_bytes, num_handles)) =
5381                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5382            {
5383                let member_inline_size = <fidl::encoding::BoundedString<1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5384                if inlined != (member_inline_size <= 4) {
5385                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5386                }
5387                let inner_offset;
5388                let mut inner_depth = depth.clone();
5389                if inlined {
5390                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5391                    inner_offset = next_offset;
5392                } else {
5393                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5394                    inner_depth.increment()?;
5395                }
5396                let val_ref = self.uri.get_or_insert_with(|| {
5397                    fidl::new_empty!(
5398                        fidl::encoding::BoundedString<1024>,
5399                        fidl::encoding::DefaultFuchsiaResourceDialect
5400                    )
5401                });
5402                fidl::decode!(
5403                    fidl::encoding::BoundedString<1024>,
5404                    fidl::encoding::DefaultFuchsiaResourceDialect,
5405                    val_ref,
5406                    decoder,
5407                    inner_offset,
5408                    inner_depth
5409                )?;
5410                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5411                {
5412                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5413                }
5414                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5415                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5416                }
5417            }
5418
5419            next_offset += envelope_size;
5420            _next_ordinal_to_read += 1;
5421            if next_offset >= end_offset {
5422                return Ok(());
5423            }
5424
5425            // Decode unknown envelopes for gaps in ordinals.
5426            while _next_ordinal_to_read < 4 {
5427                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5428                _next_ordinal_to_read += 1;
5429                next_offset += envelope_size;
5430            }
5431
5432            let next_out_of_line = decoder.next_out_of_line();
5433            let handles_before = decoder.remaining_handles();
5434            if let Some((inlined, num_bytes, num_handles)) =
5435                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5436            {
5437                let member_inline_size =
5438                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5439                if inlined != (member_inline_size <= 4) {
5440                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5441                }
5442                let inner_offset;
5443                let mut inner_depth = depth.clone();
5444                if inlined {
5445                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5446                    inner_offset = next_offset;
5447                } else {
5448                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5449                    inner_depth.increment()?;
5450                }
5451                let val_ref = self.use_driver_blob_paging.get_or_insert_with(|| {
5452                    fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect)
5453                });
5454                fidl::decode!(
5455                    bool,
5456                    fidl::encoding::DefaultFuchsiaResourceDialect,
5457                    val_ref,
5458                    decoder,
5459                    inner_offset,
5460                    inner_depth
5461                )?;
5462                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5463                {
5464                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5465                }
5466                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5467                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5468                }
5469            }
5470
5471            next_offset += envelope_size;
5472
5473            // Decode the remaining unknown envelopes.
5474            while next_offset < end_offset {
5475                _next_ordinal_to_read += 1;
5476                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5477                next_offset += envelope_size;
5478            }
5479
5480            Ok(())
5481        }
5482    }
5483}