Skip to main content

selium_remote_client_protocol/fbs/remote_client/protocol/
capability_generated.rs

1// automatically generated by the FlatBuffers compiler, do not modify
2// @generated
3extern crate alloc;
4use super::*;
5#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
6pub const ENUM_MIN_CAPABILITY: u8 = 0;
7#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
8pub const ENUM_MAX_CAPABILITY: u8 = 19;
9#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
10#[allow(non_camel_case_types)]
11pub const ENUM_VALUES_CAPABILITY: [Capability; 20] = [
12  Capability::SessionLifecycle,
13  Capability::ChannelLifecycle,
14  Capability::ChannelReader,
15  Capability::ChannelWriter,
16  Capability::ProcessLifecycle,
17  Capability::NetQuicBind,
18  Capability::NetQuicAccept,
19  Capability::NetQuicConnect,
20  Capability::NetQuicRead,
21  Capability::NetQuicWrite,
22  Capability::NetHttpBind,
23  Capability::NetHttpAccept,
24  Capability::NetHttpConnect,
25  Capability::NetHttpRead,
26  Capability::NetHttpWrite,
27  Capability::NetTlsServerConfig,
28  Capability::NetTlsClientConfig,
29  Capability::SingletonRegistry,
30  Capability::SingletonLookup,
31  Capability::TimeRead,
32];
33
34#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
35#[repr(transparent)]
36pub struct Capability(pub u8);
37#[allow(non_upper_case_globals)]
38impl Capability {
39  pub const SessionLifecycle: Self = Self(0);
40  pub const ChannelLifecycle: Self = Self(1);
41  pub const ChannelReader: Self = Self(2);
42  pub const ChannelWriter: Self = Self(3);
43  pub const ProcessLifecycle: Self = Self(4);
44  pub const NetQuicBind: Self = Self(5);
45  pub const NetQuicAccept: Self = Self(6);
46  pub const NetQuicConnect: Self = Self(7);
47  pub const NetQuicRead: Self = Self(8);
48  pub const NetQuicWrite: Self = Self(9);
49  pub const NetHttpBind: Self = Self(10);
50  pub const NetHttpAccept: Self = Self(11);
51  pub const NetHttpConnect: Self = Self(12);
52  pub const NetHttpRead: Self = Self(13);
53  pub const NetHttpWrite: Self = Self(14);
54  pub const NetTlsServerConfig: Self = Self(15);
55  pub const NetTlsClientConfig: Self = Self(16);
56  pub const SingletonRegistry: Self = Self(17);
57  pub const SingletonLookup: Self = Self(18);
58  pub const TimeRead: Self = Self(19);
59
60  pub const ENUM_MIN: u8 = 0;
61  pub const ENUM_MAX: u8 = 19;
62  pub const ENUM_VALUES: &'static [Self] = &[
63    Self::SessionLifecycle,
64    Self::ChannelLifecycle,
65    Self::ChannelReader,
66    Self::ChannelWriter,
67    Self::ProcessLifecycle,
68    Self::NetQuicBind,
69    Self::NetQuicAccept,
70    Self::NetQuicConnect,
71    Self::NetQuicRead,
72    Self::NetQuicWrite,
73    Self::NetHttpBind,
74    Self::NetHttpAccept,
75    Self::NetHttpConnect,
76    Self::NetHttpRead,
77    Self::NetHttpWrite,
78    Self::NetTlsServerConfig,
79    Self::NetTlsClientConfig,
80    Self::SingletonRegistry,
81    Self::SingletonLookup,
82    Self::TimeRead,
83  ];
84  /// Returns the variant's name or "" if unknown.
85  pub fn variant_name(self) -> Option<&'static str> {
86    match self {
87      Self::SessionLifecycle => Some("SessionLifecycle"),
88      Self::ChannelLifecycle => Some("ChannelLifecycle"),
89      Self::ChannelReader => Some("ChannelReader"),
90      Self::ChannelWriter => Some("ChannelWriter"),
91      Self::ProcessLifecycle => Some("ProcessLifecycle"),
92      Self::NetQuicBind => Some("NetQuicBind"),
93      Self::NetQuicAccept => Some("NetQuicAccept"),
94      Self::NetQuicConnect => Some("NetQuicConnect"),
95      Self::NetQuicRead => Some("NetQuicRead"),
96      Self::NetQuicWrite => Some("NetQuicWrite"),
97      Self::NetHttpBind => Some("NetHttpBind"),
98      Self::NetHttpAccept => Some("NetHttpAccept"),
99      Self::NetHttpConnect => Some("NetHttpConnect"),
100      Self::NetHttpRead => Some("NetHttpRead"),
101      Self::NetHttpWrite => Some("NetHttpWrite"),
102      Self::NetTlsServerConfig => Some("NetTlsServerConfig"),
103      Self::NetTlsClientConfig => Some("NetTlsClientConfig"),
104      Self::SingletonRegistry => Some("SingletonRegistry"),
105      Self::SingletonLookup => Some("SingletonLookup"),
106      Self::TimeRead => Some("TimeRead"),
107      _ => None,
108    }
109  }
110}
111impl ::core::fmt::Debug for Capability {
112  fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
113    if let Some(name) = self.variant_name() {
114      f.write_str(name)
115    } else {
116      f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
117    }
118  }
119}
120impl<'a> ::flatbuffers::Follow<'a> for Capability {
121  type Inner = Self;
122  #[inline]
123  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
124    let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
125    Self(b)
126  }
127}
128
129impl ::flatbuffers::Push for Capability {
130    type Output = Capability;
131    #[inline]
132    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
133        unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
134    }
135}
136
137impl ::flatbuffers::EndianScalar for Capability {
138  type Scalar = u8;
139  #[inline]
140  fn to_little_endian(self) -> u8 {
141    self.0.to_le()
142  }
143  #[inline]
144  #[allow(clippy::wrong_self_convention)]
145  fn from_little_endian(v: u8) -> Self {
146    let b = u8::from_le(v);
147    Self(b)
148  }
149}
150
151impl<'a> ::flatbuffers::Verifiable for Capability {
152  #[inline]
153  fn run_verifier(
154    v: &mut ::flatbuffers::Verifier, pos: usize
155  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
156    u8::run_verifier(v, pos)
157  }
158}
159
160impl ::flatbuffers::SimpleToVerifyInSlice for Capability {}