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