• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // automatically generated by the FlatBuffers compiler, do not modify
2 // @generated
3 extern crate alloc;
4 extern crate flatbuffers;
5 use alloc::boxed::Box;
6 use alloc::string::{String, ToString};
7 use alloc::vec::Vec;
8 use core::mem;
9 use core::cmp::Ordering;
10 use self::flatbuffers::{EndianScalar, Follow};
11 use super::*;
12 #[allow(non_upper_case_globals)]
13 mod bitflags_long_enum {
14   flatbuffers::bitflags::bitflags! {
15     #[derive(Default)]
16     pub struct LongEnum: u64 {
17       const LongOne = 2;
18       const LongTwo = 4;
19       const LongBig = 1099511627776;
20     }
21   }
22 }
23 pub use self::bitflags_long_enum::LongEnum;
24 
25 impl<'a> flatbuffers::Follow<'a> for LongEnum {
26   type Inner = Self;
27   #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner28   fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
29     let b = unsafe {
30       flatbuffers::read_scalar_at::<u64>(buf, loc)
31     };
32     unsafe { Self::from_bits_unchecked(b) }
33   }
34 }
35 
36 impl flatbuffers::Push for LongEnum {
37     type Output = LongEnum;
38     #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])39     fn push(&self, dst: &mut [u8], _rest: &[u8]) {
40         unsafe { flatbuffers::emplace_scalar::<u64>(dst, self.bits()); }
41     }
42 }
43 
44 impl flatbuffers::EndianScalar for LongEnum {
45   #[inline]
to_little_endian(self) -> Self46   fn to_little_endian(self) -> Self {
47     let b = u64::to_le(self.bits());
48     unsafe { Self::from_bits_unchecked(b) }
49   }
50   #[inline]
51   #[allow(clippy::wrong_self_convention)]
from_little_endian(self) -> Self52   fn from_little_endian(self) -> Self {
53     let b = u64::from_le(self.bits());
54     unsafe { Self::from_bits_unchecked(b) }
55   }
56 }
57 
58 impl<'a> flatbuffers::Verifiable for LongEnum {
59   #[inline]
run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>60   fn run_verifier(
61     v: &mut flatbuffers::Verifier, pos: usize
62   ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
63     use self::flatbuffers::Verifiable;
64     u64::run_verifier(v, pos)
65   }
66 }
67 
68 impl flatbuffers::SimpleToVerifyInSlice for LongEnum {}
69