fidl_cf_sc_internal_starnixrunnerconfig/
fidl_cf_sc_internal_starnixrunnerconfig.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
13#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
14pub struct Config {
15    pub enable_data_collection: bool,
16}
17
18impl fidl::Persistable for Config {}
19
20mod internal {
21    use super::*;
22
23    impl fidl::encoding::ValueTypeMarker for Config {
24        type Borrowed<'a> = &'a Self;
25        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
26            value
27        }
28    }
29
30    unsafe impl fidl::encoding::TypeMarker for Config {
31        type Owned = Self;
32
33        #[inline(always)]
34        fn inline_align(_context: fidl::encoding::Context) -> usize {
35            1
36        }
37
38        #[inline(always)]
39        fn inline_size(_context: fidl::encoding::Context) -> usize {
40            1
41        }
42    }
43
44    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Config, D> for &Config {
45        #[inline]
46        unsafe fn encode(
47            self,
48            encoder: &mut fidl::encoding::Encoder<'_, D>,
49            offset: usize,
50            _depth: fidl::encoding::Depth,
51        ) -> fidl::Result<()> {
52            encoder.debug_check_bounds::<Config>(offset);
53            // Delegate to tuple encoding.
54            fidl::encoding::Encode::<Config, D>::encode(
55                (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable_data_collection),),
56                encoder,
57                offset,
58                _depth,
59            )
60        }
61    }
62    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, 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 { enable_data_collection: fidl::new_empty!(bool, D) }
85        }
86
87        #[inline]
88        unsafe fn decode(
89            &mut self,
90            decoder: &mut fidl::encoding::Decoder<'_, D>,
91            offset: usize,
92            _depth: fidl::encoding::Depth,
93        ) -> fidl::Result<()> {
94            decoder.debug_check_bounds::<Self>(offset);
95            // Verify that padding bytes are zero.
96            fidl::decode!(bool, D, &mut self.enable_data_collection, decoder, offset + 0, _depth)?;
97            Ok(())
98        }
99    }
100}