fidl_fuchsia_compat_runtime__common/
fidl_fuchsia_compat_runtime__common.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::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct LeafGetStringResponse {
13    pub response: String,
14}
15
16impl fidl::Persistable for LeafGetStringResponse {}
17
18pub mod leaf_ordinals {
19    pub const GET_STRING: u64 = 0x2493c868aa35dd7;
20}
21
22mod internal {
23    use super::*;
24
25    impl fidl::encoding::ValueTypeMarker for LeafGetStringResponse {
26        type Borrowed<'a> = &'a Self;
27        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
28            value
29        }
30    }
31
32    unsafe impl fidl::encoding::TypeMarker for LeafGetStringResponse {
33        type Owned = Self;
34
35        #[inline(always)]
36        fn inline_align(_context: fidl::encoding::Context) -> usize {
37            8
38        }
39
40        #[inline(always)]
41        fn inline_size(_context: fidl::encoding::Context) -> usize {
42            16
43        }
44    }
45
46    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<LeafGetStringResponse, D>
47        for &LeafGetStringResponse
48    {
49        #[inline]
50        unsafe fn encode(
51            self,
52            encoder: &mut fidl::encoding::Encoder<'_, D>,
53            offset: usize,
54            _depth: fidl::encoding::Depth,
55        ) -> fidl::Result<()> {
56            encoder.debug_check_bounds::<LeafGetStringResponse>(offset);
57            // Delegate to tuple encoding.
58            fidl::encoding::Encode::<LeafGetStringResponse, D>::encode(
59                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
60                    &self.response,
61                ),),
62                encoder,
63                offset,
64                _depth,
65            )
66        }
67    }
68    unsafe impl<
69            D: fidl::encoding::ResourceDialect,
70            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
71        > fidl::encoding::Encode<LeafGetStringResponse, D> for (T0,)
72    {
73        #[inline]
74        unsafe fn encode(
75            self,
76            encoder: &mut fidl::encoding::Encoder<'_, D>,
77            offset: usize,
78            depth: fidl::encoding::Depth,
79        ) -> fidl::Result<()> {
80            encoder.debug_check_bounds::<LeafGetStringResponse>(offset);
81            // Zero out padding regions. There's no need to apply masks
82            // because the unmasked parts will be overwritten by fields.
83            // Write the fields.
84            self.0.encode(encoder, offset + 0, depth)?;
85            Ok(())
86        }
87    }
88
89    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for LeafGetStringResponse {
90        #[inline(always)]
91        fn new_empty() -> Self {
92            Self { response: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
93        }
94
95        #[inline]
96        unsafe fn decode(
97            &mut self,
98            decoder: &mut fidl::encoding::Decoder<'_, D>,
99            offset: usize,
100            _depth: fidl::encoding::Depth,
101        ) -> fidl::Result<()> {
102            decoder.debug_check_bounds::<Self>(offset);
103            // Verify that padding bytes are zero.
104            fidl::decode!(
105                fidl::encoding::UnboundedString,
106                D,
107                &mut self.response,
108                decoder,
109                offset + 0,
110                _depth
111            )?;
112            Ok(())
113        }
114    }
115}