Skip to main content

fidl_fuchsia_fs_startup/
fidl_fuchsia_fs_startup.rs

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