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