fidl_test_wlan_realm__common/
fidl_test_wlan_realm__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(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
12#[repr(u32)]
13pub enum TraceManagerHermeticity {
14    Hermetic = 0,
15    NonHermetic = 1,
16}
17
18impl TraceManagerHermeticity {
19    #[inline]
20    pub fn from_primitive(prim: u32) -> Option<Self> {
21        match prim {
22            0 => Some(Self::Hermetic),
23            1 => Some(Self::NonHermetic),
24            _ => None,
25        }
26    }
27
28    #[inline]
29    pub const fn into_primitive(self) -> u32 {
30        self as u32
31    }
32}
33
34pub mod realm_factory_ordinals {
35    pub const CREATE_REALM: u64 = 0x51aac08d328c3ae4;
36    pub const CREATE_REALM2: u64 = 0x29dd599835927548;
37}
38
39mod internal {
40    use super::*;
41    unsafe impl fidl::encoding::TypeMarker for TraceManagerHermeticity {
42        type Owned = Self;
43
44        #[inline(always)]
45        fn inline_align(_context: fidl::encoding::Context) -> usize {
46            std::mem::align_of::<u32>()
47        }
48
49        #[inline(always)]
50        fn inline_size(_context: fidl::encoding::Context) -> usize {
51            std::mem::size_of::<u32>()
52        }
53
54        #[inline(always)]
55        fn encode_is_copy() -> bool {
56            true
57        }
58
59        #[inline(always)]
60        fn decode_is_copy() -> bool {
61            false
62        }
63    }
64
65    impl fidl::encoding::ValueTypeMarker for TraceManagerHermeticity {
66        type Borrowed<'a> = Self;
67        #[inline(always)]
68        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
69            *value
70        }
71    }
72
73    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
74        for TraceManagerHermeticity
75    {
76        #[inline]
77        unsafe fn encode(
78            self,
79            encoder: &mut fidl::encoding::Encoder<'_, D>,
80            offset: usize,
81            _depth: fidl::encoding::Depth,
82        ) -> fidl::Result<()> {
83            encoder.debug_check_bounds::<Self>(offset);
84            encoder.write_num(self.into_primitive(), offset);
85            Ok(())
86        }
87    }
88
89    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
90        for TraceManagerHermeticity
91    {
92        #[inline(always)]
93        fn new_empty() -> Self {
94            Self::Hermetic
95        }
96
97        #[inline]
98        unsafe fn decode(
99            &mut self,
100            decoder: &mut fidl::encoding::Decoder<'_, D>,
101            offset: usize,
102            _depth: fidl::encoding::Depth,
103        ) -> fidl::Result<()> {
104            decoder.debug_check_bounds::<Self>(offset);
105            let prim = decoder.read_num::<u32>(offset);
106
107            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
108            Ok(())
109        }
110    }
111}