fidl_fuchsia_storage_ext4/
fidl_fuchsia_storage_ext4.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_storage_ext4_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15pub struct ServerMountVmoRequest {
16    pub source: fidl::Vmo,
17    pub root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
18}
19
20impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ServerMountVmoRequest {}
21
22#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
23pub struct Server_Marker;
24
25impl fidl::endpoints::ProtocolMarker for Server_Marker {
26    type Proxy = Server_Proxy;
27    type RequestStream = Server_RequestStream;
28    #[cfg(target_os = "fuchsia")]
29    type SynchronousProxy = Server_SynchronousProxy;
30
31    const DEBUG_NAME: &'static str = "fuchsia.storage.ext4.Server";
32}
33impl fidl::endpoints::DiscoverableProtocolMarker for Server_Marker {}
34
35pub trait Server_ProxyInterface: Send + Sync {
36    type MountVmoResponseFut: std::future::Future<Output = Result<MountVmoResult, fidl::Error>>
37        + Send;
38    fn r#mount_vmo(
39        &self,
40        source: fidl::Vmo,
41        root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
42    ) -> Self::MountVmoResponseFut;
43}
44#[derive(Debug)]
45#[cfg(target_os = "fuchsia")]
46pub struct Server_SynchronousProxy {
47    client: fidl::client::sync::Client,
48}
49
50#[cfg(target_os = "fuchsia")]
51impl fidl::endpoints::SynchronousProxy for Server_SynchronousProxy {
52    type Proxy = Server_Proxy;
53    type Protocol = Server_Marker;
54
55    fn from_channel(inner: fidl::Channel) -> Self {
56        Self::new(inner)
57    }
58
59    fn into_channel(self) -> fidl::Channel {
60        self.client.into_channel()
61    }
62
63    fn as_channel(&self) -> &fidl::Channel {
64        self.client.as_channel()
65    }
66}
67
68#[cfg(target_os = "fuchsia")]
69impl Server_SynchronousProxy {
70    pub fn new(channel: fidl::Channel) -> Self {
71        let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
72        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
73    }
74
75    pub fn into_channel(self) -> fidl::Channel {
76        self.client.into_channel()
77    }
78
79    /// Waits until an event arrives and returns it. It is safe for other
80    /// threads to make concurrent requests while waiting for an event.
81    pub fn wait_for_event(
82        &self,
83        deadline: zx::MonotonicInstant,
84    ) -> Result<Server_Event, fidl::Error> {
85        Server_Event::decode(self.client.wait_for_event(deadline)?)
86    }
87
88    /// Read the VMO content as an Ext4 image and return a channel to the
89    /// root of the mounted file system.
90    ///
91    /// + request `source` is an Ext4 image to be served over the `root`
92    ///            connection.
93    /// + request `root` is the server end of a connection that will be
94    ///            serving the root of the mounted image.
95    /// - result `result` In case we could parse the image far enough to
96    ///           read the root directory [`MountVmoResult.success`] will be
97    ///           returned.  Note that you may pipeline requests to the
98    ///           `root` connection even before received a response.  In
99    ///           case of an error one of the other values will be returned
100    ///           and the `root` connection will be closed.
101    pub fn r#mount_vmo(
102        &self,
103        mut source: fidl::Vmo,
104        mut root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
105        ___deadline: zx::MonotonicInstant,
106    ) -> Result<MountVmoResult, fidl::Error> {
107        let _response = self.client.send_query::<ServerMountVmoRequest, ServerMountVmoResponse>(
108            (source, root),
109            0x191360124db7f6a6,
110            fidl::encoding::DynamicFlags::empty(),
111            ___deadline,
112        )?;
113        Ok(_response.result)
114    }
115}
116
117#[derive(Debug, Clone)]
118pub struct Server_Proxy {
119    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
120}
121
122impl fidl::endpoints::Proxy for Server_Proxy {
123    type Protocol = Server_Marker;
124
125    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
126        Self::new(inner)
127    }
128
129    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
130        self.client.into_channel().map_err(|client| Self { client })
131    }
132
133    fn as_channel(&self) -> &::fidl::AsyncChannel {
134        self.client.as_channel()
135    }
136}
137
138impl Server_Proxy {
139    /// Create a new Proxy for fuchsia.storage.ext4/Server.
140    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
141        let protocol_name = <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
142        Self { client: fidl::client::Client::new(channel, protocol_name) }
143    }
144
145    /// Get a Stream of events from the remote end of the protocol.
146    ///
147    /// # Panics
148    ///
149    /// Panics if the event stream was already taken.
150    pub fn take_event_stream(&self) -> Server_EventStream {
151        Server_EventStream { event_receiver: self.client.take_event_receiver() }
152    }
153
154    /// Read the VMO content as an Ext4 image and return a channel to the
155    /// root of the mounted file system.
156    ///
157    /// + request `source` is an Ext4 image to be served over the `root`
158    ///            connection.
159    /// + request `root` is the server end of a connection that will be
160    ///            serving the root of the mounted image.
161    /// - result `result` In case we could parse the image far enough to
162    ///           read the root directory [`MountVmoResult.success`] will be
163    ///           returned.  Note that you may pipeline requests to the
164    ///           `root` connection even before received a response.  In
165    ///           case of an error one of the other values will be returned
166    ///           and the `root` connection will be closed.
167    pub fn r#mount_vmo(
168        &self,
169        mut source: fidl::Vmo,
170        mut root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
171    ) -> fidl::client::QueryResponseFut<MountVmoResult, fidl::encoding::DefaultFuchsiaResourceDialect>
172    {
173        Server_ProxyInterface::r#mount_vmo(self, source, root)
174    }
175}
176
177impl Server_ProxyInterface for Server_Proxy {
178    type MountVmoResponseFut = fidl::client::QueryResponseFut<
179        MountVmoResult,
180        fidl::encoding::DefaultFuchsiaResourceDialect,
181    >;
182    fn r#mount_vmo(
183        &self,
184        mut source: fidl::Vmo,
185        mut root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
186    ) -> Self::MountVmoResponseFut {
187        fn _decode(
188            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
189        ) -> Result<MountVmoResult, fidl::Error> {
190            let _response = fidl::client::decode_transaction_body::<
191                ServerMountVmoResponse,
192                fidl::encoding::DefaultFuchsiaResourceDialect,
193                0x191360124db7f6a6,
194            >(_buf?)?;
195            Ok(_response.result)
196        }
197        self.client.send_query_and_decode::<ServerMountVmoRequest, MountVmoResult>(
198            (source, root),
199            0x191360124db7f6a6,
200            fidl::encoding::DynamicFlags::empty(),
201            _decode,
202        )
203    }
204}
205
206pub struct Server_EventStream {
207    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
208}
209
210impl std::marker::Unpin for Server_EventStream {}
211
212impl futures::stream::FusedStream for Server_EventStream {
213    fn is_terminated(&self) -> bool {
214        self.event_receiver.is_terminated()
215    }
216}
217
218impl futures::Stream for Server_EventStream {
219    type Item = Result<Server_Event, fidl::Error>;
220
221    fn poll_next(
222        mut self: std::pin::Pin<&mut Self>,
223        cx: &mut std::task::Context<'_>,
224    ) -> std::task::Poll<Option<Self::Item>> {
225        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
226            &mut self.event_receiver,
227            cx
228        )?) {
229            Some(buf) => std::task::Poll::Ready(Some(Server_Event::decode(buf))),
230            None => std::task::Poll::Ready(None),
231        }
232    }
233}
234
235#[derive(Debug)]
236pub enum Server_Event {}
237
238impl Server_Event {
239    /// Decodes a message buffer as a [`Server_Event`].
240    fn decode(
241        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
242    ) -> Result<Server_Event, fidl::Error> {
243        let (bytes, _handles) = buf.split_mut();
244        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
245        debug_assert_eq!(tx_header.tx_id, 0);
246        match tx_header.ordinal {
247            _ => Err(fidl::Error::UnknownOrdinal {
248                ordinal: tx_header.ordinal,
249                protocol_name: <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
250            }),
251        }
252    }
253}
254
255/// A Stream of incoming requests for fuchsia.storage.ext4/Server.
256pub struct Server_RequestStream {
257    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
258    is_terminated: bool,
259}
260
261impl std::marker::Unpin for Server_RequestStream {}
262
263impl futures::stream::FusedStream for Server_RequestStream {
264    fn is_terminated(&self) -> bool {
265        self.is_terminated
266    }
267}
268
269impl fidl::endpoints::RequestStream for Server_RequestStream {
270    type Protocol = Server_Marker;
271    type ControlHandle = Server_ControlHandle;
272
273    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
274        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
275    }
276
277    fn control_handle(&self) -> Self::ControlHandle {
278        Server_ControlHandle { inner: self.inner.clone() }
279    }
280
281    fn into_inner(
282        self,
283    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
284    {
285        (self.inner, self.is_terminated)
286    }
287
288    fn from_inner(
289        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
290        is_terminated: bool,
291    ) -> Self {
292        Self { inner, is_terminated }
293    }
294}
295
296impl futures::Stream for Server_RequestStream {
297    type Item = Result<Server_Request, fidl::Error>;
298
299    fn poll_next(
300        mut self: std::pin::Pin<&mut Self>,
301        cx: &mut std::task::Context<'_>,
302    ) -> std::task::Poll<Option<Self::Item>> {
303        let this = &mut *self;
304        if this.inner.check_shutdown(cx) {
305            this.is_terminated = true;
306            return std::task::Poll::Ready(None);
307        }
308        if this.is_terminated {
309            panic!("polled Server_RequestStream after completion");
310        }
311        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
312            |bytes, handles| {
313                match this.inner.channel().read_etc(cx, bytes, handles) {
314                    std::task::Poll::Ready(Ok(())) => {}
315                    std::task::Poll::Pending => return std::task::Poll::Pending,
316                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
317                        this.is_terminated = true;
318                        return std::task::Poll::Ready(None);
319                    }
320                    std::task::Poll::Ready(Err(e)) => {
321                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
322                            e.into(),
323                        ))))
324                    }
325                }
326
327                // A message has been received from the channel
328                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
329
330                std::task::Poll::Ready(Some(match header.ordinal {
331                    0x191360124db7f6a6 => {
332                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
333                        let mut req = fidl::new_empty!(
334                            ServerMountVmoRequest,
335                            fidl::encoding::DefaultFuchsiaResourceDialect
336                        );
337                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ServerMountVmoRequest>(&header, _body_bytes, handles, &mut req)?;
338                        let control_handle = Server_ControlHandle { inner: this.inner.clone() };
339                        Ok(Server_Request::MountVmo {
340                            source: req.source,
341                            root: req.root,
342
343                            responder: Server_MountVmoResponder {
344                                control_handle: std::mem::ManuallyDrop::new(control_handle),
345                                tx_id: header.tx_id,
346                            },
347                        })
348                    }
349                    _ => Err(fidl::Error::UnknownOrdinal {
350                        ordinal: header.ordinal,
351                        protocol_name:
352                            <Server_Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
353                    }),
354                }))
355            },
356        )
357    }
358}
359
360#[derive(Debug)]
361pub enum Server_Request {
362    /// Read the VMO content as an Ext4 image and return a channel to the
363    /// root of the mounted file system.
364    ///
365    /// + request `source` is an Ext4 image to be served over the `root`
366    ///            connection.
367    /// + request `root` is the server end of a connection that will be
368    ///            serving the root of the mounted image.
369    /// - result `result` In case we could parse the image far enough to
370    ///           read the root directory [`MountVmoResult.success`] will be
371    ///           returned.  Note that you may pipeline requests to the
372    ///           `root` connection even before received a response.  In
373    ///           case of an error one of the other values will be returned
374    ///           and the `root` connection will be closed.
375    MountVmo {
376        source: fidl::Vmo,
377        root: fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
378        responder: Server_MountVmoResponder,
379    },
380}
381
382impl Server_Request {
383    #[allow(irrefutable_let_patterns)]
384    pub fn into_mount_vmo(
385        self,
386    ) -> Option<(
387        fidl::Vmo,
388        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
389        Server_MountVmoResponder,
390    )> {
391        if let Server_Request::MountVmo { source, root, responder } = self {
392            Some((source, root, responder))
393        } else {
394            None
395        }
396    }
397
398    /// Name of the method defined in FIDL
399    pub fn method_name(&self) -> &'static str {
400        match *self {
401            Server_Request::MountVmo { .. } => "mount_vmo",
402        }
403    }
404}
405
406#[derive(Debug, Clone)]
407pub struct Server_ControlHandle {
408    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
409}
410
411impl fidl::endpoints::ControlHandle for Server_ControlHandle {
412    fn shutdown(&self) {
413        self.inner.shutdown()
414    }
415    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
416        self.inner.shutdown_with_epitaph(status)
417    }
418
419    fn is_closed(&self) -> bool {
420        self.inner.channel().is_closed()
421    }
422    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
423        self.inner.channel().on_closed()
424    }
425
426    #[cfg(target_os = "fuchsia")]
427    fn signal_peer(
428        &self,
429        clear_mask: zx::Signals,
430        set_mask: zx::Signals,
431    ) -> Result<(), zx_status::Status> {
432        use fidl::Peered;
433        self.inner.channel().signal_peer(clear_mask, set_mask)
434    }
435}
436
437impl Server_ControlHandle {}
438
439#[must_use = "FIDL methods require a response to be sent"]
440#[derive(Debug)]
441pub struct Server_MountVmoResponder {
442    control_handle: std::mem::ManuallyDrop<Server_ControlHandle>,
443    tx_id: u32,
444}
445
446/// Set the the channel to be shutdown (see [`Server_ControlHandle::shutdown`])
447/// if the responder is dropped without sending a response, so that the client
448/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
449impl std::ops::Drop for Server_MountVmoResponder {
450    fn drop(&mut self) {
451        self.control_handle.shutdown();
452        // Safety: drops once, never accessed again
453        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
454    }
455}
456
457impl fidl::endpoints::Responder for Server_MountVmoResponder {
458    type ControlHandle = Server_ControlHandle;
459
460    fn control_handle(&self) -> &Server_ControlHandle {
461        &self.control_handle
462    }
463
464    fn drop_without_shutdown(mut self) {
465        // Safety: drops once, never accessed again due to mem::forget
466        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
467        // Prevent Drop from running (which would shut down the channel)
468        std::mem::forget(self);
469    }
470}
471
472impl Server_MountVmoResponder {
473    /// Sends a response to the FIDL transaction.
474    ///
475    /// Sets the channel to shutdown if an error occurs.
476    pub fn send(self, mut result: &MountVmoResult) -> Result<(), fidl::Error> {
477        let _result = self.send_raw(result);
478        if _result.is_err() {
479            self.control_handle.shutdown();
480        }
481        self.drop_without_shutdown();
482        _result
483    }
484
485    /// Similar to "send" but does not shutdown the channel if an error occurs.
486    pub fn send_no_shutdown_on_err(self, mut result: &MountVmoResult) -> Result<(), fidl::Error> {
487        let _result = self.send_raw(result);
488        self.drop_without_shutdown();
489        _result
490    }
491
492    fn send_raw(&self, mut result: &MountVmoResult) -> Result<(), fidl::Error> {
493        self.control_handle.inner.send::<ServerMountVmoResponse>(
494            (result,),
495            self.tx_id,
496            0x191360124db7f6a6,
497            fidl::encoding::DynamicFlags::empty(),
498        )
499    }
500}
501
502#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
503pub struct ServiceMarker;
504
505#[cfg(target_os = "fuchsia")]
506impl fidl::endpoints::ServiceMarker for ServiceMarker {
507    type Proxy = ServiceProxy;
508    type Request = ServiceRequest;
509    const SERVICE_NAME: &'static str = "fuchsia.storage.ext4.Service";
510}
511
512/// A request for one of the member protocols of Service.
513///
514#[cfg(target_os = "fuchsia")]
515pub enum ServiceRequest {
516    /// An Ext4 server that can parse a file system image and present it
517    /// using fuchsia-io FIDL API.
518    Server(Server_RequestStream),
519}
520
521#[cfg(target_os = "fuchsia")]
522impl fidl::endpoints::ServiceRequest for ServiceRequest {
523    type Service = ServiceMarker;
524
525    fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
526        match name {
527            "server" => Self::Server(
528                <Server_RequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
529            ),
530            _ => panic!("no such member protocol name for service Service"),
531        }
532    }
533
534    fn member_names() -> &'static [&'static str] {
535        &["server"]
536    }
537}
538#[cfg(target_os = "fuchsia")]
539pub struct ServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
540
541#[cfg(target_os = "fuchsia")]
542impl fidl::endpoints::ServiceProxy for ServiceProxy {
543    type Service = ServiceMarker;
544
545    fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
546        Self(opener)
547    }
548}
549
550#[cfg(target_os = "fuchsia")]
551impl ServiceProxy {
552    /// An Ext4 server that can parse a file system image and present it
553    /// using fuchsia-io FIDL API.
554    pub fn connect_to_server(&self) -> Result<Server_Proxy, fidl::Error> {
555        let (proxy, server_end) = fidl::endpoints::create_proxy::<Server_Marker>();
556        self.connect_channel_to_server(server_end)?;
557        Ok(proxy)
558    }
559
560    /// Like `connect_to_server`, but returns a sync proxy.
561    /// See [`Self::connect_to_server`] for more details.
562    pub fn connect_to_server_sync(&self) -> Result<Server_SynchronousProxy, fidl::Error> {
563        let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<Server_Marker>();
564        self.connect_channel_to_server(server_end)?;
565        Ok(proxy)
566    }
567
568    /// Like `connect_to_server`, but accepts a server end.
569    /// See [`Self::connect_to_server`] for more details.
570    pub fn connect_channel_to_server(
571        &self,
572        server_end: fidl::endpoints::ServerEnd<Server_Marker>,
573    ) -> Result<(), fidl::Error> {
574        self.0.open_member("server", server_end.into_channel())
575    }
576
577    pub fn instance_name(&self) -> &str {
578        self.0.instance_name()
579    }
580}
581
582mod internal {
583    use super::*;
584
585    impl fidl::encoding::ResourceTypeMarker for ServerMountVmoRequest {
586        type Borrowed<'a> = &'a mut Self;
587        fn take_or_borrow<'a>(
588            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
589        ) -> Self::Borrowed<'a> {
590            value
591        }
592    }
593
594    unsafe impl fidl::encoding::TypeMarker for ServerMountVmoRequest {
595        type Owned = Self;
596
597        #[inline(always)]
598        fn inline_align(_context: fidl::encoding::Context) -> usize {
599            4
600        }
601
602        #[inline(always)]
603        fn inline_size(_context: fidl::encoding::Context) -> usize {
604            8
605        }
606    }
607
608    unsafe impl
609        fidl::encoding::Encode<ServerMountVmoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
610        for &mut ServerMountVmoRequest
611    {
612        #[inline]
613        unsafe fn encode(
614            self,
615            encoder: &mut fidl::encoding::Encoder<
616                '_,
617                fidl::encoding::DefaultFuchsiaResourceDialect,
618            >,
619            offset: usize,
620            _depth: fidl::encoding::Depth,
621        ) -> fidl::Result<()> {
622            encoder.debug_check_bounds::<ServerMountVmoRequest>(offset);
623            // Delegate to tuple encoding.
624            fidl::encoding::Encode::<
625                ServerMountVmoRequest,
626                fidl::encoding::DefaultFuchsiaResourceDialect,
627            >::encode(
628                (
629                    <fidl::encoding::HandleType<
630                        fidl::Vmo,
631                        { fidl::ObjectType::VMO.into_raw() },
632                        2147483648,
633                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
634                        &mut self.source
635                    ),
636                    <fidl::encoding::Endpoint<
637                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
638                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
639                        &mut self.root
640                    ),
641                ),
642                encoder,
643                offset,
644                _depth,
645            )
646        }
647    }
648    unsafe impl<
649            T0: fidl::encoding::Encode<
650                fidl::encoding::HandleType<
651                    fidl::Vmo,
652                    { fidl::ObjectType::VMO.into_raw() },
653                    2147483648,
654                >,
655                fidl::encoding::DefaultFuchsiaResourceDialect,
656            >,
657            T1: fidl::encoding::Encode<
658                fidl::encoding::Endpoint<
659                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
660                >,
661                fidl::encoding::DefaultFuchsiaResourceDialect,
662            >,
663        >
664        fidl::encoding::Encode<ServerMountVmoRequest, fidl::encoding::DefaultFuchsiaResourceDialect>
665        for (T0, T1)
666    {
667        #[inline]
668        unsafe fn encode(
669            self,
670            encoder: &mut fidl::encoding::Encoder<
671                '_,
672                fidl::encoding::DefaultFuchsiaResourceDialect,
673            >,
674            offset: usize,
675            depth: fidl::encoding::Depth,
676        ) -> fidl::Result<()> {
677            encoder.debug_check_bounds::<ServerMountVmoRequest>(offset);
678            // Zero out padding regions. There's no need to apply masks
679            // because the unmasked parts will be overwritten by fields.
680            // Write the fields.
681            self.0.encode(encoder, offset + 0, depth)?;
682            self.1.encode(encoder, offset + 4, depth)?;
683            Ok(())
684        }
685    }
686
687    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
688        for ServerMountVmoRequest
689    {
690        #[inline(always)]
691        fn new_empty() -> Self {
692            Self {
693                source: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
694                root: fidl::new_empty!(
695                    fidl::encoding::Endpoint<
696                        fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
697                    >,
698                    fidl::encoding::DefaultFuchsiaResourceDialect
699                ),
700            }
701        }
702
703        #[inline]
704        unsafe fn decode(
705            &mut self,
706            decoder: &mut fidl::encoding::Decoder<
707                '_,
708                fidl::encoding::DefaultFuchsiaResourceDialect,
709            >,
710            offset: usize,
711            _depth: fidl::encoding::Depth,
712        ) -> fidl::Result<()> {
713            decoder.debug_check_bounds::<Self>(offset);
714            // Verify that padding bytes are zero.
715            fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.source, decoder, offset + 0, _depth)?;
716            fidl::decode!(
717                fidl::encoding::Endpoint<
718                    fidl::endpoints::ServerEnd<fidl_fuchsia_io::DirectoryMarker>,
719                >,
720                fidl::encoding::DefaultFuchsiaResourceDialect,
721                &mut self.root,
722                decoder,
723                offset + 4,
724                _depth
725            )?;
726            Ok(())
727        }
728    }
729}