fidl_test_wlan_realm__common/
fidl_test_wlan_realm__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(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 pub const CREATE_REALM3: u64 = 0x616e6a3aeda970e9;
38}
39
40mod internal {
41 use super::*;
42 unsafe impl fidl::encoding::TypeMarker for TraceManagerHermeticity {
43 type Owned = Self;
44
45 #[inline(always)]
46 fn inline_align(_context: fidl::encoding::Context) -> usize {
47 std::mem::align_of::<u32>()
48 }
49
50 #[inline(always)]
51 fn inline_size(_context: fidl::encoding::Context) -> usize {
52 std::mem::size_of::<u32>()
53 }
54
55 #[inline(always)]
56 fn encode_is_copy() -> bool {
57 true
58 }
59
60 #[inline(always)]
61 fn decode_is_copy() -> bool {
62 false
63 }
64 }
65
66 impl fidl::encoding::ValueTypeMarker for TraceManagerHermeticity {
67 type Borrowed<'a> = Self;
68 #[inline(always)]
69 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
70 *value
71 }
72 }
73
74 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
75 for TraceManagerHermeticity
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::<Self>(offset);
85 encoder.write_num(self.into_primitive(), offset);
86 Ok(())
87 }
88 }
89
90 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
91 for TraceManagerHermeticity
92 {
93 #[inline(always)]
94 fn new_empty() -> Self {
95 Self::Hermetic
96 }
97
98 #[inline]
99 unsafe fn decode(
100 &mut self,
101 decoder: &mut fidl::encoding::Decoder<'_, D>,
102 offset: usize,
103 _depth: fidl::encoding::Depth,
104 ) -> fidl::Result<()> {
105 decoder.debug_check_bounds::<Self>(offset);
106 let prim = decoder.read_num::<u32>(offset);
107
108 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
109 Ok(())
110 }
111 }
112}