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