fidl_fuchsia_intl_test/
fidl_fuchsia_intl_test.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(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
14#[repr(u64)]
15pub enum MessageIds {
16    StringName = 2873628059656615389,
17    StringName2 = 3826929244932939200,
18    StringName3 = 10195500725288929845,
19}
20
21impl MessageIds {
22    #[inline]
23    pub fn from_primitive(prim: u64) -> Option<Self> {
24        match prim {
25            2873628059656615389 => Some(Self::StringName),
26            3826929244932939200 => Some(Self::StringName2),
27            10195500725288929845 => Some(Self::StringName3),
28            _ => None,
29        }
30    }
31
32    #[inline]
33    pub const fn into_primitive(self) -> u64 {
34        self as u64
35    }
36
37    #[deprecated = "Strict enums should not use `is_unknown`"]
38    #[inline]
39    pub fn is_unknown(&self) -> bool {
40        false
41    }
42}
43
44mod internal {
45    use super::*;
46    unsafe impl fidl::encoding::TypeMarker for MessageIds {
47        type Owned = Self;
48
49        #[inline(always)]
50        fn inline_align(_context: fidl::encoding::Context) -> usize {
51            std::mem::align_of::<u64>()
52        }
53
54        #[inline(always)]
55        fn inline_size(_context: fidl::encoding::Context) -> usize {
56            std::mem::size_of::<u64>()
57        }
58
59        #[inline(always)]
60        fn encode_is_copy() -> bool {
61            true
62        }
63
64        #[inline(always)]
65        fn decode_is_copy() -> bool {
66            false
67        }
68    }
69
70    impl fidl::encoding::ValueTypeMarker for MessageIds {
71        type Borrowed<'a> = Self;
72        #[inline(always)]
73        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
74            *value
75        }
76    }
77
78    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MessageIds {
79        #[inline]
80        unsafe fn encode(
81            self,
82            encoder: &mut fidl::encoding::Encoder<'_, D>,
83            offset: usize,
84            _depth: fidl::encoding::Depth,
85        ) -> fidl::Result<()> {
86            encoder.debug_check_bounds::<Self>(offset);
87            encoder.write_num(self.into_primitive(), offset);
88            Ok(())
89        }
90    }
91
92    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MessageIds {
93        #[inline(always)]
94        fn new_empty() -> Self {
95            Self::StringName
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::<u64>(offset);
107
108            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
109            Ok(())
110        }
111    }
112}