fidl_cf_sc_internal_fxfsconfig_common/
fidl_cf_sc_internal_fxfsconfig_common.rs1#![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, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
12pub struct Config {
13 pub storage_stall_watchdog_enabled: bool,
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 1
34 }
35
36 #[inline(always)]
37 fn inline_size(_context: fidl::encoding::Context) -> usize {
38 1
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 fidl::encoding::Encode::<Config, D>::encode(
53 (<bool as fidl::encoding::ValueTypeMarker>::borrow(
54 &self.storage_stall_watchdog_enabled,
55 ),),
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 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 { storage_stall_watchdog_enabled: 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 fidl::decode!(
97 bool,
98 D,
99 &mut self.storage_stall_watchdog_enabled,
100 decoder,
101 offset + 0,
102 _depth
103 )?;
104 Ok(())
105 }
106 }
107}