Debian Codegraph @

tests/include_test2/my_game/other_name_space/from_include_generated.rs

raw
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 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
13 pub const ENUM_MIN_FROM_INCLUDE: i64 = 0;
14 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
15 pub const ENUM_MAX_FROM_INCLUDE: i64 = 0;
16 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
17 #[allow(non_camel_case_types)]
18 pub const ENUM_VALUES_FROM_INCLUDE: [FromInclude; 1] = [
19 FromInclude::IncludeVal,
20 ];
21
22 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
23 #[repr(transparent)]
24 pub struct FromInclude(pub i64);
25 #[allow(non_upper_case_globals)]
26 impl FromInclude {
27 pub const IncludeVal: Self = Self(0);
28
29 pub const ENUM_MIN: i64 = 0;
30 pub const ENUM_MAX: i64 = 0;
31 pub const ENUM_VALUES: &'static [Self] = &[
32 Self::IncludeVal,
33 ];
34 /// Returns the variant's name or "" if unknown.
35 pub fn variant_name(self) -> Option<&'static str> {
36 match self {
37 Self::IncludeVal => Some("IncludeVal"),
38 _ => None,
39 }
40 }
41 }
42 impl core::fmt::Debug for FromInclude {
43 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
44 if let Some(name) = self.variant_name() {
45 f.write_str(name)
46 } else {
47 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
48 }
49 }
50 }
51 impl<'a> flatbuffers::Follow<'a> for FromInclude {
52 type Inner = Self;
53 #[inline]
54 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
55 let b = flatbuffers::read_scalar_at::<i64>(buf, loc);
56 Self(b)
57 }
58 }
59
60 impl flatbuffers::Push for FromInclude {
61 type Output = FromInclude;
62 #[inline]
63 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
64 flatbuffers::emplace_scalar::<i64>(dst, self.0);
65 }
66 }
67
68 impl flatbuffers::EndianScalar for FromInclude {
69 type Scalar = i64;
70 #[inline]
71 fn to_little_endian(self) -> i64 {
72 self.0.to_le()
73 }
74 #[inline]
75 #[allow(clippy::wrong_self_convention)]
76 fn from_little_endian(v: i64) -> Self {
77 let b = i64::from_le(v);
78 Self(b)
79 }
80 }
81
82 impl<'a> flatbuffers::Verifiable for FromInclude {
83 #[inline]
84 fn run_verifier(
85 v: &mut flatbuffers::Verifier, pos: usize
86 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
87 use self::flatbuffers::Verifiable;
88 i64::run_verifier(v, pos)
89 }
90 }
91
92 impl flatbuffers::SimpleToVerifyInSlice for FromInclude {}