1 // automatically generated by the FlatBuffers compiler, do not modify
2
3
4
5 use std::mem;
6 use std::cmp::Ordering;
7
8 extern crate flatbuffers;
9 use self::flatbuffers::{EndianScalar, Follow};
10
11 #[allow(unused_imports, dead_code)]
12 pub mod optional_scalars {
13
14 use std::mem;
15 use std::cmp::Ordering;
16
17 extern crate flatbuffers;
18 use self::flatbuffers::{EndianScalar, Follow};
19
20 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
21 pub const ENUM_MIN_OPTIONAL_BYTE: i8 = 0;
22 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
23 pub const ENUM_MAX_OPTIONAL_BYTE: i8 = 2;
24 #[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
25 #[allow(non_camel_case_types)]
26 pub const ENUM_VALUES_OPTIONAL_BYTE: [OptionalByte; 3] = [
27 OptionalByte::None,
28 OptionalByte::One,
29 OptionalByte::Two,
30 ];
31
32 #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
33 #[repr(transparent)]
34 pub struct OptionalByte(pub i8);
35 #[allow(non_upper_case_globals)]
36 impl OptionalByte {
37 pub const None: Self = Self(0);
38 pub const One: Self = Self(1);
39 pub const Two: Self = Self(2);
40
41 pub const ENUM_MIN: i8 = 0;
42 pub const ENUM_MAX: i8 = 2;
43 pub const ENUM_VALUES: &'static [Self] = &[
44 Self::None,
45 Self::One,
46 Self::Two,
47 ];
48 /// Returns the variant's name or "" if unknown.
variant_name(self) -> Option<&'static str>49 pub fn variant_name(self) -> Option<&'static str> {
50 match self {
51 Self::None => Some("None"),
52 Self::One => Some("One"),
53 Self::Two => Some("Two"),
54 _ => None,
55 }
56 }
57 }
58 impl std::fmt::Debug for OptionalByte {
fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result59 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
60 if let Some(name) = self.variant_name() {
61 f.write_str(name)
62 } else {
63 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
64 }
65 }
66 }
67 impl<'a> flatbuffers::Follow<'a> for OptionalByte {
68 type Inner = Self;
69 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner70 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
71 let b = unsafe {
72 flatbuffers::read_scalar_at::<i8>(buf, loc)
73 };
74 Self(b)
75 }
76 }
77
78 impl flatbuffers::Push for OptionalByte {
79 type Output = OptionalByte;
80 #[inline]
push(&self, dst: &mut [u8], _rest: &[u8])81 fn push(&self, dst: &mut [u8], _rest: &[u8]) {
82 unsafe { flatbuffers::emplace_scalar::<i8>(dst, self.0); }
83 }
84 }
85
86 impl flatbuffers::EndianScalar for OptionalByte {
87 #[inline]
to_little_endian(self) -> Self88 fn to_little_endian(self) -> Self {
89 let b = i8::to_le(self.0);
90 Self(b)
91 }
92 #[inline]
93 #[allow(clippy::wrong_self_convention)]
from_little_endian(self) -> Self94 fn from_little_endian(self) -> Self {
95 let b = i8::from_le(self.0);
96 Self(b)
97 }
98 }
99
100 impl<'a> flatbuffers::Verifiable for OptionalByte {
101 #[inline]
run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>102 fn run_verifier(
103 v: &mut flatbuffers::Verifier, pos: usize
104 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
105 use self::flatbuffers::Verifiable;
106 i8::run_verifier(v, pos)
107 }
108 }
109
110 impl flatbuffers::SimpleToVerifyInSlice for OptionalByte {}
111 pub enum ScalarStuffOffset {}
112 #[derive(Copy, Clone, PartialEq)]
113
114 pub struct ScalarStuff<'a> {
115 pub _tab: flatbuffers::Table<'a>,
116 }
117
118 impl<'a> flatbuffers::Follow<'a> for ScalarStuff<'a> {
119 type Inner = ScalarStuff<'a>;
120 #[inline]
follow(buf: &'a [u8], loc: usize) -> Self::Inner121 fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
122 Self { _tab: flatbuffers::Table { buf, loc } }
123 }
124 }
125
126 impl<'a> ScalarStuff<'a> {
127 #[inline]
init_from_table(table: flatbuffers::Table<'a>) -> Self128 pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
129 ScalarStuff { _tab: table }
130 }
131 #[allow(unused_mut)]
create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>( _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>, args: &'args ScalarStuffArgs) -> flatbuffers::WIPOffset<ScalarStuff<'bldr>>132 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
133 _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
134 args: &'args ScalarStuffArgs) -> flatbuffers::WIPOffset<ScalarStuff<'bldr>> {
135 let mut builder = ScalarStuffBuilder::new(_fbb);
136 builder.add_default_f64(args.default_f64);
137 if let Some(x) = args.maybe_f64 { builder.add_maybe_f64(x); }
138 builder.add_just_f64(args.just_f64);
139 builder.add_default_u64(args.default_u64);
140 if let Some(x) = args.maybe_u64 { builder.add_maybe_u64(x); }
141 builder.add_just_u64(args.just_u64);
142 builder.add_default_i64(args.default_i64);
143 if let Some(x) = args.maybe_i64 { builder.add_maybe_i64(x); }
144 builder.add_just_i64(args.just_i64);
145 builder.add_default_f32(args.default_f32);
146 if let Some(x) = args.maybe_f32 { builder.add_maybe_f32(x); }
147 builder.add_just_f32(args.just_f32);
148 builder.add_default_u32(args.default_u32);
149 if let Some(x) = args.maybe_u32 { builder.add_maybe_u32(x); }
150 builder.add_just_u32(args.just_u32);
151 builder.add_default_i32(args.default_i32);
152 if let Some(x) = args.maybe_i32 { builder.add_maybe_i32(x); }
153 builder.add_just_i32(args.just_i32);
154 builder.add_default_u16(args.default_u16);
155 if let Some(x) = args.maybe_u16 { builder.add_maybe_u16(x); }
156 builder.add_just_u16(args.just_u16);
157 builder.add_default_i16(args.default_i16);
158 if let Some(x) = args.maybe_i16 { builder.add_maybe_i16(x); }
159 builder.add_just_i16(args.just_i16);
160 builder.add_default_enum(args.default_enum);
161 if let Some(x) = args.maybe_enum { builder.add_maybe_enum(x); }
162 builder.add_just_enum(args.just_enum);
163 builder.add_default_bool(args.default_bool);
164 if let Some(x) = args.maybe_bool { builder.add_maybe_bool(x); }
165 builder.add_just_bool(args.just_bool);
166 builder.add_default_u8(args.default_u8);
167 if let Some(x) = args.maybe_u8 { builder.add_maybe_u8(x); }
168 builder.add_just_u8(args.just_u8);
169 builder.add_default_i8(args.default_i8);
170 if let Some(x) = args.maybe_i8 { builder.add_maybe_i8(x); }
171 builder.add_just_i8(args.just_i8);
172 builder.finish()
173 }
174
unpack(&self) -> ScalarStuffT175 pub fn unpack(&self) -> ScalarStuffT {
176 let just_i8 = self.just_i8();
177 let maybe_i8 = self.maybe_i8();
178 let default_i8 = self.default_i8();
179 let just_u8 = self.just_u8();
180 let maybe_u8 = self.maybe_u8();
181 let default_u8 = self.default_u8();
182 let just_i16 = self.just_i16();
183 let maybe_i16 = self.maybe_i16();
184 let default_i16 = self.default_i16();
185 let just_u16 = self.just_u16();
186 let maybe_u16 = self.maybe_u16();
187 let default_u16 = self.default_u16();
188 let just_i32 = self.just_i32();
189 let maybe_i32 = self.maybe_i32();
190 let default_i32 = self.default_i32();
191 let just_u32 = self.just_u32();
192 let maybe_u32 = self.maybe_u32();
193 let default_u32 = self.default_u32();
194 let just_i64 = self.just_i64();
195 let maybe_i64 = self.maybe_i64();
196 let default_i64 = self.default_i64();
197 let just_u64 = self.just_u64();
198 let maybe_u64 = self.maybe_u64();
199 let default_u64 = self.default_u64();
200 let just_f32 = self.just_f32();
201 let maybe_f32 = self.maybe_f32();
202 let default_f32 = self.default_f32();
203 let just_f64 = self.just_f64();
204 let maybe_f64 = self.maybe_f64();
205 let default_f64 = self.default_f64();
206 let just_bool = self.just_bool();
207 let maybe_bool = self.maybe_bool();
208 let default_bool = self.default_bool();
209 let just_enum = self.just_enum();
210 let maybe_enum = self.maybe_enum();
211 let default_enum = self.default_enum();
212 ScalarStuffT {
213 just_i8,
214 maybe_i8,
215 default_i8,
216 just_u8,
217 maybe_u8,
218 default_u8,
219 just_i16,
220 maybe_i16,
221 default_i16,
222 just_u16,
223 maybe_u16,
224 default_u16,
225 just_i32,
226 maybe_i32,
227 default_i32,
228 just_u32,
229 maybe_u32,
230 default_u32,
231 just_i64,
232 maybe_i64,
233 default_i64,
234 just_u64,
235 maybe_u64,
236 default_u64,
237 just_f32,
238 maybe_f32,
239 default_f32,
240 just_f64,
241 maybe_f64,
242 default_f64,
243 just_bool,
244 maybe_bool,
245 default_bool,
246 just_enum,
247 maybe_enum,
248 default_enum,
249 }
250 }
251 pub const VT_JUST_I8: flatbuffers::VOffsetT = 4;
252 pub const VT_MAYBE_I8: flatbuffers::VOffsetT = 6;
253 pub const VT_DEFAULT_I8: flatbuffers::VOffsetT = 8;
254 pub const VT_JUST_U8: flatbuffers::VOffsetT = 10;
255 pub const VT_MAYBE_U8: flatbuffers::VOffsetT = 12;
256 pub const VT_DEFAULT_U8: flatbuffers::VOffsetT = 14;
257 pub const VT_JUST_I16: flatbuffers::VOffsetT = 16;
258 pub const VT_MAYBE_I16: flatbuffers::VOffsetT = 18;
259 pub const VT_DEFAULT_I16: flatbuffers::VOffsetT = 20;
260 pub const VT_JUST_U16: flatbuffers::VOffsetT = 22;
261 pub const VT_MAYBE_U16: flatbuffers::VOffsetT = 24;
262 pub const VT_DEFAULT_U16: flatbuffers::VOffsetT = 26;
263 pub const VT_JUST_I32: flatbuffers::VOffsetT = 28;
264 pub const VT_MAYBE_I32: flatbuffers::VOffsetT = 30;
265 pub const VT_DEFAULT_I32: flatbuffers::VOffsetT = 32;
266 pub const VT_JUST_U32: flatbuffers::VOffsetT = 34;
267 pub const VT_MAYBE_U32: flatbuffers::VOffsetT = 36;
268 pub const VT_DEFAULT_U32: flatbuffers::VOffsetT = 38;
269 pub const VT_JUST_I64: flatbuffers::VOffsetT = 40;
270 pub const VT_MAYBE_I64: flatbuffers::VOffsetT = 42;
271 pub const VT_DEFAULT_I64: flatbuffers::VOffsetT = 44;
272 pub const VT_JUST_U64: flatbuffers::VOffsetT = 46;
273 pub const VT_MAYBE_U64: flatbuffers::VOffsetT = 48;
274 pub const VT_DEFAULT_U64: flatbuffers::VOffsetT = 50;
275 pub const VT_JUST_F32: flatbuffers::VOffsetT = 52;
276 pub const VT_MAYBE_F32: flatbuffers::VOffsetT = 54;
277 pub const VT_DEFAULT_F32: flatbuffers::VOffsetT = 56;
278 pub const VT_JUST_F64: flatbuffers::VOffsetT = 58;
279 pub const VT_MAYBE_F64: flatbuffers::VOffsetT = 60;
280 pub const VT_DEFAULT_F64: flatbuffers::VOffsetT = 62;
281 pub const VT_JUST_BOOL: flatbuffers::VOffsetT = 64;
282 pub const VT_MAYBE_BOOL: flatbuffers::VOffsetT = 66;
283 pub const VT_DEFAULT_BOOL: flatbuffers::VOffsetT = 68;
284 pub const VT_JUST_ENUM: flatbuffers::VOffsetT = 70;
285 pub const VT_MAYBE_ENUM: flatbuffers::VOffsetT = 72;
286 pub const VT_DEFAULT_ENUM: flatbuffers::VOffsetT = 74;
287
288 #[inline]
just_i8(&self) -> i8289 pub fn just_i8(&self) -> i8 {
290 self._tab.get::<i8>(ScalarStuff::VT_JUST_I8, Some(0)).unwrap()
291 }
292 #[inline]
maybe_i8(&self) -> Option<i8>293 pub fn maybe_i8(&self) -> Option<i8> {
294 self._tab.get::<i8>(ScalarStuff::VT_MAYBE_I8, None)
295 }
296 #[inline]
default_i8(&self) -> i8297 pub fn default_i8(&self) -> i8 {
298 self._tab.get::<i8>(ScalarStuff::VT_DEFAULT_I8, Some(42)).unwrap()
299 }
300 #[inline]
just_u8(&self) -> u8301 pub fn just_u8(&self) -> u8 {
302 self._tab.get::<u8>(ScalarStuff::VT_JUST_U8, Some(0)).unwrap()
303 }
304 #[inline]
maybe_u8(&self) -> Option<u8>305 pub fn maybe_u8(&self) -> Option<u8> {
306 self._tab.get::<u8>(ScalarStuff::VT_MAYBE_U8, None)
307 }
308 #[inline]
default_u8(&self) -> u8309 pub fn default_u8(&self) -> u8 {
310 self._tab.get::<u8>(ScalarStuff::VT_DEFAULT_U8, Some(42)).unwrap()
311 }
312 #[inline]
just_i16(&self) -> i16313 pub fn just_i16(&self) -> i16 {
314 self._tab.get::<i16>(ScalarStuff::VT_JUST_I16, Some(0)).unwrap()
315 }
316 #[inline]
maybe_i16(&self) -> Option<i16>317 pub fn maybe_i16(&self) -> Option<i16> {
318 self._tab.get::<i16>(ScalarStuff::VT_MAYBE_I16, None)
319 }
320 #[inline]
default_i16(&self) -> i16321 pub fn default_i16(&self) -> i16 {
322 self._tab.get::<i16>(ScalarStuff::VT_DEFAULT_I16, Some(42)).unwrap()
323 }
324 #[inline]
just_u16(&self) -> u16325 pub fn just_u16(&self) -> u16 {
326 self._tab.get::<u16>(ScalarStuff::VT_JUST_U16, Some(0)).unwrap()
327 }
328 #[inline]
maybe_u16(&self) -> Option<u16>329 pub fn maybe_u16(&self) -> Option<u16> {
330 self._tab.get::<u16>(ScalarStuff::VT_MAYBE_U16, None)
331 }
332 #[inline]
default_u16(&self) -> u16333 pub fn default_u16(&self) -> u16 {
334 self._tab.get::<u16>(ScalarStuff::VT_DEFAULT_U16, Some(42)).unwrap()
335 }
336 #[inline]
just_i32(&self) -> i32337 pub fn just_i32(&self) -> i32 {
338 self._tab.get::<i32>(ScalarStuff::VT_JUST_I32, Some(0)).unwrap()
339 }
340 #[inline]
maybe_i32(&self) -> Option<i32>341 pub fn maybe_i32(&self) -> Option<i32> {
342 self._tab.get::<i32>(ScalarStuff::VT_MAYBE_I32, None)
343 }
344 #[inline]
default_i32(&self) -> i32345 pub fn default_i32(&self) -> i32 {
346 self._tab.get::<i32>(ScalarStuff::VT_DEFAULT_I32, Some(42)).unwrap()
347 }
348 #[inline]
just_u32(&self) -> u32349 pub fn just_u32(&self) -> u32 {
350 self._tab.get::<u32>(ScalarStuff::VT_JUST_U32, Some(0)).unwrap()
351 }
352 #[inline]
maybe_u32(&self) -> Option<u32>353 pub fn maybe_u32(&self) -> Option<u32> {
354 self._tab.get::<u32>(ScalarStuff::VT_MAYBE_U32, None)
355 }
356 #[inline]
default_u32(&self) -> u32357 pub fn default_u32(&self) -> u32 {
358 self._tab.get::<u32>(ScalarStuff::VT_DEFAULT_U32, Some(42)).unwrap()
359 }
360 #[inline]
just_i64(&self) -> i64361 pub fn just_i64(&self) -> i64 {
362 self._tab.get::<i64>(ScalarStuff::VT_JUST_I64, Some(0)).unwrap()
363 }
364 #[inline]
maybe_i64(&self) -> Option<i64>365 pub fn maybe_i64(&self) -> Option<i64> {
366 self._tab.get::<i64>(ScalarStuff::VT_MAYBE_I64, None)
367 }
368 #[inline]
default_i64(&self) -> i64369 pub fn default_i64(&self) -> i64 {
370 self._tab.get::<i64>(ScalarStuff::VT_DEFAULT_I64, Some(42)).unwrap()
371 }
372 #[inline]
just_u64(&self) -> u64373 pub fn just_u64(&self) -> u64 {
374 self._tab.get::<u64>(ScalarStuff::VT_JUST_U64, Some(0)).unwrap()
375 }
376 #[inline]
maybe_u64(&self) -> Option<u64>377 pub fn maybe_u64(&self) -> Option<u64> {
378 self._tab.get::<u64>(ScalarStuff::VT_MAYBE_U64, None)
379 }
380 #[inline]
default_u64(&self) -> u64381 pub fn default_u64(&self) -> u64 {
382 self._tab.get::<u64>(ScalarStuff::VT_DEFAULT_U64, Some(42)).unwrap()
383 }
384 #[inline]
just_f32(&self) -> f32385 pub fn just_f32(&self) -> f32 {
386 self._tab.get::<f32>(ScalarStuff::VT_JUST_F32, Some(0.0)).unwrap()
387 }
388 #[inline]
maybe_f32(&self) -> Option<f32>389 pub fn maybe_f32(&self) -> Option<f32> {
390 self._tab.get::<f32>(ScalarStuff::VT_MAYBE_F32, None)
391 }
392 #[inline]
default_f32(&self) -> f32393 pub fn default_f32(&self) -> f32 {
394 self._tab.get::<f32>(ScalarStuff::VT_DEFAULT_F32, Some(42.0)).unwrap()
395 }
396 #[inline]
just_f64(&self) -> f64397 pub fn just_f64(&self) -> f64 {
398 self._tab.get::<f64>(ScalarStuff::VT_JUST_F64, Some(0.0)).unwrap()
399 }
400 #[inline]
maybe_f64(&self) -> Option<f64>401 pub fn maybe_f64(&self) -> Option<f64> {
402 self._tab.get::<f64>(ScalarStuff::VT_MAYBE_F64, None)
403 }
404 #[inline]
default_f64(&self) -> f64405 pub fn default_f64(&self) -> f64 {
406 self._tab.get::<f64>(ScalarStuff::VT_DEFAULT_F64, Some(42.0)).unwrap()
407 }
408 #[inline]
just_bool(&self) -> bool409 pub fn just_bool(&self) -> bool {
410 self._tab.get::<bool>(ScalarStuff::VT_JUST_BOOL, Some(false)).unwrap()
411 }
412 #[inline]
maybe_bool(&self) -> Option<bool>413 pub fn maybe_bool(&self) -> Option<bool> {
414 self._tab.get::<bool>(ScalarStuff::VT_MAYBE_BOOL, None)
415 }
416 #[inline]
default_bool(&self) -> bool417 pub fn default_bool(&self) -> bool {
418 self._tab.get::<bool>(ScalarStuff::VT_DEFAULT_BOOL, Some(true)).unwrap()
419 }
420 #[inline]
just_enum(&self) -> OptionalByte421 pub fn just_enum(&self) -> OptionalByte {
422 self._tab.get::<OptionalByte>(ScalarStuff::VT_JUST_ENUM, Some(OptionalByte::None)).unwrap()
423 }
424 #[inline]
maybe_enum(&self) -> Option<OptionalByte>425 pub fn maybe_enum(&self) -> Option<OptionalByte> {
426 self._tab.get::<OptionalByte>(ScalarStuff::VT_MAYBE_ENUM, None)
427 }
428 #[inline]
default_enum(&self) -> OptionalByte429 pub fn default_enum(&self) -> OptionalByte {
430 self._tab.get::<OptionalByte>(ScalarStuff::VT_DEFAULT_ENUM, Some(OptionalByte::One)).unwrap()
431 }
432 }
433
434 impl flatbuffers::Verifiable for ScalarStuff<'_> {
435 #[inline]
run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFlatbuffer>436 fn run_verifier(
437 v: &mut flatbuffers::Verifier, pos: usize
438 ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
439 use self::flatbuffers::Verifiable;
440 v.visit_table(pos)?
441 .visit_field::<i8>(&"just_i8", Self::VT_JUST_I8, false)?
442 .visit_field::<i8>(&"maybe_i8", Self::VT_MAYBE_I8, false)?
443 .visit_field::<i8>(&"default_i8", Self::VT_DEFAULT_I8, false)?
444 .visit_field::<u8>(&"just_u8", Self::VT_JUST_U8, false)?
445 .visit_field::<u8>(&"maybe_u8", Self::VT_MAYBE_U8, false)?
446 .visit_field::<u8>(&"default_u8", Self::VT_DEFAULT_U8, false)?
447 .visit_field::<i16>(&"just_i16", Self::VT_JUST_I16, false)?
448 .visit_field::<i16>(&"maybe_i16", Self::VT_MAYBE_I16, false)?
449 .visit_field::<i16>(&"default_i16", Self::VT_DEFAULT_I16, false)?
450 .visit_field::<u16>(&"just_u16", Self::VT_JUST_U16, false)?
451 .visit_field::<u16>(&"maybe_u16", Self::VT_MAYBE_U16, false)?
452 .visit_field::<u16>(&"default_u16", Self::VT_DEFAULT_U16, false)?
453 .visit_field::<i32>(&"just_i32", Self::VT_JUST_I32, false)?
454 .visit_field::<i32>(&"maybe_i32", Self::VT_MAYBE_I32, false)?
455 .visit_field::<i32>(&"default_i32", Self::VT_DEFAULT_I32, false)?
456 .visit_field::<u32>(&"just_u32", Self::VT_JUST_U32, false)?
457 .visit_field::<u32>(&"maybe_u32", Self::VT_MAYBE_U32, false)?
458 .visit_field::<u32>(&"default_u32", Self::VT_DEFAULT_U32, false)?
459 .visit_field::<i64>(&"just_i64", Self::VT_JUST_I64, false)?
460 .visit_field::<i64>(&"maybe_i64", Self::VT_MAYBE_I64, false)?
461 .visit_field::<i64>(&"default_i64", Self::VT_DEFAULT_I64, false)?
462 .visit_field::<u64>(&"just_u64", Self::VT_JUST_U64, false)?
463 .visit_field::<u64>(&"maybe_u64", Self::VT_MAYBE_U64, false)?
464 .visit_field::<u64>(&"default_u64", Self::VT_DEFAULT_U64, false)?
465 .visit_field::<f32>(&"just_f32", Self::VT_JUST_F32, false)?
466 .visit_field::<f32>(&"maybe_f32", Self::VT_MAYBE_F32, false)?
467 .visit_field::<f32>(&"default_f32", Self::VT_DEFAULT_F32, false)?
468 .visit_field::<f64>(&"just_f64", Self::VT_JUST_F64, false)?
469 .visit_field::<f64>(&"maybe_f64", Self::VT_MAYBE_F64, false)?
470 .visit_field::<f64>(&"default_f64", Self::VT_DEFAULT_F64, false)?
471 .visit_field::<bool>(&"just_bool", Self::VT_JUST_BOOL, false)?
472 .visit_field::<bool>(&"maybe_bool", Self::VT_MAYBE_BOOL, false)?
473 .visit_field::<bool>(&"default_bool", Self::VT_DEFAULT_BOOL, false)?
474 .visit_field::<OptionalByte>(&"just_enum", Self::VT_JUST_ENUM, false)?
475 .visit_field::<OptionalByte>(&"maybe_enum", Self::VT_MAYBE_ENUM, false)?
476 .visit_field::<OptionalByte>(&"default_enum", Self::VT_DEFAULT_ENUM, false)?
477 .finish();
478 Ok(())
479 }
480 }
481 pub struct ScalarStuffArgs {
482 pub just_i8: i8,
483 pub maybe_i8: Option<i8>,
484 pub default_i8: i8,
485 pub just_u8: u8,
486 pub maybe_u8: Option<u8>,
487 pub default_u8: u8,
488 pub just_i16: i16,
489 pub maybe_i16: Option<i16>,
490 pub default_i16: i16,
491 pub just_u16: u16,
492 pub maybe_u16: Option<u16>,
493 pub default_u16: u16,
494 pub just_i32: i32,
495 pub maybe_i32: Option<i32>,
496 pub default_i32: i32,
497 pub just_u32: u32,
498 pub maybe_u32: Option<u32>,
499 pub default_u32: u32,
500 pub just_i64: i64,
501 pub maybe_i64: Option<i64>,
502 pub default_i64: i64,
503 pub just_u64: u64,
504 pub maybe_u64: Option<u64>,
505 pub default_u64: u64,
506 pub just_f32: f32,
507 pub maybe_f32: Option<f32>,
508 pub default_f32: f32,
509 pub just_f64: f64,
510 pub maybe_f64: Option<f64>,
511 pub default_f64: f64,
512 pub just_bool: bool,
513 pub maybe_bool: Option<bool>,
514 pub default_bool: bool,
515 pub just_enum: OptionalByte,
516 pub maybe_enum: Option<OptionalByte>,
517 pub default_enum: OptionalByte,
518 }
519 impl<'a> Default for ScalarStuffArgs {
520 #[inline]
default() -> Self521 fn default() -> Self {
522 ScalarStuffArgs {
523 just_i8: 0,
524 maybe_i8: None,
525 default_i8: 42,
526 just_u8: 0,
527 maybe_u8: None,
528 default_u8: 42,
529 just_i16: 0,
530 maybe_i16: None,
531 default_i16: 42,
532 just_u16: 0,
533 maybe_u16: None,
534 default_u16: 42,
535 just_i32: 0,
536 maybe_i32: None,
537 default_i32: 42,
538 just_u32: 0,
539 maybe_u32: None,
540 default_u32: 42,
541 just_i64: 0,
542 maybe_i64: None,
543 default_i64: 42,
544 just_u64: 0,
545 maybe_u64: None,
546 default_u64: 42,
547 just_f32: 0.0,
548 maybe_f32: None,
549 default_f32: 42.0,
550 just_f64: 0.0,
551 maybe_f64: None,
552 default_f64: 42.0,
553 just_bool: false,
554 maybe_bool: None,
555 default_bool: true,
556 just_enum: OptionalByte::None,
557 maybe_enum: None,
558 default_enum: OptionalByte::One,
559 }
560 }
561 }
562 pub struct ScalarStuffBuilder<'a: 'b, 'b> {
563 fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
564 start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
565 }
566 impl<'a: 'b, 'b> ScalarStuffBuilder<'a, 'b> {
567 #[inline]
add_just_i8(&mut self, just_i8: i8)568 pub fn add_just_i8(&mut self, just_i8: i8) {
569 self.fbb_.push_slot::<i8>(ScalarStuff::VT_JUST_I8, just_i8, 0);
570 }
571 #[inline]
add_maybe_i8(&mut self, maybe_i8: i8)572 pub fn add_maybe_i8(&mut self, maybe_i8: i8) {
573 self.fbb_.push_slot_always::<i8>(ScalarStuff::VT_MAYBE_I8, maybe_i8);
574 }
575 #[inline]
add_default_i8(&mut self, default_i8: i8)576 pub fn add_default_i8(&mut self, default_i8: i8) {
577 self.fbb_.push_slot::<i8>(ScalarStuff::VT_DEFAULT_I8, default_i8, 42);
578 }
579 #[inline]
add_just_u8(&mut self, just_u8: u8)580 pub fn add_just_u8(&mut self, just_u8: u8) {
581 self.fbb_.push_slot::<u8>(ScalarStuff::VT_JUST_U8, just_u8, 0);
582 }
583 #[inline]
add_maybe_u8(&mut self, maybe_u8: u8)584 pub fn add_maybe_u8(&mut self, maybe_u8: u8) {
585 self.fbb_.push_slot_always::<u8>(ScalarStuff::VT_MAYBE_U8, maybe_u8);
586 }
587 #[inline]
add_default_u8(&mut self, default_u8: u8)588 pub fn add_default_u8(&mut self, default_u8: u8) {
589 self.fbb_.push_slot::<u8>(ScalarStuff::VT_DEFAULT_U8, default_u8, 42);
590 }
591 #[inline]
add_just_i16(&mut self, just_i16: i16)592 pub fn add_just_i16(&mut self, just_i16: i16) {
593 self.fbb_.push_slot::<i16>(ScalarStuff::VT_JUST_I16, just_i16, 0);
594 }
595 #[inline]
add_maybe_i16(&mut self, maybe_i16: i16)596 pub fn add_maybe_i16(&mut self, maybe_i16: i16) {
597 self.fbb_.push_slot_always::<i16>(ScalarStuff::VT_MAYBE_I16, maybe_i16);
598 }
599 #[inline]
add_default_i16(&mut self, default_i16: i16)600 pub fn add_default_i16(&mut self, default_i16: i16) {
601 self.fbb_.push_slot::<i16>(ScalarStuff::VT_DEFAULT_I16, default_i16, 42);
602 }
603 #[inline]
add_just_u16(&mut self, just_u16: u16)604 pub fn add_just_u16(&mut self, just_u16: u16) {
605 self.fbb_.push_slot::<u16>(ScalarStuff::VT_JUST_U16, just_u16, 0);
606 }
607 #[inline]
add_maybe_u16(&mut self, maybe_u16: u16)608 pub fn add_maybe_u16(&mut self, maybe_u16: u16) {
609 self.fbb_.push_slot_always::<u16>(ScalarStuff::VT_MAYBE_U16, maybe_u16);
610 }
611 #[inline]
add_default_u16(&mut self, default_u16: u16)612 pub fn add_default_u16(&mut self, default_u16: u16) {
613 self.fbb_.push_slot::<u16>(ScalarStuff::VT_DEFAULT_U16, default_u16, 42);
614 }
615 #[inline]
add_just_i32(&mut self, just_i32: i32)616 pub fn add_just_i32(&mut self, just_i32: i32) {
617 self.fbb_.push_slot::<i32>(ScalarStuff::VT_JUST_I32, just_i32, 0);
618 }
619 #[inline]
add_maybe_i32(&mut self, maybe_i32: i32)620 pub fn add_maybe_i32(&mut self, maybe_i32: i32) {
621 self.fbb_.push_slot_always::<i32>(ScalarStuff::VT_MAYBE_I32, maybe_i32);
622 }
623 #[inline]
add_default_i32(&mut self, default_i32: i32)624 pub fn add_default_i32(&mut self, default_i32: i32) {
625 self.fbb_.push_slot::<i32>(ScalarStuff::VT_DEFAULT_I32, default_i32, 42);
626 }
627 #[inline]
add_just_u32(&mut self, just_u32: u32)628 pub fn add_just_u32(&mut self, just_u32: u32) {
629 self.fbb_.push_slot::<u32>(ScalarStuff::VT_JUST_U32, just_u32, 0);
630 }
631 #[inline]
add_maybe_u32(&mut self, maybe_u32: u32)632 pub fn add_maybe_u32(&mut self, maybe_u32: u32) {
633 self.fbb_.push_slot_always::<u32>(ScalarStuff::VT_MAYBE_U32, maybe_u32);
634 }
635 #[inline]
add_default_u32(&mut self, default_u32: u32)636 pub fn add_default_u32(&mut self, default_u32: u32) {
637 self.fbb_.push_slot::<u32>(ScalarStuff::VT_DEFAULT_U32, default_u32, 42);
638 }
639 #[inline]
add_just_i64(&mut self, just_i64: i64)640 pub fn add_just_i64(&mut self, just_i64: i64) {
641 self.fbb_.push_slot::<i64>(ScalarStuff::VT_JUST_I64, just_i64, 0);
642 }
643 #[inline]
add_maybe_i64(&mut self, maybe_i64: i64)644 pub fn add_maybe_i64(&mut self, maybe_i64: i64) {
645 self.fbb_.push_slot_always::<i64>(ScalarStuff::VT_MAYBE_I64, maybe_i64);
646 }
647 #[inline]
add_default_i64(&mut self, default_i64: i64)648 pub fn add_default_i64(&mut self, default_i64: i64) {
649 self.fbb_.push_slot::<i64>(ScalarStuff::VT_DEFAULT_I64, default_i64, 42);
650 }
651 #[inline]
add_just_u64(&mut self, just_u64: u64)652 pub fn add_just_u64(&mut self, just_u64: u64) {
653 self.fbb_.push_slot::<u64>(ScalarStuff::VT_JUST_U64, just_u64, 0);
654 }
655 #[inline]
add_maybe_u64(&mut self, maybe_u64: u64)656 pub fn add_maybe_u64(&mut self, maybe_u64: u64) {
657 self.fbb_.push_slot_always::<u64>(ScalarStuff::VT_MAYBE_U64, maybe_u64);
658 }
659 #[inline]
add_default_u64(&mut self, default_u64: u64)660 pub fn add_default_u64(&mut self, default_u64: u64) {
661 self.fbb_.push_slot::<u64>(ScalarStuff::VT_DEFAULT_U64, default_u64, 42);
662 }
663 #[inline]
add_just_f32(&mut self, just_f32: f32)664 pub fn add_just_f32(&mut self, just_f32: f32) {
665 self.fbb_.push_slot::<f32>(ScalarStuff::VT_JUST_F32, just_f32, 0.0);
666 }
667 #[inline]
add_maybe_f32(&mut self, maybe_f32: f32)668 pub fn add_maybe_f32(&mut self, maybe_f32: f32) {
669 self.fbb_.push_slot_always::<f32>(ScalarStuff::VT_MAYBE_F32, maybe_f32);
670 }
671 #[inline]
add_default_f32(&mut self, default_f32: f32)672 pub fn add_default_f32(&mut self, default_f32: f32) {
673 self.fbb_.push_slot::<f32>(ScalarStuff::VT_DEFAULT_F32, default_f32, 42.0);
674 }
675 #[inline]
add_just_f64(&mut self, just_f64: f64)676 pub fn add_just_f64(&mut self, just_f64: f64) {
677 self.fbb_.push_slot::<f64>(ScalarStuff::VT_JUST_F64, just_f64, 0.0);
678 }
679 #[inline]
add_maybe_f64(&mut self, maybe_f64: f64)680 pub fn add_maybe_f64(&mut self, maybe_f64: f64) {
681 self.fbb_.push_slot_always::<f64>(ScalarStuff::VT_MAYBE_F64, maybe_f64);
682 }
683 #[inline]
add_default_f64(&mut self, default_f64: f64)684 pub fn add_default_f64(&mut self, default_f64: f64) {
685 self.fbb_.push_slot::<f64>(ScalarStuff::VT_DEFAULT_F64, default_f64, 42.0);
686 }
687 #[inline]
add_just_bool(&mut self, just_bool: bool)688 pub fn add_just_bool(&mut self, just_bool: bool) {
689 self.fbb_.push_slot::<bool>(ScalarStuff::VT_JUST_BOOL, just_bool, false);
690 }
691 #[inline]
add_maybe_bool(&mut self, maybe_bool: bool)692 pub fn add_maybe_bool(&mut self, maybe_bool: bool) {
693 self.fbb_.push_slot_always::<bool>(ScalarStuff::VT_MAYBE_BOOL, maybe_bool);
694 }
695 #[inline]
add_default_bool(&mut self, default_bool: bool)696 pub fn add_default_bool(&mut self, default_bool: bool) {
697 self.fbb_.push_slot::<bool>(ScalarStuff::VT_DEFAULT_BOOL, default_bool, true);
698 }
699 #[inline]
add_just_enum(&mut self, just_enum: OptionalByte)700 pub fn add_just_enum(&mut self, just_enum: OptionalByte) {
701 self.fbb_.push_slot::<OptionalByte>(ScalarStuff::VT_JUST_ENUM, just_enum, OptionalByte::None);
702 }
703 #[inline]
add_maybe_enum(&mut self, maybe_enum: OptionalByte)704 pub fn add_maybe_enum(&mut self, maybe_enum: OptionalByte) {
705 self.fbb_.push_slot_always::<OptionalByte>(ScalarStuff::VT_MAYBE_ENUM, maybe_enum);
706 }
707 #[inline]
add_default_enum(&mut self, default_enum: OptionalByte)708 pub fn add_default_enum(&mut self, default_enum: OptionalByte) {
709 self.fbb_.push_slot::<OptionalByte>(ScalarStuff::VT_DEFAULT_ENUM, default_enum, OptionalByte::One);
710 }
711 #[inline]
new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ScalarStuffBuilder<'a, 'b>712 pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ScalarStuffBuilder<'a, 'b> {
713 let start = _fbb.start_table();
714 ScalarStuffBuilder {
715 fbb_: _fbb,
716 start_: start,
717 }
718 }
719 #[inline]
finish(self) -> flatbuffers::WIPOffset<ScalarStuff<'a>>720 pub fn finish(self) -> flatbuffers::WIPOffset<ScalarStuff<'a>> {
721 let o = self.fbb_.end_table(self.start_);
722 flatbuffers::WIPOffset::new(o.value())
723 }
724 }
725
726 impl std::fmt::Debug for ScalarStuff<'_> {
fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result727 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
728 let mut ds = f.debug_struct("ScalarStuff");
729 ds.field("just_i8", &self.just_i8());
730 ds.field("maybe_i8", &self.maybe_i8());
731 ds.field("default_i8", &self.default_i8());
732 ds.field("just_u8", &self.just_u8());
733 ds.field("maybe_u8", &self.maybe_u8());
734 ds.field("default_u8", &self.default_u8());
735 ds.field("just_i16", &self.just_i16());
736 ds.field("maybe_i16", &self.maybe_i16());
737 ds.field("default_i16", &self.default_i16());
738 ds.field("just_u16", &self.just_u16());
739 ds.field("maybe_u16", &self.maybe_u16());
740 ds.field("default_u16", &self.default_u16());
741 ds.field("just_i32", &self.just_i32());
742 ds.field("maybe_i32", &self.maybe_i32());
743 ds.field("default_i32", &self.default_i32());
744 ds.field("just_u32", &self.just_u32());
745 ds.field("maybe_u32", &self.maybe_u32());
746 ds.field("default_u32", &self.default_u32());
747 ds.field("just_i64", &self.just_i64());
748 ds.field("maybe_i64", &self.maybe_i64());
749 ds.field("default_i64", &self.default_i64());
750 ds.field("just_u64", &self.just_u64());
751 ds.field("maybe_u64", &self.maybe_u64());
752 ds.field("default_u64", &self.default_u64());
753 ds.field("just_f32", &self.just_f32());
754 ds.field("maybe_f32", &self.maybe_f32());
755 ds.field("default_f32", &self.default_f32());
756 ds.field("just_f64", &self.just_f64());
757 ds.field("maybe_f64", &self.maybe_f64());
758 ds.field("default_f64", &self.default_f64());
759 ds.field("just_bool", &self.just_bool());
760 ds.field("maybe_bool", &self.maybe_bool());
761 ds.field("default_bool", &self.default_bool());
762 ds.field("just_enum", &self.just_enum());
763 ds.field("maybe_enum", &self.maybe_enum());
764 ds.field("default_enum", &self.default_enum());
765 ds.finish()
766 }
767 }
768 #[non_exhaustive]
769 #[derive(Debug, Clone, PartialEq)]
770 pub struct ScalarStuffT {
771 pub just_i8: i8,
772 pub maybe_i8: Option<i8>,
773 pub default_i8: i8,
774 pub just_u8: u8,
775 pub maybe_u8: Option<u8>,
776 pub default_u8: u8,
777 pub just_i16: i16,
778 pub maybe_i16: Option<i16>,
779 pub default_i16: i16,
780 pub just_u16: u16,
781 pub maybe_u16: Option<u16>,
782 pub default_u16: u16,
783 pub just_i32: i32,
784 pub maybe_i32: Option<i32>,
785 pub default_i32: i32,
786 pub just_u32: u32,
787 pub maybe_u32: Option<u32>,
788 pub default_u32: u32,
789 pub just_i64: i64,
790 pub maybe_i64: Option<i64>,
791 pub default_i64: i64,
792 pub just_u64: u64,
793 pub maybe_u64: Option<u64>,
794 pub default_u64: u64,
795 pub just_f32: f32,
796 pub maybe_f32: Option<f32>,
797 pub default_f32: f32,
798 pub just_f64: f64,
799 pub maybe_f64: Option<f64>,
800 pub default_f64: f64,
801 pub just_bool: bool,
802 pub maybe_bool: Option<bool>,
803 pub default_bool: bool,
804 pub just_enum: OptionalByte,
805 pub maybe_enum: Option<OptionalByte>,
806 pub default_enum: OptionalByte,
807 }
808 impl Default for ScalarStuffT {
default() -> Self809 fn default() -> Self {
810 Self {
811 just_i8: 0,
812 maybe_i8: None,
813 default_i8: 42,
814 just_u8: 0,
815 maybe_u8: None,
816 default_u8: 42,
817 just_i16: 0,
818 maybe_i16: None,
819 default_i16: 42,
820 just_u16: 0,
821 maybe_u16: None,
822 default_u16: 42,
823 just_i32: 0,
824 maybe_i32: None,
825 default_i32: 42,
826 just_u32: 0,
827 maybe_u32: None,
828 default_u32: 42,
829 just_i64: 0,
830 maybe_i64: None,
831 default_i64: 42,
832 just_u64: 0,
833 maybe_u64: None,
834 default_u64: 42,
835 just_f32: 0.0,
836 maybe_f32: None,
837 default_f32: 42.0,
838 just_f64: 0.0,
839 maybe_f64: None,
840 default_f64: 42.0,
841 just_bool: false,
842 maybe_bool: None,
843 default_bool: true,
844 just_enum: OptionalByte::None,
845 maybe_enum: None,
846 default_enum: OptionalByte::One,
847 }
848 }
849 }
850 impl ScalarStuffT {
pack<'b>( &self, _fbb: &mut flatbuffers::FlatBufferBuilder<'b> ) -> flatbuffers::WIPOffset<ScalarStuff<'b>>851 pub fn pack<'b>(
852 &self,
853 _fbb: &mut flatbuffers::FlatBufferBuilder<'b>
854 ) -> flatbuffers::WIPOffset<ScalarStuff<'b>> {
855 let just_i8 = self.just_i8;
856 let maybe_i8 = self.maybe_i8;
857 let default_i8 = self.default_i8;
858 let just_u8 = self.just_u8;
859 let maybe_u8 = self.maybe_u8;
860 let default_u8 = self.default_u8;
861 let just_i16 = self.just_i16;
862 let maybe_i16 = self.maybe_i16;
863 let default_i16 = self.default_i16;
864 let just_u16 = self.just_u16;
865 let maybe_u16 = self.maybe_u16;
866 let default_u16 = self.default_u16;
867 let just_i32 = self.just_i32;
868 let maybe_i32 = self.maybe_i32;
869 let default_i32 = self.default_i32;
870 let just_u32 = self.just_u32;
871 let maybe_u32 = self.maybe_u32;
872 let default_u32 = self.default_u32;
873 let just_i64 = self.just_i64;
874 let maybe_i64 = self.maybe_i64;
875 let default_i64 = self.default_i64;
876 let just_u64 = self.just_u64;
877 let maybe_u64 = self.maybe_u64;
878 let default_u64 = self.default_u64;
879 let just_f32 = self.just_f32;
880 let maybe_f32 = self.maybe_f32;
881 let default_f32 = self.default_f32;
882 let just_f64 = self.just_f64;
883 let maybe_f64 = self.maybe_f64;
884 let default_f64 = self.default_f64;
885 let just_bool = self.just_bool;
886 let maybe_bool = self.maybe_bool;
887 let default_bool = self.default_bool;
888 let just_enum = self.just_enum;
889 let maybe_enum = self.maybe_enum;
890 let default_enum = self.default_enum;
891 ScalarStuff::create(_fbb, &ScalarStuffArgs{
892 just_i8,
893 maybe_i8,
894 default_i8,
895 just_u8,
896 maybe_u8,
897 default_u8,
898 just_i16,
899 maybe_i16,
900 default_i16,
901 just_u16,
902 maybe_u16,
903 default_u16,
904 just_i32,
905 maybe_i32,
906 default_i32,
907 just_u32,
908 maybe_u32,
909 default_u32,
910 just_i64,
911 maybe_i64,
912 default_i64,
913 just_u64,
914 maybe_u64,
915 default_u64,
916 just_f32,
917 maybe_f32,
918 default_f32,
919 just_f64,
920 maybe_f64,
921 default_f64,
922 just_bool,
923 maybe_bool,
924 default_bool,
925 just_enum,
926 maybe_enum,
927 default_enum,
928 })
929 }
930 }
931 #[inline]
932 #[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
get_root_as_scalar_stuff<'a>(buf: &'a [u8]) -> ScalarStuff<'a>933 pub fn get_root_as_scalar_stuff<'a>(buf: &'a [u8]) -> ScalarStuff<'a> {
934 unsafe { flatbuffers::root_unchecked::<ScalarStuff<'a>>(buf) }
935 }
936
937 #[inline]
938 #[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
get_size_prefixed_root_as_scalar_stuff<'a>(buf: &'a [u8]) -> ScalarStuff<'a>939 pub fn get_size_prefixed_root_as_scalar_stuff<'a>(buf: &'a [u8]) -> ScalarStuff<'a> {
940 unsafe { flatbuffers::size_prefixed_root_unchecked::<ScalarStuff<'a>>(buf) }
941 }
942
943 #[inline]
944 /// Verifies that a buffer of bytes contains a `ScalarStuff`
945 /// and returns it.
946 /// Note that verification is still experimental and may not
947 /// catch every error, or be maximally performant. For the
948 /// previous, unchecked, behavior use
949 /// `root_as_scalar_stuff_unchecked`.
root_as_scalar_stuff(buf: &[u8]) -> Result<ScalarStuff, flatbuffers::InvalidFlatbuffer>950 pub fn root_as_scalar_stuff(buf: &[u8]) -> Result<ScalarStuff, flatbuffers::InvalidFlatbuffer> {
951 flatbuffers::root::<ScalarStuff>(buf)
952 }
953 #[inline]
954 /// Verifies that a buffer of bytes contains a size prefixed
955 /// `ScalarStuff` and returns it.
956 /// Note that verification is still experimental and may not
957 /// catch every error, or be maximally performant. For the
958 /// previous, unchecked, behavior use
959 /// `size_prefixed_root_as_scalar_stuff_unchecked`.
size_prefixed_root_as_scalar_stuff(buf: &[u8]) -> Result<ScalarStuff, flatbuffers::InvalidFlatbuffer>960 pub fn size_prefixed_root_as_scalar_stuff(buf: &[u8]) -> Result<ScalarStuff, flatbuffers::InvalidFlatbuffer> {
961 flatbuffers::size_prefixed_root::<ScalarStuff>(buf)
962 }
963 #[inline]
964 /// Verifies, with the given options, that a buffer of bytes
965 /// contains a `ScalarStuff` and returns it.
966 /// Note that verification is still experimental and may not
967 /// catch every error, or be maximally performant. For the
968 /// previous, unchecked, behavior use
969 /// `root_as_scalar_stuff_unchecked`.
root_as_scalar_stuff_with_opts<'b, 'o>( opts: &'o flatbuffers::VerifierOptions, buf: &'b [u8], ) -> Result<ScalarStuff<'b>, flatbuffers::InvalidFlatbuffer>970 pub fn root_as_scalar_stuff_with_opts<'b, 'o>(
971 opts: &'o flatbuffers::VerifierOptions,
972 buf: &'b [u8],
973 ) -> Result<ScalarStuff<'b>, flatbuffers::InvalidFlatbuffer> {
974 flatbuffers::root_with_opts::<ScalarStuff<'b>>(opts, buf)
975 }
976 #[inline]
977 /// Verifies, with the given verifier options, that a buffer of
978 /// bytes contains a size prefixed `ScalarStuff` and returns
979 /// it. Note that verification is still experimental and may not
980 /// catch every error, or be maximally performant. For the
981 /// previous, unchecked, behavior use
982 /// `root_as_scalar_stuff_unchecked`.
size_prefixed_root_as_scalar_stuff_with_opts<'b, 'o>( opts: &'o flatbuffers::VerifierOptions, buf: &'b [u8], ) -> Result<ScalarStuff<'b>, flatbuffers::InvalidFlatbuffer>983 pub fn size_prefixed_root_as_scalar_stuff_with_opts<'b, 'o>(
984 opts: &'o flatbuffers::VerifierOptions,
985 buf: &'b [u8],
986 ) -> Result<ScalarStuff<'b>, flatbuffers::InvalidFlatbuffer> {
987 flatbuffers::size_prefixed_root_with_opts::<ScalarStuff<'b>>(opts, buf)
988 }
989 #[inline]
990 /// Assumes, without verification, that a buffer of bytes contains a ScalarStuff and returns it.
991 /// # Safety
992 /// Callers must trust the given bytes do indeed contain a valid `ScalarStuff`.
root_as_scalar_stuff_unchecked(buf: &[u8]) -> ScalarStuff993 pub unsafe fn root_as_scalar_stuff_unchecked(buf: &[u8]) -> ScalarStuff {
994 flatbuffers::root_unchecked::<ScalarStuff>(buf)
995 }
996 #[inline]
997 /// Assumes, without verification, that a buffer of bytes contains a size prefixed ScalarStuff and returns it.
998 /// # Safety
999 /// Callers must trust the given bytes do indeed contain a valid size prefixed `ScalarStuff`.
size_prefixed_root_as_scalar_stuff_unchecked(buf: &[u8]) -> ScalarStuff1000 pub unsafe fn size_prefixed_root_as_scalar_stuff_unchecked(buf: &[u8]) -> ScalarStuff {
1001 flatbuffers::size_prefixed_root_unchecked::<ScalarStuff>(buf)
1002 }
1003 pub const SCALAR_STUFF_IDENTIFIER: &str = "NULL";
1004
1005 #[inline]
scalar_stuff_buffer_has_identifier(buf: &[u8]) -> bool1006 pub fn scalar_stuff_buffer_has_identifier(buf: &[u8]) -> bool {
1007 flatbuffers::buffer_has_identifier(buf, SCALAR_STUFF_IDENTIFIER, false)
1008 }
1009
1010 #[inline]
scalar_stuff_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool1011 pub fn scalar_stuff_size_prefixed_buffer_has_identifier(buf: &[u8]) -> bool {
1012 flatbuffers::buffer_has_identifier(buf, SCALAR_STUFF_IDENTIFIER, true)
1013 }
1014
1015 pub const SCALAR_STUFF_EXTENSION: &str = "mon";
1016
1017 #[inline]
finish_scalar_stuff_buffer<'a, 'b>( fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<ScalarStuff<'a>>)1018 pub fn finish_scalar_stuff_buffer<'a, 'b>(
1019 fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1020 root: flatbuffers::WIPOffset<ScalarStuff<'a>>) {
1021 fbb.finish(root, Some(SCALAR_STUFF_IDENTIFIER));
1022 }
1023
1024 #[inline]
finish_size_prefixed_scalar_stuff_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<ScalarStuff<'a>>)1025 pub fn finish_size_prefixed_scalar_stuff_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<ScalarStuff<'a>>) {
1026 fbb.finish_size_prefixed(root, Some(SCALAR_STUFF_IDENTIFIER));
1027 }
1028 } // pub mod optional_scalars
1029
1030