fidl_fuchsia_vulkan_loader/
fidl_fuchsia_vulkan_loader.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13bitflags! {
14    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
15    pub struct ConnectToManifestOptions: u32 {
16        /// Wait for the loader to finish processing current ICD loading/unloading
17        /// operations before completing the connection.
18        const WAIT_FOR_IDLE = 1;
19    }
20}
21
22impl ConnectToManifestOptions {
23    #[inline(always)]
24    pub fn from_bits_allow_unknown(bits: u32) -> Self {
25        Self::from_bits_retain(bits)
26    }
27
28    #[inline(always)]
29    pub fn has_unknown_bits(&self) -> bool {
30        self.get_unknown_bits() != 0
31    }
32
33    #[inline(always)]
34    pub fn get_unknown_bits(&self) -> u32 {
35        self.bits() & !Self::all().bits()
36    }
37}
38
39bitflags! {
40    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
41    pub struct Features: u32 {
42        /// Implements Get().
43        const GET = 1;
44        /// Implements ConnectToDeviceFs().
45        const CONNECT_TO_DEVICE_FS = 2;
46        /// Implements ConnectToManifestFs().
47        const CONNECT_TO_MANIFEST_FS = 4;
48    }
49}
50
51impl Features {
52    #[inline(always)]
53    pub fn from_bits_allow_unknown(bits: u32) -> Self {
54        Self::from_bits_retain(bits)
55    }
56
57    #[inline(always)]
58    pub fn has_unknown_bits(&self) -> bool {
59        self.get_unknown_bits() != 0
60    }
61
62    #[inline(always)]
63    pub fn get_unknown_bits(&self) -> u32 {
64        self.bits() & !Self::all().bits()
65    }
66}
67
68/// Error type returned by [`Loader.GetVmexResource`].
69#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
70pub enum GetVmexResourceError {
71    /// The structured config value `allow_lavapipe_icd` is false.
72    LavapipeIcdNotAllowed,
73    /// The loader was unable to obtain a `VmexResource` handle.
74    FailedToObtainResource,
75    #[doc(hidden)]
76    __SourceBreaking { unknown_ordinal: u32 },
77}
78
79/// Pattern that matches an unknown `GetVmexResourceError` member.
80#[macro_export]
81macro_rules! GetVmexResourceErrorUnknown {
82    () => {
83        _
84    };
85}
86
87impl GetVmexResourceError {
88    #[inline]
89    pub fn from_primitive(prim: u32) -> Option<Self> {
90        match prim {
91            1 => Some(Self::LavapipeIcdNotAllowed),
92            2 => Some(Self::FailedToObtainResource),
93            _ => None,
94        }
95    }
96
97    #[inline]
98    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
99        match prim {
100            1 => Self::LavapipeIcdNotAllowed,
101            2 => Self::FailedToObtainResource,
102            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
103        }
104    }
105
106    #[inline]
107    pub fn unknown() -> Self {
108        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
109    }
110
111    #[inline]
112    pub const fn into_primitive(self) -> u32 {
113        match self {
114            Self::LavapipeIcdNotAllowed => 1,
115            Self::FailedToObtainResource => 2,
116            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
117        }
118    }
119
120    #[inline]
121    pub fn is_unknown(&self) -> bool {
122        match self {
123            Self::__SourceBreaking { unknown_ordinal: _ } => true,
124            _ => false,
125        }
126    }
127}
128
129#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
130pub struct LoaderConnectToDeviceFsRequest {
131    pub channel: fidl::Channel,
132}
133
134impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
135    for LoaderConnectToDeviceFsRequest
136{
137}
138
139#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
140pub struct LoaderConnectToManifestFsRequest {
141    pub options: ConnectToManifestOptions,
142    pub channel: fidl::Channel,
143}
144
145impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
146    for LoaderConnectToManifestFsRequest
147{
148}
149
150#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
151pub struct LoaderGetRequest {
152    pub name: String,
153}
154
155impl fidl::Persistable for LoaderGetRequest {}
156
157#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
158pub struct LoaderGetResponse {
159    pub lib: Option<fidl::Vmo>,
160}
161
162impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for LoaderGetResponse {}
163
164#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
165pub struct LoaderGetSupportedFeaturesResponse {
166    pub features: Features,
167}
168
169impl fidl::Persistable for LoaderGetSupportedFeaturesResponse {}
170
171#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
172pub struct LoaderGetVmexResourceResponse {
173    pub resource: fidl::Resource,
174}
175
176impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
177    for LoaderGetVmexResourceResponse
178{
179}
180
181#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
182pub struct LoaderMarker;
183
184impl fidl::endpoints::ProtocolMarker for LoaderMarker {
185    type Proxy = LoaderProxy;
186    type RequestStream = LoaderRequestStream;
187    #[cfg(target_os = "fuchsia")]
188    type SynchronousProxy = LoaderSynchronousProxy;
189
190    const DEBUG_NAME: &'static str = "fuchsia.vulkan.loader.Loader";
191}
192impl fidl::endpoints::DiscoverableProtocolMarker for LoaderMarker {}
193pub type LoaderGetVmexResourceResult = Result<fidl::Resource, GetVmexResourceError>;
194
195pub trait LoaderProxyInterface: Send + Sync {
196    type GetResponseFut: std::future::Future<Output = Result<Option<fidl::Vmo>, fidl::Error>> + Send;
197    fn r#get(&self, name: &str) -> Self::GetResponseFut;
198    fn r#connect_to_manifest_fs(
199        &self,
200        options: ConnectToManifestOptions,
201        channel: fidl::Channel,
202    ) -> Result<(), fidl::Error>;
203    fn r#connect_to_device_fs(&self, channel: fidl::Channel) -> Result<(), fidl::Error>;
204    type GetSupportedFeaturesResponseFut: std::future::Future<Output = Result<Features, fidl::Error>>
205        + Send;
206    fn r#get_supported_features(&self) -> Self::GetSupportedFeaturesResponseFut;
207    type GetVmexResourceResponseFut: std::future::Future<Output = Result<LoaderGetVmexResourceResult, fidl::Error>>
208        + Send;
209    fn r#get_vmex_resource(&self) -> Self::GetVmexResourceResponseFut;
210}
211#[derive(Debug)]
212#[cfg(target_os = "fuchsia")]
213pub struct LoaderSynchronousProxy {
214    client: fidl::client::sync::Client,
215}
216
217#[cfg(target_os = "fuchsia")]
218impl fidl::endpoints::SynchronousProxy for LoaderSynchronousProxy {
219    type Proxy = LoaderProxy;
220    type Protocol = LoaderMarker;
221
222    fn from_channel(inner: fidl::Channel) -> Self {
223        Self::new(inner)
224    }
225
226    fn into_channel(self) -> fidl::Channel {
227        self.client.into_channel()
228    }
229
230    fn as_channel(&self) -> &fidl::Channel {
231        self.client.as_channel()
232    }
233}
234
235#[cfg(target_os = "fuchsia")]
236impl LoaderSynchronousProxy {
237    pub fn new(channel: fidl::Channel) -> Self {
238        let protocol_name = <LoaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
239        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
240    }
241
242    pub fn into_channel(self) -> fidl::Channel {
243        self.client.into_channel()
244    }
245
246    /// Waits until an event arrives and returns it. It is safe for other
247    /// threads to make concurrent requests while waiting for an event.
248    pub fn wait_for_event(
249        &self,
250        deadline: zx::MonotonicInstant,
251    ) -> Result<LoaderEvent, fidl::Error> {
252        LoaderEvent::decode(self.client.wait_for_event(deadline)?)
253    }
254
255    /// Requests a client driver library with the given name from the Vulkan loader
256    /// service. Returns a VMO suitable for loading as a dynamic library on
257    /// success, a null handle on failure.
258    pub fn r#get(
259        &self,
260        mut name: &str,
261        ___deadline: zx::MonotonicInstant,
262    ) -> Result<Option<fidl::Vmo>, fidl::Error> {
263        let _response = self.client.send_query::<LoaderGetRequest, LoaderGetResponse>(
264            (name,),
265            0x73dbbfb62e99320a,
266            fidl::encoding::DynamicFlags::empty(),
267            ___deadline,
268        )?;
269        Ok(_response.lib)
270    }
271
272    /// Connects to a FS serving fuchsia.io containing all Vulkan ICD manifests.
273    /// See
274    /// <https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#icd-manifest-file-format>
275    /// for a description of the manifest file format.  Manifests will always
276    /// appear in this directory after the relevant device appears in
277    /// `ConnectToDeviceFs()`.
278    pub fn r#connect_to_manifest_fs(
279        &self,
280        mut options: ConnectToManifestOptions,
281        mut channel: fidl::Channel,
282    ) -> Result<(), fidl::Error> {
283        self.client.send::<LoaderConnectToManifestFsRequest>(
284            (options, channel),
285            0x454d855877881cc,
286            fidl::encoding::DynamicFlags::empty(),
287        )
288    }
289
290    /// Connects to a FS serving fuchsia.io containing all device nodes
291    /// potentially relevant to ICDs.  /dev/<devname> will be served under
292    /// <devname> in this directory.
293    pub fn r#connect_to_device_fs(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
294        self.client.send::<LoaderConnectToDeviceFsRequest>(
295            (channel,),
296            0x11cd633f2f5ff6d7,
297            fidl::encoding::DynamicFlags::empty(),
298        )
299    }
300
301    /// Returns the set of features the loader service supports.
302    pub fn r#get_supported_features(
303        &self,
304        ___deadline: zx::MonotonicInstant,
305    ) -> Result<Features, fidl::Error> {
306        let _response = self
307            .client
308            .send_query::<fidl::encoding::EmptyPayload, LoaderGetSupportedFeaturesResponse>(
309                (),
310                0x381abfce172892bd,
311                fidl::encoding::DynamicFlags::empty(),
312                ___deadline,
313            )?;
314        Ok(_response.features)
315    }
316
317    /// Returns a VmexResource that can be used by Lavapipe to JIT-compile code in the client
318    /// process, or an error.
319    pub fn r#get_vmex_resource(
320        &self,
321        ___deadline: zx::MonotonicInstant,
322    ) -> Result<LoaderGetVmexResourceResult, fidl::Error> {
323        let _response =
324            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
325                LoaderGetVmexResourceResponse,
326                GetVmexResourceError,
327            >>(
328                (),
329                0x71aea090ffef259b,
330                fidl::encoding::DynamicFlags::empty(),
331                ___deadline,
332            )?;
333        Ok(_response.map(|x| x.resource))
334    }
335}
336
337#[derive(Debug, Clone)]
338pub struct LoaderProxy {
339    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
340}
341
342impl fidl::endpoints::Proxy for LoaderProxy {
343    type Protocol = LoaderMarker;
344
345    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
346        Self::new(inner)
347    }
348
349    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
350        self.client.into_channel().map_err(|client| Self { client })
351    }
352
353    fn as_channel(&self) -> &::fidl::AsyncChannel {
354        self.client.as_channel()
355    }
356}
357
358impl LoaderProxy {
359    /// Create a new Proxy for fuchsia.vulkan.loader/Loader.
360    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
361        let protocol_name = <LoaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
362        Self { client: fidl::client::Client::new(channel, protocol_name) }
363    }
364
365    /// Get a Stream of events from the remote end of the protocol.
366    ///
367    /// # Panics
368    ///
369    /// Panics if the event stream was already taken.
370    pub fn take_event_stream(&self) -> LoaderEventStream {
371        LoaderEventStream { event_receiver: self.client.take_event_receiver() }
372    }
373
374    /// Requests a client driver library with the given name from the Vulkan loader
375    /// service. Returns a VMO suitable for loading as a dynamic library on
376    /// success, a null handle on failure.
377    pub fn r#get(
378        &self,
379        mut name: &str,
380    ) -> fidl::client::QueryResponseFut<
381        Option<fidl::Vmo>,
382        fidl::encoding::DefaultFuchsiaResourceDialect,
383    > {
384        LoaderProxyInterface::r#get(self, name)
385    }
386
387    /// Connects to a FS serving fuchsia.io containing all Vulkan ICD manifests.
388    /// See
389    /// <https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#icd-manifest-file-format>
390    /// for a description of the manifest file format.  Manifests will always
391    /// appear in this directory after the relevant device appears in
392    /// `ConnectToDeviceFs()`.
393    pub fn r#connect_to_manifest_fs(
394        &self,
395        mut options: ConnectToManifestOptions,
396        mut channel: fidl::Channel,
397    ) -> Result<(), fidl::Error> {
398        LoaderProxyInterface::r#connect_to_manifest_fs(self, options, channel)
399    }
400
401    /// Connects to a FS serving fuchsia.io containing all device nodes
402    /// potentially relevant to ICDs.  /dev/<devname> will be served under
403    /// <devname> in this directory.
404    pub fn r#connect_to_device_fs(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
405        LoaderProxyInterface::r#connect_to_device_fs(self, channel)
406    }
407
408    /// Returns the set of features the loader service supports.
409    pub fn r#get_supported_features(
410        &self,
411    ) -> fidl::client::QueryResponseFut<Features, fidl::encoding::DefaultFuchsiaResourceDialect>
412    {
413        LoaderProxyInterface::r#get_supported_features(self)
414    }
415
416    /// Returns a VmexResource that can be used by Lavapipe to JIT-compile code in the client
417    /// process, or an error.
418    pub fn r#get_vmex_resource(
419        &self,
420    ) -> fidl::client::QueryResponseFut<
421        LoaderGetVmexResourceResult,
422        fidl::encoding::DefaultFuchsiaResourceDialect,
423    > {
424        LoaderProxyInterface::r#get_vmex_resource(self)
425    }
426}
427
428impl LoaderProxyInterface for LoaderProxy {
429    type GetResponseFut = fidl::client::QueryResponseFut<
430        Option<fidl::Vmo>,
431        fidl::encoding::DefaultFuchsiaResourceDialect,
432    >;
433    fn r#get(&self, mut name: &str) -> Self::GetResponseFut {
434        fn _decode(
435            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
436        ) -> Result<Option<fidl::Vmo>, fidl::Error> {
437            let _response = fidl::client::decode_transaction_body::<
438                LoaderGetResponse,
439                fidl::encoding::DefaultFuchsiaResourceDialect,
440                0x73dbbfb62e99320a,
441            >(_buf?)?;
442            Ok(_response.lib)
443        }
444        self.client.send_query_and_decode::<LoaderGetRequest, Option<fidl::Vmo>>(
445            (name,),
446            0x73dbbfb62e99320a,
447            fidl::encoding::DynamicFlags::empty(),
448            _decode,
449        )
450    }
451
452    fn r#connect_to_manifest_fs(
453        &self,
454        mut options: ConnectToManifestOptions,
455        mut channel: fidl::Channel,
456    ) -> Result<(), fidl::Error> {
457        self.client.send::<LoaderConnectToManifestFsRequest>(
458            (options, channel),
459            0x454d855877881cc,
460            fidl::encoding::DynamicFlags::empty(),
461        )
462    }
463
464    fn r#connect_to_device_fs(&self, mut channel: fidl::Channel) -> Result<(), fidl::Error> {
465        self.client.send::<LoaderConnectToDeviceFsRequest>(
466            (channel,),
467            0x11cd633f2f5ff6d7,
468            fidl::encoding::DynamicFlags::empty(),
469        )
470    }
471
472    type GetSupportedFeaturesResponseFut =
473        fidl::client::QueryResponseFut<Features, fidl::encoding::DefaultFuchsiaResourceDialect>;
474    fn r#get_supported_features(&self) -> Self::GetSupportedFeaturesResponseFut {
475        fn _decode(
476            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
477        ) -> Result<Features, fidl::Error> {
478            let _response = fidl::client::decode_transaction_body::<
479                LoaderGetSupportedFeaturesResponse,
480                fidl::encoding::DefaultFuchsiaResourceDialect,
481                0x381abfce172892bd,
482            >(_buf?)?;
483            Ok(_response.features)
484        }
485        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Features>(
486            (),
487            0x381abfce172892bd,
488            fidl::encoding::DynamicFlags::empty(),
489            _decode,
490        )
491    }
492
493    type GetVmexResourceResponseFut = fidl::client::QueryResponseFut<
494        LoaderGetVmexResourceResult,
495        fidl::encoding::DefaultFuchsiaResourceDialect,
496    >;
497    fn r#get_vmex_resource(&self) -> Self::GetVmexResourceResponseFut {
498        fn _decode(
499            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
500        ) -> Result<LoaderGetVmexResourceResult, fidl::Error> {
501            let _response = fidl::client::decode_transaction_body::<
502                fidl::encoding::ResultType<LoaderGetVmexResourceResponse, GetVmexResourceError>,
503                fidl::encoding::DefaultFuchsiaResourceDialect,
504                0x71aea090ffef259b,
505            >(_buf?)?;
506            Ok(_response.map(|x| x.resource))
507        }
508        self.client
509            .send_query_and_decode::<fidl::encoding::EmptyPayload, LoaderGetVmexResourceResult>(
510                (),
511                0x71aea090ffef259b,
512                fidl::encoding::DynamicFlags::empty(),
513                _decode,
514            )
515    }
516}
517
518pub struct LoaderEventStream {
519    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
520}
521
522impl std::marker::Unpin for LoaderEventStream {}
523
524impl futures::stream::FusedStream for LoaderEventStream {
525    fn is_terminated(&self) -> bool {
526        self.event_receiver.is_terminated()
527    }
528}
529
530impl futures::Stream for LoaderEventStream {
531    type Item = Result<LoaderEvent, fidl::Error>;
532
533    fn poll_next(
534        mut self: std::pin::Pin<&mut Self>,
535        cx: &mut std::task::Context<'_>,
536    ) -> std::task::Poll<Option<Self::Item>> {
537        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
538            &mut self.event_receiver,
539            cx
540        )?) {
541            Some(buf) => std::task::Poll::Ready(Some(LoaderEvent::decode(buf))),
542            None => std::task::Poll::Ready(None),
543        }
544    }
545}
546
547#[derive(Debug)]
548pub enum LoaderEvent {}
549
550impl LoaderEvent {
551    /// Decodes a message buffer as a [`LoaderEvent`].
552    fn decode(
553        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
554    ) -> Result<LoaderEvent, fidl::Error> {
555        let (bytes, _handles) = buf.split_mut();
556        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
557        debug_assert_eq!(tx_header.tx_id, 0);
558        match tx_header.ordinal {
559            _ => Err(fidl::Error::UnknownOrdinal {
560                ordinal: tx_header.ordinal,
561                protocol_name: <LoaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
562            }),
563        }
564    }
565}
566
567/// A Stream of incoming requests for fuchsia.vulkan.loader/Loader.
568pub struct LoaderRequestStream {
569    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
570    is_terminated: bool,
571}
572
573impl std::marker::Unpin for LoaderRequestStream {}
574
575impl futures::stream::FusedStream for LoaderRequestStream {
576    fn is_terminated(&self) -> bool {
577        self.is_terminated
578    }
579}
580
581impl fidl::endpoints::RequestStream for LoaderRequestStream {
582    type Protocol = LoaderMarker;
583    type ControlHandle = LoaderControlHandle;
584
585    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
586        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
587    }
588
589    fn control_handle(&self) -> Self::ControlHandle {
590        LoaderControlHandle { inner: self.inner.clone() }
591    }
592
593    fn into_inner(
594        self,
595    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
596    {
597        (self.inner, self.is_terminated)
598    }
599
600    fn from_inner(
601        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
602        is_terminated: bool,
603    ) -> Self {
604        Self { inner, is_terminated }
605    }
606}
607
608impl futures::Stream for LoaderRequestStream {
609    type Item = Result<LoaderRequest, fidl::Error>;
610
611    fn poll_next(
612        mut self: std::pin::Pin<&mut Self>,
613        cx: &mut std::task::Context<'_>,
614    ) -> std::task::Poll<Option<Self::Item>> {
615        let this = &mut *self;
616        if this.inner.check_shutdown(cx) {
617            this.is_terminated = true;
618            return std::task::Poll::Ready(None);
619        }
620        if this.is_terminated {
621            panic!("polled LoaderRequestStream after completion");
622        }
623        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
624            |bytes, handles| {
625                match this.inner.channel().read_etc(cx, bytes, handles) {
626                    std::task::Poll::Ready(Ok(())) => {}
627                    std::task::Poll::Pending => return std::task::Poll::Pending,
628                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
629                        this.is_terminated = true;
630                        return std::task::Poll::Ready(None);
631                    }
632                    std::task::Poll::Ready(Err(e)) => {
633                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
634                            e.into(),
635                        ))))
636                    }
637                }
638
639                // A message has been received from the channel
640                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
641
642                std::task::Poll::Ready(Some(match header.ordinal {
643                    0x73dbbfb62e99320a => {
644                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
645                        let mut req = fidl::new_empty!(
646                            LoaderGetRequest,
647                            fidl::encoding::DefaultFuchsiaResourceDialect
648                        );
649                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LoaderGetRequest>(&header, _body_bytes, handles, &mut req)?;
650                        let control_handle = LoaderControlHandle { inner: this.inner.clone() };
651                        Ok(LoaderRequest::Get {
652                            name: req.name,
653
654                            responder: LoaderGetResponder {
655                                control_handle: std::mem::ManuallyDrop::new(control_handle),
656                                tx_id: header.tx_id,
657                            },
658                        })
659                    }
660                    0x454d855877881cc => {
661                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
662                        let mut req = fidl::new_empty!(
663                            LoaderConnectToManifestFsRequest,
664                            fidl::encoding::DefaultFuchsiaResourceDialect
665                        );
666                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LoaderConnectToManifestFsRequest>(&header, _body_bytes, handles, &mut req)?;
667                        let control_handle = LoaderControlHandle { inner: this.inner.clone() };
668                        Ok(LoaderRequest::ConnectToManifestFs {
669                            options: req.options,
670                            channel: req.channel,
671
672                            control_handle,
673                        })
674                    }
675                    0x11cd633f2f5ff6d7 => {
676                        header.validate_request_tx_id(fidl::MethodType::OneWay)?;
677                        let mut req = fidl::new_empty!(
678                            LoaderConnectToDeviceFsRequest,
679                            fidl::encoding::DefaultFuchsiaResourceDialect
680                        );
681                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<LoaderConnectToDeviceFsRequest>(&header, _body_bytes, handles, &mut req)?;
682                        let control_handle = LoaderControlHandle { inner: this.inner.clone() };
683                        Ok(LoaderRequest::ConnectToDeviceFs {
684                            channel: req.channel,
685
686                            control_handle,
687                        })
688                    }
689                    0x381abfce172892bd => {
690                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
691                        let mut req = fidl::new_empty!(
692                            fidl::encoding::EmptyPayload,
693                            fidl::encoding::DefaultFuchsiaResourceDialect
694                        );
695                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
696                        let control_handle = LoaderControlHandle { inner: this.inner.clone() };
697                        Ok(LoaderRequest::GetSupportedFeatures {
698                            responder: LoaderGetSupportedFeaturesResponder {
699                                control_handle: std::mem::ManuallyDrop::new(control_handle),
700                                tx_id: header.tx_id,
701                            },
702                        })
703                    }
704                    0x71aea090ffef259b => {
705                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
706                        let mut req = fidl::new_empty!(
707                            fidl::encoding::EmptyPayload,
708                            fidl::encoding::DefaultFuchsiaResourceDialect
709                        );
710                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
711                        let control_handle = LoaderControlHandle { inner: this.inner.clone() };
712                        Ok(LoaderRequest::GetVmexResource {
713                            responder: LoaderGetVmexResourceResponder {
714                                control_handle: std::mem::ManuallyDrop::new(control_handle),
715                                tx_id: header.tx_id,
716                            },
717                        })
718                    }
719                    _ => Err(fidl::Error::UnknownOrdinal {
720                        ordinal: header.ordinal,
721                        protocol_name:
722                            <LoaderMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
723                    }),
724                }))
725            },
726        )
727    }
728}
729
730/// Service to provide Vulkan libraries to the loader.
731#[derive(Debug)]
732pub enum LoaderRequest {
733    /// Requests a client driver library with the given name from the Vulkan loader
734    /// service. Returns a VMO suitable for loading as a dynamic library on
735    /// success, a null handle on failure.
736    Get { name: String, responder: LoaderGetResponder },
737    /// Connects to a FS serving fuchsia.io containing all Vulkan ICD manifests.
738    /// See
739    /// <https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#icd-manifest-file-format>
740    /// for a description of the manifest file format.  Manifests will always
741    /// appear in this directory after the relevant device appears in
742    /// `ConnectToDeviceFs()`.
743    ConnectToManifestFs {
744        options: ConnectToManifestOptions,
745        channel: fidl::Channel,
746        control_handle: LoaderControlHandle,
747    },
748    /// Connects to a FS serving fuchsia.io containing all device nodes
749    /// potentially relevant to ICDs.  /dev/<devname> will be served under
750    /// <devname> in this directory.
751    ConnectToDeviceFs { channel: fidl::Channel, control_handle: LoaderControlHandle },
752    /// Returns the set of features the loader service supports.
753    GetSupportedFeatures { responder: LoaderGetSupportedFeaturesResponder },
754    /// Returns a VmexResource that can be used by Lavapipe to JIT-compile code in the client
755    /// process, or an error.
756    GetVmexResource { responder: LoaderGetVmexResourceResponder },
757}
758
759impl LoaderRequest {
760    #[allow(irrefutable_let_patterns)]
761    pub fn into_get(self) -> Option<(String, LoaderGetResponder)> {
762        if let LoaderRequest::Get { name, responder } = self {
763            Some((name, responder))
764        } else {
765            None
766        }
767    }
768
769    #[allow(irrefutable_let_patterns)]
770    pub fn into_connect_to_manifest_fs(
771        self,
772    ) -> Option<(ConnectToManifestOptions, fidl::Channel, LoaderControlHandle)> {
773        if let LoaderRequest::ConnectToManifestFs { options, channel, control_handle } = self {
774            Some((options, channel, control_handle))
775        } else {
776            None
777        }
778    }
779
780    #[allow(irrefutable_let_patterns)]
781    pub fn into_connect_to_device_fs(self) -> Option<(fidl::Channel, LoaderControlHandle)> {
782        if let LoaderRequest::ConnectToDeviceFs { channel, control_handle } = self {
783            Some((channel, control_handle))
784        } else {
785            None
786        }
787    }
788
789    #[allow(irrefutable_let_patterns)]
790    pub fn into_get_supported_features(self) -> Option<(LoaderGetSupportedFeaturesResponder)> {
791        if let LoaderRequest::GetSupportedFeatures { responder } = self {
792            Some((responder))
793        } else {
794            None
795        }
796    }
797
798    #[allow(irrefutable_let_patterns)]
799    pub fn into_get_vmex_resource(self) -> Option<(LoaderGetVmexResourceResponder)> {
800        if let LoaderRequest::GetVmexResource { responder } = self {
801            Some((responder))
802        } else {
803            None
804        }
805    }
806
807    /// Name of the method defined in FIDL
808    pub fn method_name(&self) -> &'static str {
809        match *self {
810            LoaderRequest::Get { .. } => "get",
811            LoaderRequest::ConnectToManifestFs { .. } => "connect_to_manifest_fs",
812            LoaderRequest::ConnectToDeviceFs { .. } => "connect_to_device_fs",
813            LoaderRequest::GetSupportedFeatures { .. } => "get_supported_features",
814            LoaderRequest::GetVmexResource { .. } => "get_vmex_resource",
815        }
816    }
817}
818
819#[derive(Debug, Clone)]
820pub struct LoaderControlHandle {
821    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
822}
823
824impl fidl::endpoints::ControlHandle for LoaderControlHandle {
825    fn shutdown(&self) {
826        self.inner.shutdown()
827    }
828    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
829        self.inner.shutdown_with_epitaph(status)
830    }
831
832    fn is_closed(&self) -> bool {
833        self.inner.channel().is_closed()
834    }
835    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
836        self.inner.channel().on_closed()
837    }
838
839    #[cfg(target_os = "fuchsia")]
840    fn signal_peer(
841        &self,
842        clear_mask: zx::Signals,
843        set_mask: zx::Signals,
844    ) -> Result<(), zx_status::Status> {
845        use fidl::Peered;
846        self.inner.channel().signal_peer(clear_mask, set_mask)
847    }
848}
849
850impl LoaderControlHandle {}
851
852#[must_use = "FIDL methods require a response to be sent"]
853#[derive(Debug)]
854pub struct LoaderGetResponder {
855    control_handle: std::mem::ManuallyDrop<LoaderControlHandle>,
856    tx_id: u32,
857}
858
859/// Set the the channel to be shutdown (see [`LoaderControlHandle::shutdown`])
860/// if the responder is dropped without sending a response, so that the client
861/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
862impl std::ops::Drop for LoaderGetResponder {
863    fn drop(&mut self) {
864        self.control_handle.shutdown();
865        // Safety: drops once, never accessed again
866        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
867    }
868}
869
870impl fidl::endpoints::Responder for LoaderGetResponder {
871    type ControlHandle = LoaderControlHandle;
872
873    fn control_handle(&self) -> &LoaderControlHandle {
874        &self.control_handle
875    }
876
877    fn drop_without_shutdown(mut self) {
878        // Safety: drops once, never accessed again due to mem::forget
879        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
880        // Prevent Drop from running (which would shut down the channel)
881        std::mem::forget(self);
882    }
883}
884
885impl LoaderGetResponder {
886    /// Sends a response to the FIDL transaction.
887    ///
888    /// Sets the channel to shutdown if an error occurs.
889    pub fn send(self, mut lib: Option<fidl::Vmo>) -> Result<(), fidl::Error> {
890        let _result = self.send_raw(lib);
891        if _result.is_err() {
892            self.control_handle.shutdown();
893        }
894        self.drop_without_shutdown();
895        _result
896    }
897
898    /// Similar to "send" but does not shutdown the channel if an error occurs.
899    pub fn send_no_shutdown_on_err(self, mut lib: Option<fidl::Vmo>) -> Result<(), fidl::Error> {
900        let _result = self.send_raw(lib);
901        self.drop_without_shutdown();
902        _result
903    }
904
905    fn send_raw(&self, mut lib: Option<fidl::Vmo>) -> Result<(), fidl::Error> {
906        self.control_handle.inner.send::<LoaderGetResponse>(
907            (lib,),
908            self.tx_id,
909            0x73dbbfb62e99320a,
910            fidl::encoding::DynamicFlags::empty(),
911        )
912    }
913}
914
915#[must_use = "FIDL methods require a response to be sent"]
916#[derive(Debug)]
917pub struct LoaderGetSupportedFeaturesResponder {
918    control_handle: std::mem::ManuallyDrop<LoaderControlHandle>,
919    tx_id: u32,
920}
921
922/// Set the the channel to be shutdown (see [`LoaderControlHandle::shutdown`])
923/// if the responder is dropped without sending a response, so that the client
924/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
925impl std::ops::Drop for LoaderGetSupportedFeaturesResponder {
926    fn drop(&mut self) {
927        self.control_handle.shutdown();
928        // Safety: drops once, never accessed again
929        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
930    }
931}
932
933impl fidl::endpoints::Responder for LoaderGetSupportedFeaturesResponder {
934    type ControlHandle = LoaderControlHandle;
935
936    fn control_handle(&self) -> &LoaderControlHandle {
937        &self.control_handle
938    }
939
940    fn drop_without_shutdown(mut self) {
941        // Safety: drops once, never accessed again due to mem::forget
942        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
943        // Prevent Drop from running (which would shut down the channel)
944        std::mem::forget(self);
945    }
946}
947
948impl LoaderGetSupportedFeaturesResponder {
949    /// Sends a response to the FIDL transaction.
950    ///
951    /// Sets the channel to shutdown if an error occurs.
952    pub fn send(self, mut features: Features) -> Result<(), fidl::Error> {
953        let _result = self.send_raw(features);
954        if _result.is_err() {
955            self.control_handle.shutdown();
956        }
957        self.drop_without_shutdown();
958        _result
959    }
960
961    /// Similar to "send" but does not shutdown the channel if an error occurs.
962    pub fn send_no_shutdown_on_err(self, mut features: Features) -> Result<(), fidl::Error> {
963        let _result = self.send_raw(features);
964        self.drop_without_shutdown();
965        _result
966    }
967
968    fn send_raw(&self, mut features: Features) -> Result<(), fidl::Error> {
969        self.control_handle.inner.send::<LoaderGetSupportedFeaturesResponse>(
970            (features,),
971            self.tx_id,
972            0x381abfce172892bd,
973            fidl::encoding::DynamicFlags::empty(),
974        )
975    }
976}
977
978#[must_use = "FIDL methods require a response to be sent"]
979#[derive(Debug)]
980pub struct LoaderGetVmexResourceResponder {
981    control_handle: std::mem::ManuallyDrop<LoaderControlHandle>,
982    tx_id: u32,
983}
984
985/// Set the the channel to be shutdown (see [`LoaderControlHandle::shutdown`])
986/// if the responder is dropped without sending a response, so that the client
987/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
988impl std::ops::Drop for LoaderGetVmexResourceResponder {
989    fn drop(&mut self) {
990        self.control_handle.shutdown();
991        // Safety: drops once, never accessed again
992        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
993    }
994}
995
996impl fidl::endpoints::Responder for LoaderGetVmexResourceResponder {
997    type ControlHandle = LoaderControlHandle;
998
999    fn control_handle(&self) -> &LoaderControlHandle {
1000        &self.control_handle
1001    }
1002
1003    fn drop_without_shutdown(mut self) {
1004        // Safety: drops once, never accessed again due to mem::forget
1005        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1006        // Prevent Drop from running (which would shut down the channel)
1007        std::mem::forget(self);
1008    }
1009}
1010
1011impl LoaderGetVmexResourceResponder {
1012    /// Sends a response to the FIDL transaction.
1013    ///
1014    /// Sets the channel to shutdown if an error occurs.
1015    pub fn send(
1016        self,
1017        mut result: Result<fidl::Resource, GetVmexResourceError>,
1018    ) -> Result<(), fidl::Error> {
1019        let _result = self.send_raw(result);
1020        if _result.is_err() {
1021            self.control_handle.shutdown();
1022        }
1023        self.drop_without_shutdown();
1024        _result
1025    }
1026
1027    /// Similar to "send" but does not shutdown the channel if an error occurs.
1028    pub fn send_no_shutdown_on_err(
1029        self,
1030        mut result: Result<fidl::Resource, GetVmexResourceError>,
1031    ) -> Result<(), fidl::Error> {
1032        let _result = self.send_raw(result);
1033        self.drop_without_shutdown();
1034        _result
1035    }
1036
1037    fn send_raw(
1038        &self,
1039        mut result: Result<fidl::Resource, GetVmexResourceError>,
1040    ) -> Result<(), fidl::Error> {
1041        self.control_handle.inner.send::<fidl::encoding::ResultType<
1042            LoaderGetVmexResourceResponse,
1043            GetVmexResourceError,
1044        >>(
1045            result.map(|resource| (resource,)),
1046            self.tx_id,
1047            0x71aea090ffef259b,
1048            fidl::encoding::DynamicFlags::empty(),
1049        )
1050    }
1051}
1052
1053mod internal {
1054    use super::*;
1055    unsafe impl fidl::encoding::TypeMarker for ConnectToManifestOptions {
1056        type Owned = Self;
1057
1058        #[inline(always)]
1059        fn inline_align(_context: fidl::encoding::Context) -> usize {
1060            4
1061        }
1062
1063        #[inline(always)]
1064        fn inline_size(_context: fidl::encoding::Context) -> usize {
1065            4
1066        }
1067    }
1068
1069    impl fidl::encoding::ValueTypeMarker for ConnectToManifestOptions {
1070        type Borrowed<'a> = Self;
1071        #[inline(always)]
1072        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1073            *value
1074        }
1075    }
1076
1077    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1078        for ConnectToManifestOptions
1079    {
1080        #[inline]
1081        unsafe fn encode(
1082            self,
1083            encoder: &mut fidl::encoding::Encoder<'_, D>,
1084            offset: usize,
1085            _depth: fidl::encoding::Depth,
1086        ) -> fidl::Result<()> {
1087            encoder.debug_check_bounds::<Self>(offset);
1088            encoder.write_num(self.bits(), offset);
1089            Ok(())
1090        }
1091    }
1092
1093    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1094        for ConnectToManifestOptions
1095    {
1096        #[inline(always)]
1097        fn new_empty() -> Self {
1098            Self::empty()
1099        }
1100
1101        #[inline]
1102        unsafe fn decode(
1103            &mut self,
1104            decoder: &mut fidl::encoding::Decoder<'_, D>,
1105            offset: usize,
1106            _depth: fidl::encoding::Depth,
1107        ) -> fidl::Result<()> {
1108            decoder.debug_check_bounds::<Self>(offset);
1109            let prim = decoder.read_num::<u32>(offset);
1110            *self = Self::from_bits_allow_unknown(prim);
1111            Ok(())
1112        }
1113    }
1114    unsafe impl fidl::encoding::TypeMarker for Features {
1115        type Owned = Self;
1116
1117        #[inline(always)]
1118        fn inline_align(_context: fidl::encoding::Context) -> usize {
1119            4
1120        }
1121
1122        #[inline(always)]
1123        fn inline_size(_context: fidl::encoding::Context) -> usize {
1124            4
1125        }
1126    }
1127
1128    impl fidl::encoding::ValueTypeMarker for Features {
1129        type Borrowed<'a> = Self;
1130        #[inline(always)]
1131        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1132            *value
1133        }
1134    }
1135
1136    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Features {
1137        #[inline]
1138        unsafe fn encode(
1139            self,
1140            encoder: &mut fidl::encoding::Encoder<'_, D>,
1141            offset: usize,
1142            _depth: fidl::encoding::Depth,
1143        ) -> fidl::Result<()> {
1144            encoder.debug_check_bounds::<Self>(offset);
1145            encoder.write_num(self.bits(), offset);
1146            Ok(())
1147        }
1148    }
1149
1150    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Features {
1151        #[inline(always)]
1152        fn new_empty() -> Self {
1153            Self::empty()
1154        }
1155
1156        #[inline]
1157        unsafe fn decode(
1158            &mut self,
1159            decoder: &mut fidl::encoding::Decoder<'_, D>,
1160            offset: usize,
1161            _depth: fidl::encoding::Depth,
1162        ) -> fidl::Result<()> {
1163            decoder.debug_check_bounds::<Self>(offset);
1164            let prim = decoder.read_num::<u32>(offset);
1165            *self = Self::from_bits_allow_unknown(prim);
1166            Ok(())
1167        }
1168    }
1169    unsafe impl fidl::encoding::TypeMarker for GetVmexResourceError {
1170        type Owned = Self;
1171
1172        #[inline(always)]
1173        fn inline_align(_context: fidl::encoding::Context) -> usize {
1174            std::mem::align_of::<u32>()
1175        }
1176
1177        #[inline(always)]
1178        fn inline_size(_context: fidl::encoding::Context) -> usize {
1179            std::mem::size_of::<u32>()
1180        }
1181
1182        #[inline(always)]
1183        fn encode_is_copy() -> bool {
1184            false
1185        }
1186
1187        #[inline(always)]
1188        fn decode_is_copy() -> bool {
1189            false
1190        }
1191    }
1192
1193    impl fidl::encoding::ValueTypeMarker for GetVmexResourceError {
1194        type Borrowed<'a> = Self;
1195        #[inline(always)]
1196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1197            *value
1198        }
1199    }
1200
1201    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1202        for GetVmexResourceError
1203    {
1204        #[inline]
1205        unsafe fn encode(
1206            self,
1207            encoder: &mut fidl::encoding::Encoder<'_, D>,
1208            offset: usize,
1209            _depth: fidl::encoding::Depth,
1210        ) -> fidl::Result<()> {
1211            encoder.debug_check_bounds::<Self>(offset);
1212            encoder.write_num(self.into_primitive(), offset);
1213            Ok(())
1214        }
1215    }
1216
1217    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetVmexResourceError {
1218        #[inline(always)]
1219        fn new_empty() -> Self {
1220            Self::unknown()
1221        }
1222
1223        #[inline]
1224        unsafe fn decode(
1225            &mut self,
1226            decoder: &mut fidl::encoding::Decoder<'_, D>,
1227            offset: usize,
1228            _depth: fidl::encoding::Depth,
1229        ) -> fidl::Result<()> {
1230            decoder.debug_check_bounds::<Self>(offset);
1231            let prim = decoder.read_num::<u32>(offset);
1232
1233            *self = Self::from_primitive_allow_unknown(prim);
1234            Ok(())
1235        }
1236    }
1237
1238    impl fidl::encoding::ResourceTypeMarker for LoaderConnectToDeviceFsRequest {
1239        type Borrowed<'a> = &'a mut Self;
1240        fn take_or_borrow<'a>(
1241            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1242        ) -> Self::Borrowed<'a> {
1243            value
1244        }
1245    }
1246
1247    unsafe impl fidl::encoding::TypeMarker for LoaderConnectToDeviceFsRequest {
1248        type Owned = Self;
1249
1250        #[inline(always)]
1251        fn inline_align(_context: fidl::encoding::Context) -> usize {
1252            4
1253        }
1254
1255        #[inline(always)]
1256        fn inline_size(_context: fidl::encoding::Context) -> usize {
1257            4
1258        }
1259    }
1260
1261    unsafe impl
1262        fidl::encoding::Encode<
1263            LoaderConnectToDeviceFsRequest,
1264            fidl::encoding::DefaultFuchsiaResourceDialect,
1265        > for &mut LoaderConnectToDeviceFsRequest
1266    {
1267        #[inline]
1268        unsafe fn encode(
1269            self,
1270            encoder: &mut fidl::encoding::Encoder<
1271                '_,
1272                fidl::encoding::DefaultFuchsiaResourceDialect,
1273            >,
1274            offset: usize,
1275            _depth: fidl::encoding::Depth,
1276        ) -> fidl::Result<()> {
1277            encoder.debug_check_bounds::<LoaderConnectToDeviceFsRequest>(offset);
1278            // Delegate to tuple encoding.
1279            fidl::encoding::Encode::<
1280                LoaderConnectToDeviceFsRequest,
1281                fidl::encoding::DefaultFuchsiaResourceDialect,
1282            >::encode(
1283                (<fidl::encoding::HandleType<
1284                    fidl::Channel,
1285                    { fidl::ObjectType::CHANNEL.into_raw() },
1286                    2147483648,
1287                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1288                    &mut self.channel
1289                ),),
1290                encoder,
1291                offset,
1292                _depth,
1293            )
1294        }
1295    }
1296    unsafe impl<
1297            T0: fidl::encoding::Encode<
1298                fidl::encoding::HandleType<
1299                    fidl::Channel,
1300                    { fidl::ObjectType::CHANNEL.into_raw() },
1301                    2147483648,
1302                >,
1303                fidl::encoding::DefaultFuchsiaResourceDialect,
1304            >,
1305        >
1306        fidl::encoding::Encode<
1307            LoaderConnectToDeviceFsRequest,
1308            fidl::encoding::DefaultFuchsiaResourceDialect,
1309        > for (T0,)
1310    {
1311        #[inline]
1312        unsafe fn encode(
1313            self,
1314            encoder: &mut fidl::encoding::Encoder<
1315                '_,
1316                fidl::encoding::DefaultFuchsiaResourceDialect,
1317            >,
1318            offset: usize,
1319            depth: fidl::encoding::Depth,
1320        ) -> fidl::Result<()> {
1321            encoder.debug_check_bounds::<LoaderConnectToDeviceFsRequest>(offset);
1322            // Zero out padding regions. There's no need to apply masks
1323            // because the unmasked parts will be overwritten by fields.
1324            // Write the fields.
1325            self.0.encode(encoder, offset + 0, depth)?;
1326            Ok(())
1327        }
1328    }
1329
1330    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1331        for LoaderConnectToDeviceFsRequest
1332    {
1333        #[inline(always)]
1334        fn new_empty() -> Self {
1335            Self {
1336                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1337            }
1338        }
1339
1340        #[inline]
1341        unsafe fn decode(
1342            &mut self,
1343            decoder: &mut fidl::encoding::Decoder<
1344                '_,
1345                fidl::encoding::DefaultFuchsiaResourceDialect,
1346            >,
1347            offset: usize,
1348            _depth: fidl::encoding::Depth,
1349        ) -> fidl::Result<()> {
1350            decoder.debug_check_bounds::<Self>(offset);
1351            // Verify that padding bytes are zero.
1352            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 0, _depth)?;
1353            Ok(())
1354        }
1355    }
1356
1357    impl fidl::encoding::ResourceTypeMarker for LoaderConnectToManifestFsRequest {
1358        type Borrowed<'a> = &'a mut Self;
1359        fn take_or_borrow<'a>(
1360            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1361        ) -> Self::Borrowed<'a> {
1362            value
1363        }
1364    }
1365
1366    unsafe impl fidl::encoding::TypeMarker for LoaderConnectToManifestFsRequest {
1367        type Owned = Self;
1368
1369        #[inline(always)]
1370        fn inline_align(_context: fidl::encoding::Context) -> usize {
1371            4
1372        }
1373
1374        #[inline(always)]
1375        fn inline_size(_context: fidl::encoding::Context) -> usize {
1376            8
1377        }
1378    }
1379
1380    unsafe impl
1381        fidl::encoding::Encode<
1382            LoaderConnectToManifestFsRequest,
1383            fidl::encoding::DefaultFuchsiaResourceDialect,
1384        > for &mut LoaderConnectToManifestFsRequest
1385    {
1386        #[inline]
1387        unsafe fn encode(
1388            self,
1389            encoder: &mut fidl::encoding::Encoder<
1390                '_,
1391                fidl::encoding::DefaultFuchsiaResourceDialect,
1392            >,
1393            offset: usize,
1394            _depth: fidl::encoding::Depth,
1395        ) -> fidl::Result<()> {
1396            encoder.debug_check_bounds::<LoaderConnectToManifestFsRequest>(offset);
1397            // Delegate to tuple encoding.
1398            fidl::encoding::Encode::<
1399                LoaderConnectToManifestFsRequest,
1400                fidl::encoding::DefaultFuchsiaResourceDialect,
1401            >::encode(
1402                (
1403                    <ConnectToManifestOptions as fidl::encoding::ValueTypeMarker>::borrow(
1404                        &self.options,
1405                    ),
1406                    <fidl::encoding::HandleType<
1407                        fidl::Channel,
1408                        { fidl::ObjectType::CHANNEL.into_raw() },
1409                        2147483648,
1410                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1411                        &mut self.channel
1412                    ),
1413                ),
1414                encoder,
1415                offset,
1416                _depth,
1417            )
1418        }
1419    }
1420    unsafe impl<
1421            T0: fidl::encoding::Encode<
1422                ConnectToManifestOptions,
1423                fidl::encoding::DefaultFuchsiaResourceDialect,
1424            >,
1425            T1: fidl::encoding::Encode<
1426                fidl::encoding::HandleType<
1427                    fidl::Channel,
1428                    { fidl::ObjectType::CHANNEL.into_raw() },
1429                    2147483648,
1430                >,
1431                fidl::encoding::DefaultFuchsiaResourceDialect,
1432            >,
1433        >
1434        fidl::encoding::Encode<
1435            LoaderConnectToManifestFsRequest,
1436            fidl::encoding::DefaultFuchsiaResourceDialect,
1437        > for (T0, T1)
1438    {
1439        #[inline]
1440        unsafe fn encode(
1441            self,
1442            encoder: &mut fidl::encoding::Encoder<
1443                '_,
1444                fidl::encoding::DefaultFuchsiaResourceDialect,
1445            >,
1446            offset: usize,
1447            depth: fidl::encoding::Depth,
1448        ) -> fidl::Result<()> {
1449            encoder.debug_check_bounds::<LoaderConnectToManifestFsRequest>(offset);
1450            // Zero out padding regions. There's no need to apply masks
1451            // because the unmasked parts will be overwritten by fields.
1452            // Write the fields.
1453            self.0.encode(encoder, offset + 0, depth)?;
1454            self.1.encode(encoder, offset + 4, depth)?;
1455            Ok(())
1456        }
1457    }
1458
1459    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1460        for LoaderConnectToManifestFsRequest
1461    {
1462        #[inline(always)]
1463        fn new_empty() -> Self {
1464            Self {
1465                options: fidl::new_empty!(
1466                    ConnectToManifestOptions,
1467                    fidl::encoding::DefaultFuchsiaResourceDialect
1468                ),
1469                channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1470            }
1471        }
1472
1473        #[inline]
1474        unsafe fn decode(
1475            &mut self,
1476            decoder: &mut fidl::encoding::Decoder<
1477                '_,
1478                fidl::encoding::DefaultFuchsiaResourceDialect,
1479            >,
1480            offset: usize,
1481            _depth: fidl::encoding::Depth,
1482        ) -> fidl::Result<()> {
1483            decoder.debug_check_bounds::<Self>(offset);
1484            // Verify that padding bytes are zero.
1485            fidl::decode!(
1486                ConnectToManifestOptions,
1487                fidl::encoding::DefaultFuchsiaResourceDialect,
1488                &mut self.options,
1489                decoder,
1490                offset + 0,
1491                _depth
1492            )?;
1493            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.channel, decoder, offset + 4, _depth)?;
1494            Ok(())
1495        }
1496    }
1497
1498    impl fidl::encoding::ValueTypeMarker for LoaderGetRequest {
1499        type Borrowed<'a> = &'a Self;
1500        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1501            value
1502        }
1503    }
1504
1505    unsafe impl fidl::encoding::TypeMarker for LoaderGetRequest {
1506        type Owned = Self;
1507
1508        #[inline(always)]
1509        fn inline_align(_context: fidl::encoding::Context) -> usize {
1510            8
1511        }
1512
1513        #[inline(always)]
1514        fn inline_size(_context: fidl::encoding::Context) -> usize {
1515            16
1516        }
1517    }
1518
1519    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LoaderGetRequest, D>
1520        for &LoaderGetRequest
1521    {
1522        #[inline]
1523        unsafe fn encode(
1524            self,
1525            encoder: &mut fidl::encoding::Encoder<'_, D>,
1526            offset: usize,
1527            _depth: fidl::encoding::Depth,
1528        ) -> fidl::Result<()> {
1529            encoder.debug_check_bounds::<LoaderGetRequest>(offset);
1530            // Delegate to tuple encoding.
1531            fidl::encoding::Encode::<LoaderGetRequest, D>::encode(
1532                (<fidl::encoding::BoundedString<64> as fidl::encoding::ValueTypeMarker>::borrow(
1533                    &self.name,
1534                ),),
1535                encoder,
1536                offset,
1537                _depth,
1538            )
1539        }
1540    }
1541    unsafe impl<
1542            D: fidl::encoding::ResourceDialect,
1543            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<64>, D>,
1544        > fidl::encoding::Encode<LoaderGetRequest, D> for (T0,)
1545    {
1546        #[inline]
1547        unsafe fn encode(
1548            self,
1549            encoder: &mut fidl::encoding::Encoder<'_, D>,
1550            offset: usize,
1551            depth: fidl::encoding::Depth,
1552        ) -> fidl::Result<()> {
1553            encoder.debug_check_bounds::<LoaderGetRequest>(offset);
1554            // Zero out padding regions. There's no need to apply masks
1555            // because the unmasked parts will be overwritten by fields.
1556            // Write the fields.
1557            self.0.encode(encoder, offset + 0, depth)?;
1558            Ok(())
1559        }
1560    }
1561
1562    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LoaderGetRequest {
1563        #[inline(always)]
1564        fn new_empty() -> Self {
1565            Self { name: fidl::new_empty!(fidl::encoding::BoundedString<64>, D) }
1566        }
1567
1568        #[inline]
1569        unsafe fn decode(
1570            &mut self,
1571            decoder: &mut fidl::encoding::Decoder<'_, D>,
1572            offset: usize,
1573            _depth: fidl::encoding::Depth,
1574        ) -> fidl::Result<()> {
1575            decoder.debug_check_bounds::<Self>(offset);
1576            // Verify that padding bytes are zero.
1577            fidl::decode!(
1578                fidl::encoding::BoundedString<64>,
1579                D,
1580                &mut self.name,
1581                decoder,
1582                offset + 0,
1583                _depth
1584            )?;
1585            Ok(())
1586        }
1587    }
1588
1589    impl fidl::encoding::ResourceTypeMarker for LoaderGetResponse {
1590        type Borrowed<'a> = &'a mut Self;
1591        fn take_or_borrow<'a>(
1592            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1593        ) -> Self::Borrowed<'a> {
1594            value
1595        }
1596    }
1597
1598    unsafe impl fidl::encoding::TypeMarker for LoaderGetResponse {
1599        type Owned = Self;
1600
1601        #[inline(always)]
1602        fn inline_align(_context: fidl::encoding::Context) -> usize {
1603            4
1604        }
1605
1606        #[inline(always)]
1607        fn inline_size(_context: fidl::encoding::Context) -> usize {
1608            4
1609        }
1610    }
1611
1612    unsafe impl
1613        fidl::encoding::Encode<LoaderGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
1614        for &mut LoaderGetResponse
1615    {
1616        #[inline]
1617        unsafe fn encode(
1618            self,
1619            encoder: &mut fidl::encoding::Encoder<
1620                '_,
1621                fidl::encoding::DefaultFuchsiaResourceDialect,
1622            >,
1623            offset: usize,
1624            _depth: fidl::encoding::Depth,
1625        ) -> fidl::Result<()> {
1626            encoder.debug_check_bounds::<LoaderGetResponse>(offset);
1627            // Delegate to tuple encoding.
1628            fidl::encoding::Encode::<LoaderGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
1629                (
1630                    <fidl::encoding::Optional<fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.lib),
1631                ),
1632                encoder, offset, _depth
1633            )
1634        }
1635    }
1636    unsafe impl<
1637            T0: fidl::encoding::Encode<
1638                fidl::encoding::Optional<
1639                    fidl::encoding::HandleType<
1640                        fidl::Vmo,
1641                        { fidl::ObjectType::VMO.into_raw() },
1642                        2147483648,
1643                    >,
1644                >,
1645                fidl::encoding::DefaultFuchsiaResourceDialect,
1646            >,
1647        >
1648        fidl::encoding::Encode<LoaderGetResponse, fidl::encoding::DefaultFuchsiaResourceDialect>
1649        for (T0,)
1650    {
1651        #[inline]
1652        unsafe fn encode(
1653            self,
1654            encoder: &mut fidl::encoding::Encoder<
1655                '_,
1656                fidl::encoding::DefaultFuchsiaResourceDialect,
1657            >,
1658            offset: usize,
1659            depth: fidl::encoding::Depth,
1660        ) -> fidl::Result<()> {
1661            encoder.debug_check_bounds::<LoaderGetResponse>(offset);
1662            // Zero out padding regions. There's no need to apply masks
1663            // because the unmasked parts will be overwritten by fields.
1664            // Write the fields.
1665            self.0.encode(encoder, offset + 0, depth)?;
1666            Ok(())
1667        }
1668    }
1669
1670    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1671        for LoaderGetResponse
1672    {
1673        #[inline(always)]
1674        fn new_empty() -> Self {
1675            Self {
1676                lib: fidl::new_empty!(
1677                    fidl::encoding::Optional<
1678                        fidl::encoding::HandleType<
1679                            fidl::Vmo,
1680                            { fidl::ObjectType::VMO.into_raw() },
1681                            2147483648,
1682                        >,
1683                    >,
1684                    fidl::encoding::DefaultFuchsiaResourceDialect
1685                ),
1686            }
1687        }
1688
1689        #[inline]
1690        unsafe fn decode(
1691            &mut self,
1692            decoder: &mut fidl::encoding::Decoder<
1693                '_,
1694                fidl::encoding::DefaultFuchsiaResourceDialect,
1695            >,
1696            offset: usize,
1697            _depth: fidl::encoding::Depth,
1698        ) -> fidl::Result<()> {
1699            decoder.debug_check_bounds::<Self>(offset);
1700            // Verify that padding bytes are zero.
1701            fidl::decode!(
1702                fidl::encoding::Optional<
1703                    fidl::encoding::HandleType<
1704                        fidl::Vmo,
1705                        { fidl::ObjectType::VMO.into_raw() },
1706                        2147483648,
1707                    >,
1708                >,
1709                fidl::encoding::DefaultFuchsiaResourceDialect,
1710                &mut self.lib,
1711                decoder,
1712                offset + 0,
1713                _depth
1714            )?;
1715            Ok(())
1716        }
1717    }
1718
1719    impl fidl::encoding::ValueTypeMarker for LoaderGetSupportedFeaturesResponse {
1720        type Borrowed<'a> = &'a Self;
1721        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1722            value
1723        }
1724    }
1725
1726    unsafe impl fidl::encoding::TypeMarker for LoaderGetSupportedFeaturesResponse {
1727        type Owned = Self;
1728
1729        #[inline(always)]
1730        fn inline_align(_context: fidl::encoding::Context) -> usize {
1731            4
1732        }
1733
1734        #[inline(always)]
1735        fn inline_size(_context: fidl::encoding::Context) -> usize {
1736            4
1737        }
1738    }
1739
1740    unsafe impl<D: fidl::encoding::ResourceDialect>
1741        fidl::encoding::Encode<LoaderGetSupportedFeaturesResponse, D>
1742        for &LoaderGetSupportedFeaturesResponse
1743    {
1744        #[inline]
1745        unsafe fn encode(
1746            self,
1747            encoder: &mut fidl::encoding::Encoder<'_, D>,
1748            offset: usize,
1749            _depth: fidl::encoding::Depth,
1750        ) -> fidl::Result<()> {
1751            encoder.debug_check_bounds::<LoaderGetSupportedFeaturesResponse>(offset);
1752            // Delegate to tuple encoding.
1753            fidl::encoding::Encode::<LoaderGetSupportedFeaturesResponse, D>::encode(
1754                (<Features as fidl::encoding::ValueTypeMarker>::borrow(&self.features),),
1755                encoder,
1756                offset,
1757                _depth,
1758            )
1759        }
1760    }
1761    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Features, D>>
1762        fidl::encoding::Encode<LoaderGetSupportedFeaturesResponse, D> for (T0,)
1763    {
1764        #[inline]
1765        unsafe fn encode(
1766            self,
1767            encoder: &mut fidl::encoding::Encoder<'_, D>,
1768            offset: usize,
1769            depth: fidl::encoding::Depth,
1770        ) -> fidl::Result<()> {
1771            encoder.debug_check_bounds::<LoaderGetSupportedFeaturesResponse>(offset);
1772            // Zero out padding regions. There's no need to apply masks
1773            // because the unmasked parts will be overwritten by fields.
1774            // Write the fields.
1775            self.0.encode(encoder, offset + 0, depth)?;
1776            Ok(())
1777        }
1778    }
1779
1780    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1781        for LoaderGetSupportedFeaturesResponse
1782    {
1783        #[inline(always)]
1784        fn new_empty() -> Self {
1785            Self { features: fidl::new_empty!(Features, D) }
1786        }
1787
1788        #[inline]
1789        unsafe fn decode(
1790            &mut self,
1791            decoder: &mut fidl::encoding::Decoder<'_, D>,
1792            offset: usize,
1793            _depth: fidl::encoding::Depth,
1794        ) -> fidl::Result<()> {
1795            decoder.debug_check_bounds::<Self>(offset);
1796            // Verify that padding bytes are zero.
1797            fidl::decode!(Features, D, &mut self.features, decoder, offset + 0, _depth)?;
1798            Ok(())
1799        }
1800    }
1801
1802    impl fidl::encoding::ResourceTypeMarker for LoaderGetVmexResourceResponse {
1803        type Borrowed<'a> = &'a mut Self;
1804        fn take_or_borrow<'a>(
1805            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
1806        ) -> Self::Borrowed<'a> {
1807            value
1808        }
1809    }
1810
1811    unsafe impl fidl::encoding::TypeMarker for LoaderGetVmexResourceResponse {
1812        type Owned = Self;
1813
1814        #[inline(always)]
1815        fn inline_align(_context: fidl::encoding::Context) -> usize {
1816            4
1817        }
1818
1819        #[inline(always)]
1820        fn inline_size(_context: fidl::encoding::Context) -> usize {
1821            4
1822        }
1823    }
1824
1825    unsafe impl
1826        fidl::encoding::Encode<
1827            LoaderGetVmexResourceResponse,
1828            fidl::encoding::DefaultFuchsiaResourceDialect,
1829        > for &mut LoaderGetVmexResourceResponse
1830    {
1831        #[inline]
1832        unsafe fn encode(
1833            self,
1834            encoder: &mut fidl::encoding::Encoder<
1835                '_,
1836                fidl::encoding::DefaultFuchsiaResourceDialect,
1837            >,
1838            offset: usize,
1839            _depth: fidl::encoding::Depth,
1840        ) -> fidl::Result<()> {
1841            encoder.debug_check_bounds::<LoaderGetVmexResourceResponse>(offset);
1842            // Delegate to tuple encoding.
1843            fidl::encoding::Encode::<
1844                LoaderGetVmexResourceResponse,
1845                fidl::encoding::DefaultFuchsiaResourceDialect,
1846            >::encode(
1847                (<fidl::encoding::HandleType<
1848                    fidl::Resource,
1849                    { fidl::ObjectType::RESOURCE.into_raw() },
1850                    2147483648,
1851                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
1852                    &mut self.resource
1853                ),),
1854                encoder,
1855                offset,
1856                _depth,
1857            )
1858        }
1859    }
1860    unsafe impl<
1861            T0: fidl::encoding::Encode<
1862                fidl::encoding::HandleType<
1863                    fidl::Resource,
1864                    { fidl::ObjectType::RESOURCE.into_raw() },
1865                    2147483648,
1866                >,
1867                fidl::encoding::DefaultFuchsiaResourceDialect,
1868            >,
1869        >
1870        fidl::encoding::Encode<
1871            LoaderGetVmexResourceResponse,
1872            fidl::encoding::DefaultFuchsiaResourceDialect,
1873        > for (T0,)
1874    {
1875        #[inline]
1876        unsafe fn encode(
1877            self,
1878            encoder: &mut fidl::encoding::Encoder<
1879                '_,
1880                fidl::encoding::DefaultFuchsiaResourceDialect,
1881            >,
1882            offset: usize,
1883            depth: fidl::encoding::Depth,
1884        ) -> fidl::Result<()> {
1885            encoder.debug_check_bounds::<LoaderGetVmexResourceResponse>(offset);
1886            // Zero out padding regions. There's no need to apply masks
1887            // because the unmasked parts will be overwritten by fields.
1888            // Write the fields.
1889            self.0.encode(encoder, offset + 0, depth)?;
1890            Ok(())
1891        }
1892    }
1893
1894    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
1895        for LoaderGetVmexResourceResponse
1896    {
1897        #[inline(always)]
1898        fn new_empty() -> Self {
1899            Self {
1900                resource: fidl::new_empty!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
1901            }
1902        }
1903
1904        #[inline]
1905        unsafe fn decode(
1906            &mut self,
1907            decoder: &mut fidl::encoding::Decoder<
1908                '_,
1909                fidl::encoding::DefaultFuchsiaResourceDialect,
1910            >,
1911            offset: usize,
1912            _depth: fidl::encoding::Depth,
1913        ) -> fidl::Result<()> {
1914            decoder.debug_check_bounds::<Self>(offset);
1915            // Verify that padding bytes are zero.
1916            fidl::decode!(fidl::encoding::HandleType<fidl::Resource, { fidl::ObjectType::RESOURCE.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.resource, decoder, offset + 0, _depth)?;
1917            Ok(())
1918        }
1919    }
1920}