1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// WARNING: This file is machine generated by fidlgen.

#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]

use {
    bitflags::bitflags,
    fidl::{
        client::QueryResponseFut,
        endpoints::{ControlHandle as _, Responder as _},
    },
    fuchsia_zircon_status as zx_status,
    futures::future::{self, MaybeDone, TryFutureExt},
};

#[cfg(target_os = "fuchsia")]
use fuchsia_zircon as zx;

#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u64)]
pub enum MessageIds {
    StringName = 2873628059656615389,
    StringName2 = 3826929244932939200,
    StringName3 = 10195500725288929845,
}

impl MessageIds {
    #[inline]
    pub fn from_primitive(prim: u64) -> Option<Self> {
        match prim {
            2873628059656615389 => Some(Self::StringName),
            3826929244932939200 => Some(Self::StringName2),
            10195500725288929845 => Some(Self::StringName3),
            _ => None,
        }
    }

    #[inline]
    pub const fn into_primitive(self) -> u64 {
        self as u64
    }

    #[deprecated = "Strict enums should not use `is_unknown`"]
    #[inline]
    pub fn is_unknown(&self) -> bool {
        false
    }
}

mod internal {
    use super::*;
    unsafe impl fidl::encoding::TypeMarker for MessageIds {
        type Owned = Self;

        #[inline(always)]
        fn inline_align(_context: fidl::encoding::Context) -> usize {
            std::mem::align_of::<u64>()
        }

        #[inline(always)]
        fn inline_size(_context: fidl::encoding::Context) -> usize {
            std::mem::size_of::<u64>()
        }

        #[inline(always)]
        fn encode_is_copy() -> bool {
            true
        }

        #[inline(always)]
        fn decode_is_copy() -> bool {
            false
        }
    }

    impl fidl::encoding::ValueTypeMarker for MessageIds {
        type Borrowed<'a> = Self;
        #[inline(always)]
        fn borrow<'a>(
            value: &'a <Self as fidl::encoding::TypeMarker>::Owned,
        ) -> Self::Borrowed<'a> {
            *value
        }
    }

    unsafe impl fidl::encoding::Encode<Self> for MessageIds {
        #[inline]
        unsafe fn encode(
            self,
            encoder: &mut fidl::encoding::Encoder<'_>,
            offset: usize,
            _depth: fidl::encoding::Depth,
        ) -> fidl::Result<()> {
            encoder.debug_check_bounds::<Self>(offset);
            encoder.write_num(self.into_primitive(), offset);
            Ok(())
        }
    }

    impl fidl::encoding::Decode<Self> for MessageIds {
        #[inline(always)]
        fn new_empty() -> Self {
            Self::StringName
        }

        #[inline]
        unsafe fn decode(
            &mut self,
            decoder: &mut fidl::encoding::Decoder<'_>,
            offset: usize,
            _depth: fidl::encoding::Depth,
        ) -> fidl::Result<()> {
            decoder.debug_check_bounds::<Self>(offset);
            let prim = decoder.read_num::<u64>(offset);

            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
            Ok(())
        }
    }
}