1extern crate alloc;
9
10
11#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
12pub const ENUM_MIN_COMPRESSION: u8 = 0;
13#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
14pub const ENUM_MAX_COMPRESSION: u8 = 1;
15#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
16#[allow(non_camel_case_types)]
17pub const ENUM_VALUES_COMPRESSION: [Compression; 2] = [
18 Compression::None,
19 Compression::LZ4,
20];
21
22#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
24#[repr(transparent)]
25pub struct Compression(pub u8);
26#[allow(non_upper_case_globals)]
27impl Compression {
28 pub const None: Self = Self(0);
29 pub const LZ4: Self = Self(1);
30
31 pub const ENUM_MIN: u8 = 0;
32 pub const ENUM_MAX: u8 = 1;
33 pub const ENUM_VALUES: &'static [Self] = &[
34 Self::None,
35 Self::LZ4,
36 ];
37 pub fn variant_name(self) -> Option<&'static str> {
39 match self {
40 Self::None => Some("None"),
41 Self::LZ4 => Some("LZ4"),
42 _ => None,
43 }
44 }
45}
46impl ::core::fmt::Debug for Compression {
47 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
48 if let Some(name) = self.variant_name() {
49 f.write_str(name)
50 } else {
51 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
52 }
53 }
54}
55impl<'a> ::flatbuffers::Follow<'a> for Compression {
56 type Inner = Self;
57 #[inline]
58 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
59 let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
60 Self(b)
61 }
62}
63
64impl ::flatbuffers::Push for Compression {
65 type Output = Compression;
66 #[inline]
67 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
68 unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
69 }
70}
71
72impl ::flatbuffers::EndianScalar for Compression {
73 type Scalar = u8;
74 #[inline]
75 fn to_little_endian(self) -> u8 {
76 self.0.to_le()
77 }
78 #[inline]
79 #[allow(clippy::wrong_self_convention)]
80 fn from_little_endian(v: u8) -> Self {
81 let b = u8::from_le(v);
82 Self(b)
83 }
84}
85
86impl<'a> ::flatbuffers::Verifiable for Compression {
87 #[inline]
88 fn run_verifier(
89 v: &mut ::flatbuffers::Verifier, pos: usize
90 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
91 u8::run_verifier(v, pos)
92 }
93}
94
95impl ::flatbuffers::SimpleToVerifyInSlice for Compression {}
96#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
97pub const ENUM_MIN_PRECISION: u8 = 0;
98#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
99pub const ENUM_MAX_PRECISION: u8 = 1;
100#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
101#[allow(non_camel_case_types)]
102pub const ENUM_VALUES_PRECISION: [Precision; 2] = [
103 Precision::Inexact,
104 Precision::Exact,
105];
106
107#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
108#[repr(transparent)]
109pub struct Precision(pub u8);
110#[allow(non_upper_case_globals)]
111impl Precision {
112 pub const Inexact: Self = Self(0);
113 pub const Exact: Self = Self(1);
114
115 pub const ENUM_MIN: u8 = 0;
116 pub const ENUM_MAX: u8 = 1;
117 pub const ENUM_VALUES: &'static [Self] = &[
118 Self::Inexact,
119 Self::Exact,
120 ];
121 pub fn variant_name(self) -> Option<&'static str> {
123 match self {
124 Self::Inexact => Some("Inexact"),
125 Self::Exact => Some("Exact"),
126 _ => None,
127 }
128 }
129}
130impl ::core::fmt::Debug for Precision {
131 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
132 if let Some(name) = self.variant_name() {
133 f.write_str(name)
134 } else {
135 f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
136 }
137 }
138}
139impl<'a> ::flatbuffers::Follow<'a> for Precision {
140 type Inner = Self;
141 #[inline]
142 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
143 let b = unsafe { ::flatbuffers::read_scalar_at::<u8>(buf, loc) };
144 Self(b)
145 }
146}
147
148impl ::flatbuffers::Push for Precision {
149 type Output = Precision;
150 #[inline]
151 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
152 unsafe { ::flatbuffers::emplace_scalar::<u8>(dst, self.0) };
153 }
154}
155
156impl ::flatbuffers::EndianScalar for Precision {
157 type Scalar = u8;
158 #[inline]
159 fn to_little_endian(self) -> u8 {
160 self.0.to_le()
161 }
162 #[inline]
163 #[allow(clippy::wrong_self_convention)]
164 fn from_little_endian(v: u8) -> Self {
165 let b = u8::from_le(v);
166 Self(b)
167 }
168}
169
170impl<'a> ::flatbuffers::Verifiable for Precision {
171 #[inline]
172 fn run_verifier(
173 v: &mut ::flatbuffers::Verifier, pos: usize
174 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
175 u8::run_verifier(v, pos)
176 }
177}
178
179impl ::flatbuffers::SimpleToVerifyInSlice for Precision {}
180#[repr(transparent)]
183#[derive(Clone, Copy, PartialEq)]
184pub struct Buffer(pub [u8; 8]);
185impl Default for Buffer {
186 fn default() -> Self {
187 Self([0; 8])
188 }
189}
190impl ::core::fmt::Debug for Buffer {
191 fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
192 f.debug_struct("Buffer")
193 .field("padding", &self.padding())
194 .field("alignment_exponent", &self.alignment_exponent())
195 .field("compression", &self.compression())
196 .field("length", &self.length())
197 .finish()
198 }
199}
200
201impl ::flatbuffers::SimpleToVerifyInSlice for Buffer {}
202impl<'a> ::flatbuffers::Follow<'a> for Buffer {
203 type Inner = &'a Buffer;
204 #[inline]
205 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
206 unsafe { <&'a Buffer>::follow(buf, loc) }
207 }
208}
209impl<'a> ::flatbuffers::Follow<'a> for &'a Buffer {
210 type Inner = &'a Buffer;
211 #[inline]
212 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
213 unsafe { ::flatbuffers::follow_cast_ref::<Buffer>(buf, loc) }
214 }
215}
216impl<'b> ::flatbuffers::Push for Buffer {
217 type Output = Buffer;
218 #[inline]
219 unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
220 let src = unsafe { ::core::slice::from_raw_parts(self as *const Buffer as *const u8, <Self as ::flatbuffers::Push>::size()) };
221 dst.copy_from_slice(src);
222 }
223 #[inline]
224 fn alignment() -> ::flatbuffers::PushAlignment {
225 ::flatbuffers::PushAlignment::new(4)
226 }
227}
228
229impl<'a> ::flatbuffers::Verifiable for Buffer {
230 #[inline]
231 fn run_verifier(
232 v: &mut ::flatbuffers::Verifier, pos: usize
233 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
234 v.in_buffer::<Self>(pos)
235 }
236}
237
238impl<'a> Buffer {
239 #[allow(clippy::too_many_arguments)]
240 pub fn new(
241 padding: u16,
242 alignment_exponent: u8,
243 compression: Compression,
244 length: u32,
245 ) -> Self {
246 let mut s = Self([0; 8]);
247 s.set_padding(padding);
248 s.set_alignment_exponent(alignment_exponent);
249 s.set_compression(compression);
250 s.set_length(length);
251 s
252 }
253
254 pub fn padding(&self) -> u16 {
256 let mut mem = ::core::mem::MaybeUninit::<<u16 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
257 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
261 ::core::ptr::copy_nonoverlapping(
262 self.0[0..].as_ptr(),
263 mem.as_mut_ptr() as *mut u8,
264 ::core::mem::size_of::<<u16 as ::flatbuffers::EndianScalar>::Scalar>(),
265 );
266 mem.assume_init()
267 })
268 }
269
270 pub fn set_padding(&mut self, x: u16) {
271 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
272 unsafe {
276 ::core::ptr::copy_nonoverlapping(
277 &x_le as *const _ as *const u8,
278 self.0[0..].as_mut_ptr(),
279 ::core::mem::size_of::<<u16 as ::flatbuffers::EndianScalar>::Scalar>(),
280 );
281 }
282 }
283
284 pub fn alignment_exponent(&self) -> u8 {
286 let mut mem = ::core::mem::MaybeUninit::<<u8 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
287 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
291 ::core::ptr::copy_nonoverlapping(
292 self.0[2..].as_ptr(),
293 mem.as_mut_ptr() as *mut u8,
294 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
295 );
296 mem.assume_init()
297 })
298 }
299
300 pub fn set_alignment_exponent(&mut self, x: u8) {
301 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
302 unsafe {
306 ::core::ptr::copy_nonoverlapping(
307 &x_le as *const _ as *const u8,
308 self.0[2..].as_mut_ptr(),
309 ::core::mem::size_of::<<u8 as ::flatbuffers::EndianScalar>::Scalar>(),
310 );
311 }
312 }
313
314 pub fn compression(&self) -> Compression {
316 let mut mem = ::core::mem::MaybeUninit::<<Compression as ::flatbuffers::EndianScalar>::Scalar>::uninit();
317 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
321 ::core::ptr::copy_nonoverlapping(
322 self.0[3..].as_ptr(),
323 mem.as_mut_ptr() as *mut u8,
324 ::core::mem::size_of::<<Compression as ::flatbuffers::EndianScalar>::Scalar>(),
325 );
326 mem.assume_init()
327 })
328 }
329
330 pub fn set_compression(&mut self, x: Compression) {
331 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
332 unsafe {
336 ::core::ptr::copy_nonoverlapping(
337 &x_le as *const _ as *const u8,
338 self.0[3..].as_mut_ptr(),
339 ::core::mem::size_of::<<Compression as ::flatbuffers::EndianScalar>::Scalar>(),
340 );
341 }
342 }
343
344 pub fn length(&self) -> u32 {
346 let mut mem = ::core::mem::MaybeUninit::<<u32 as ::flatbuffers::EndianScalar>::Scalar>::uninit();
347 ::flatbuffers::EndianScalar::from_little_endian(unsafe {
351 ::core::ptr::copy_nonoverlapping(
352 self.0[4..].as_ptr(),
353 mem.as_mut_ptr() as *mut u8,
354 ::core::mem::size_of::<<u32 as ::flatbuffers::EndianScalar>::Scalar>(),
355 );
356 mem.assume_init()
357 })
358 }
359
360 pub fn set_length(&mut self, x: u32) {
361 let x_le = ::flatbuffers::EndianScalar::to_little_endian(x);
362 unsafe {
366 ::core::ptr::copy_nonoverlapping(
367 &x_le as *const _ as *const u8,
368 self.0[4..].as_mut_ptr(),
369 ::core::mem::size_of::<<u32 as ::flatbuffers::EndianScalar>::Scalar>(),
370 );
371 }
372 }
373
374}
375
376pub enum ArrayOffset {}
377#[derive(Copy, Clone, PartialEq)]
378
379pub struct Array<'a> {
382 pub _tab: ::flatbuffers::Table<'a>,
383}
384
385impl<'a> ::flatbuffers::Follow<'a> for Array<'a> {
386 type Inner = Array<'a>;
387 #[inline]
388 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
389 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
390 }
391}
392
393impl<'a> Array<'a> {
394 pub const VT_ROOT: ::flatbuffers::VOffsetT = 4;
395 pub const VT_BUFFERS: ::flatbuffers::VOffsetT = 6;
396
397 #[inline]
398 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
399 Array { _tab: table }
400 }
401 #[allow(unused_mut)]
402 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
403 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
404 args: &'args ArrayArgs<'args>
405 ) -> ::flatbuffers::WIPOffset<Array<'bldr>> {
406 let mut builder = ArrayBuilder::new(_fbb);
407 if let Some(x) = args.buffers { builder.add_buffers(x); }
408 if let Some(x) = args.root { builder.add_root(x); }
409 builder.finish()
410 }
411
412
413 #[inline]
415 pub fn root(&self) -> Option<ArrayNode<'a>> {
416 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<ArrayNode>>(Array::VT_ROOT, None)}
420 }
421 #[inline]
423 pub fn buffers(&self) -> Option<::flatbuffers::Vector<'a, Buffer>> {
424 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, Buffer>>>(Array::VT_BUFFERS, None)}
428 }
429}
430
431impl ::flatbuffers::Verifiable for Array<'_> {
432 #[inline]
433 fn run_verifier(
434 v: &mut ::flatbuffers::Verifier, pos: usize
435 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
436 v.visit_table(pos)?
437 .visit_field::<::flatbuffers::ForwardsUOffset<ArrayNode>>("root", Self::VT_ROOT, false)?
438 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, Buffer>>>("buffers", Self::VT_BUFFERS, false)?
439 .finish();
440 Ok(())
441 }
442}
443pub struct ArrayArgs<'a> {
444 pub root: Option<::flatbuffers::WIPOffset<ArrayNode<'a>>>,
445 pub buffers: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, Buffer>>>,
446}
447impl<'a> Default for ArrayArgs<'a> {
448 #[inline]
449 fn default() -> Self {
450 ArrayArgs {
451 root: None,
452 buffers: None,
453 }
454 }
455}
456
457pub struct ArrayBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
458 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
459 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
460}
461impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ArrayBuilder<'a, 'b, A> {
462 #[inline]
463 pub fn add_root(&mut self, root: ::flatbuffers::WIPOffset<ArrayNode<'b >>) {
464 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<ArrayNode>>(Array::VT_ROOT, root);
465 }
466 #[inline]
467 pub fn add_buffers(&mut self, buffers: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , Buffer>>) {
468 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(Array::VT_BUFFERS, buffers);
469 }
470 #[inline]
471 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ArrayBuilder<'a, 'b, A> {
472 let start = _fbb.start_table();
473 ArrayBuilder {
474 fbb_: _fbb,
475 start_: start,
476 }
477 }
478 #[inline]
479 pub fn finish(self) -> ::flatbuffers::WIPOffset<Array<'a>> {
480 let o = self.fbb_.end_table(self.start_);
481 ::flatbuffers::WIPOffset::new(o.value())
482 }
483}
484
485impl ::core::fmt::Debug for Array<'_> {
486 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
487 let mut ds = f.debug_struct("Array");
488 ds.field("root", &self.root());
489 ds.field("buffers", &self.buffers());
490 ds.finish()
491 }
492}
493pub enum ArrayNodeOffset {}
494#[derive(Copy, Clone, PartialEq)]
495
496pub struct ArrayNode<'a> {
497 pub _tab: ::flatbuffers::Table<'a>,
498}
499
500impl<'a> ::flatbuffers::Follow<'a> for ArrayNode<'a> {
501 type Inner = ArrayNode<'a>;
502 #[inline]
503 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
504 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
505 }
506}
507
508impl<'a> ArrayNode<'a> {
509 pub const VT_ENCODING: ::flatbuffers::VOffsetT = 4;
510 pub const VT_METADATA: ::flatbuffers::VOffsetT = 6;
511 pub const VT_CHILDREN: ::flatbuffers::VOffsetT = 8;
512 pub const VT_BUFFERS: ::flatbuffers::VOffsetT = 10;
513 pub const VT_STATS: ::flatbuffers::VOffsetT = 12;
514
515 #[inline]
516 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
517 ArrayNode { _tab: table }
518 }
519 #[allow(unused_mut)]
520 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
521 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
522 args: &'args ArrayNodeArgs<'args>
523 ) -> ::flatbuffers::WIPOffset<ArrayNode<'bldr>> {
524 let mut builder = ArrayNodeBuilder::new(_fbb);
525 if let Some(x) = args.stats { builder.add_stats(x); }
526 if let Some(x) = args.buffers { builder.add_buffers(x); }
527 if let Some(x) = args.children { builder.add_children(x); }
528 if let Some(x) = args.metadata { builder.add_metadata(x); }
529 builder.add_encoding(args.encoding);
530 builder.finish()
531 }
532
533
534 #[inline]
535 pub fn encoding(&self) -> u16 {
536 unsafe { self._tab.get::<u16>(ArrayNode::VT_ENCODING, Some(0)).unwrap()}
540 }
541 #[inline]
542 pub fn metadata(&self) -> Option<::flatbuffers::Vector<'a, u8>> {
543 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, u8>>>(ArrayNode::VT_METADATA, None)}
547 }
548 #[inline]
549 pub fn children(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<ArrayNode<'a>>>> {
550 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<ArrayNode>>>>(ArrayNode::VT_CHILDREN, None)}
554 }
555 #[inline]
556 pub fn buffers(&self) -> Option<::flatbuffers::Vector<'a, u16>> {
557 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, u16>>>(ArrayNode::VT_BUFFERS, None)}
561 }
562 #[inline]
563 pub fn stats(&self) -> Option<ArrayStats<'a>> {
564 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<ArrayStats>>(ArrayNode::VT_STATS, None)}
568 }
569}
570
571impl ::flatbuffers::Verifiable for ArrayNode<'_> {
572 #[inline]
573 fn run_verifier(
574 v: &mut ::flatbuffers::Verifier, pos: usize
575 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
576 v.visit_table(pos)?
577 .visit_field::<u16>("encoding", Self::VT_ENCODING, false)?
578 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, u8>>>("metadata", Self::VT_METADATA, false)?
579 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<ArrayNode>>>>("children", Self::VT_CHILDREN, false)?
580 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, u16>>>("buffers", Self::VT_BUFFERS, false)?
581 .visit_field::<::flatbuffers::ForwardsUOffset<ArrayStats>>("stats", Self::VT_STATS, false)?
582 .finish();
583 Ok(())
584 }
585}
586pub struct ArrayNodeArgs<'a> {
587 pub encoding: u16,
588 pub metadata: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, u8>>>,
589 pub children: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<ArrayNode<'a>>>>>,
590 pub buffers: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, u16>>>,
591 pub stats: Option<::flatbuffers::WIPOffset<ArrayStats<'a>>>,
592}
593impl<'a> Default for ArrayNodeArgs<'a> {
594 #[inline]
595 fn default() -> Self {
596 ArrayNodeArgs {
597 encoding: 0,
598 metadata: None,
599 children: None,
600 buffers: None,
601 stats: None,
602 }
603 }
604}
605
606pub struct ArrayNodeBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
607 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
608 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
609}
610impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ArrayNodeBuilder<'a, 'b, A> {
611 #[inline]
612 pub fn add_encoding(&mut self, encoding: u16) {
613 self.fbb_.push_slot::<u16>(ArrayNode::VT_ENCODING, encoding, 0);
614 }
615 #[inline]
616 pub fn add_metadata(&mut self, metadata: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , u8>>) {
617 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ArrayNode::VT_METADATA, metadata);
618 }
619 #[inline]
620 pub fn add_children(&mut self, children: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<ArrayNode<'b >>>>) {
621 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ArrayNode::VT_CHILDREN, children);
622 }
623 #[inline]
624 pub fn add_buffers(&mut self, buffers: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , u16>>) {
625 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ArrayNode::VT_BUFFERS, buffers);
626 }
627 #[inline]
628 pub fn add_stats(&mut self, stats: ::flatbuffers::WIPOffset<ArrayStats<'b >>) {
629 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<ArrayStats>>(ArrayNode::VT_STATS, stats);
630 }
631 #[inline]
632 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ArrayNodeBuilder<'a, 'b, A> {
633 let start = _fbb.start_table();
634 ArrayNodeBuilder {
635 fbb_: _fbb,
636 start_: start,
637 }
638 }
639 #[inline]
640 pub fn finish(self) -> ::flatbuffers::WIPOffset<ArrayNode<'a>> {
641 let o = self.fbb_.end_table(self.start_);
642 ::flatbuffers::WIPOffset::new(o.value())
643 }
644}
645
646impl ::core::fmt::Debug for ArrayNode<'_> {
647 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
648 let mut ds = f.debug_struct("ArrayNode");
649 ds.field("encoding", &self.encoding());
650 ds.field("metadata", &self.metadata());
651 ds.field("children", &self.children());
652 ds.field("buffers", &self.buffers());
653 ds.field("stats", &self.stats());
654 ds.finish()
655 }
656}
657pub enum ArrayStatsOffset {}
658#[derive(Copy, Clone, PartialEq)]
659
660pub struct ArrayStats<'a> {
661 pub _tab: ::flatbuffers::Table<'a>,
662}
663
664impl<'a> ::flatbuffers::Follow<'a> for ArrayStats<'a> {
665 type Inner = ArrayStats<'a>;
666 #[inline]
667 unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
668 Self { _tab: unsafe { ::flatbuffers::Table::new(buf, loc) } }
669 }
670}
671
672impl<'a> ArrayStats<'a> {
673 pub const VT_MIN: ::flatbuffers::VOffsetT = 4;
674 pub const VT_MIN_PRECISION: ::flatbuffers::VOffsetT = 6;
675 pub const VT_MAX: ::flatbuffers::VOffsetT = 8;
676 pub const VT_MAX_PRECISION: ::flatbuffers::VOffsetT = 10;
677 pub const VT_SUM: ::flatbuffers::VOffsetT = 12;
678 pub const VT_IS_SORTED: ::flatbuffers::VOffsetT = 14;
679 pub const VT_IS_STRICT_SORTED: ::flatbuffers::VOffsetT = 16;
680 pub const VT_IS_CONSTANT: ::flatbuffers::VOffsetT = 18;
681 pub const VT_NULL_COUNT: ::flatbuffers::VOffsetT = 20;
682 pub const VT_UNCOMPRESSED_SIZE_IN_BYTES: ::flatbuffers::VOffsetT = 22;
683 pub const VT_NAN_COUNT: ::flatbuffers::VOffsetT = 24;
684
685 #[inline]
686 pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
687 ArrayStats { _tab: table }
688 }
689 #[allow(unused_mut)]
690 pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
691 _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
692 args: &'args ArrayStatsArgs<'args>
693 ) -> ::flatbuffers::WIPOffset<ArrayStats<'bldr>> {
694 let mut builder = ArrayStatsBuilder::new(_fbb);
695 if let Some(x) = args.nan_count { builder.add_nan_count(x); }
696 if let Some(x) = args.uncompressed_size_in_bytes { builder.add_uncompressed_size_in_bytes(x); }
697 if let Some(x) = args.null_count { builder.add_null_count(x); }
698 if let Some(x) = args.sum { builder.add_sum(x); }
699 if let Some(x) = args.max { builder.add_max(x); }
700 if let Some(x) = args.min { builder.add_min(x); }
701 if let Some(x) = args.is_constant { builder.add_is_constant(x); }
702 if let Some(x) = args.is_strict_sorted { builder.add_is_strict_sorted(x); }
703 if let Some(x) = args.is_sorted { builder.add_is_sorted(x); }
704 builder.add_max_precision(args.max_precision);
705 builder.add_min_precision(args.min_precision);
706 builder.finish()
707 }
708
709
710 #[inline]
712 pub fn min(&self) -> Option<::flatbuffers::Vector<'a, u8>> {
713 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, u8>>>(ArrayStats::VT_MIN, None)}
717 }
718 #[inline]
719 pub fn min_precision(&self) -> Precision {
720 unsafe { self._tab.get::<Precision>(ArrayStats::VT_MIN_PRECISION, Some(Precision::Inexact)).unwrap()}
724 }
725 #[inline]
726 pub fn max(&self) -> Option<::flatbuffers::Vector<'a, u8>> {
727 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, u8>>>(ArrayStats::VT_MAX, None)}
731 }
732 #[inline]
733 pub fn max_precision(&self) -> Precision {
734 unsafe { self._tab.get::<Precision>(ArrayStats::VT_MAX_PRECISION, Some(Precision::Inexact)).unwrap()}
738 }
739 #[inline]
740 pub fn sum(&self) -> Option<::flatbuffers::Vector<'a, u8>> {
741 unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, u8>>>(ArrayStats::VT_SUM, None)}
745 }
746 #[inline]
747 pub fn is_sorted(&self) -> Option<bool> {
748 unsafe { self._tab.get::<bool>(ArrayStats::VT_IS_SORTED, None)}
752 }
753 #[inline]
754 pub fn is_strict_sorted(&self) -> Option<bool> {
755 unsafe { self._tab.get::<bool>(ArrayStats::VT_IS_STRICT_SORTED, None)}
759 }
760 #[inline]
761 pub fn is_constant(&self) -> Option<bool> {
762 unsafe { self._tab.get::<bool>(ArrayStats::VT_IS_CONSTANT, None)}
766 }
767 #[inline]
768 pub fn null_count(&self) -> Option<u64> {
769 unsafe { self._tab.get::<u64>(ArrayStats::VT_NULL_COUNT, None)}
773 }
774 #[inline]
775 pub fn uncompressed_size_in_bytes(&self) -> Option<u64> {
776 unsafe { self._tab.get::<u64>(ArrayStats::VT_UNCOMPRESSED_SIZE_IN_BYTES, None)}
780 }
781 #[inline]
782 pub fn nan_count(&self) -> Option<u64> {
783 unsafe { self._tab.get::<u64>(ArrayStats::VT_NAN_COUNT, None)}
787 }
788}
789
790impl ::flatbuffers::Verifiable for ArrayStats<'_> {
791 #[inline]
792 fn run_verifier(
793 v: &mut ::flatbuffers::Verifier, pos: usize
794 ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
795 v.visit_table(pos)?
796 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, u8>>>("min", Self::VT_MIN, false)?
797 .visit_field::<Precision>("min_precision", Self::VT_MIN_PRECISION, false)?
798 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, u8>>>("max", Self::VT_MAX, false)?
799 .visit_field::<Precision>("max_precision", Self::VT_MAX_PRECISION, false)?
800 .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, u8>>>("sum", Self::VT_SUM, false)?
801 .visit_field::<bool>("is_sorted", Self::VT_IS_SORTED, false)?
802 .visit_field::<bool>("is_strict_sorted", Self::VT_IS_STRICT_SORTED, false)?
803 .visit_field::<bool>("is_constant", Self::VT_IS_CONSTANT, false)?
804 .visit_field::<u64>("null_count", Self::VT_NULL_COUNT, false)?
805 .visit_field::<u64>("uncompressed_size_in_bytes", Self::VT_UNCOMPRESSED_SIZE_IN_BYTES, false)?
806 .visit_field::<u64>("nan_count", Self::VT_NAN_COUNT, false)?
807 .finish();
808 Ok(())
809 }
810}
811pub struct ArrayStatsArgs<'a> {
812 pub min: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, u8>>>,
813 pub min_precision: Precision,
814 pub max: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, u8>>>,
815 pub max_precision: Precision,
816 pub sum: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, u8>>>,
817 pub is_sorted: Option<bool>,
818 pub is_strict_sorted: Option<bool>,
819 pub is_constant: Option<bool>,
820 pub null_count: Option<u64>,
821 pub uncompressed_size_in_bytes: Option<u64>,
822 pub nan_count: Option<u64>,
823}
824impl<'a> Default for ArrayStatsArgs<'a> {
825 #[inline]
826 fn default() -> Self {
827 ArrayStatsArgs {
828 min: None,
829 min_precision: Precision::Inexact,
830 max: None,
831 max_precision: Precision::Inexact,
832 sum: None,
833 is_sorted: None,
834 is_strict_sorted: None,
835 is_constant: None,
836 null_count: None,
837 uncompressed_size_in_bytes: None,
838 nan_count: None,
839 }
840 }
841}
842
843pub struct ArrayStatsBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
844 fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
845 start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
846}
847impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ArrayStatsBuilder<'a, 'b, A> {
848 #[inline]
849 pub fn add_min(&mut self, min: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , u8>>) {
850 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ArrayStats::VT_MIN, min);
851 }
852 #[inline]
853 pub fn add_min_precision(&mut self, min_precision: Precision) {
854 self.fbb_.push_slot::<Precision>(ArrayStats::VT_MIN_PRECISION, min_precision, Precision::Inexact);
855 }
856 #[inline]
857 pub fn add_max(&mut self, max: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , u8>>) {
858 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ArrayStats::VT_MAX, max);
859 }
860 #[inline]
861 pub fn add_max_precision(&mut self, max_precision: Precision) {
862 self.fbb_.push_slot::<Precision>(ArrayStats::VT_MAX_PRECISION, max_precision, Precision::Inexact);
863 }
864 #[inline]
865 pub fn add_sum(&mut self, sum: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , u8>>) {
866 self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ArrayStats::VT_SUM, sum);
867 }
868 #[inline]
869 pub fn add_is_sorted(&mut self, is_sorted: bool) {
870 self.fbb_.push_slot_always::<bool>(ArrayStats::VT_IS_SORTED, is_sorted);
871 }
872 #[inline]
873 pub fn add_is_strict_sorted(&mut self, is_strict_sorted: bool) {
874 self.fbb_.push_slot_always::<bool>(ArrayStats::VT_IS_STRICT_SORTED, is_strict_sorted);
875 }
876 #[inline]
877 pub fn add_is_constant(&mut self, is_constant: bool) {
878 self.fbb_.push_slot_always::<bool>(ArrayStats::VT_IS_CONSTANT, is_constant);
879 }
880 #[inline]
881 pub fn add_null_count(&mut self, null_count: u64) {
882 self.fbb_.push_slot_always::<u64>(ArrayStats::VT_NULL_COUNT, null_count);
883 }
884 #[inline]
885 pub fn add_uncompressed_size_in_bytes(&mut self, uncompressed_size_in_bytes: u64) {
886 self.fbb_.push_slot_always::<u64>(ArrayStats::VT_UNCOMPRESSED_SIZE_IN_BYTES, uncompressed_size_in_bytes);
887 }
888 #[inline]
889 pub fn add_nan_count(&mut self, nan_count: u64) {
890 self.fbb_.push_slot_always::<u64>(ArrayStats::VT_NAN_COUNT, nan_count);
891 }
892 #[inline]
893 pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ArrayStatsBuilder<'a, 'b, A> {
894 let start = _fbb.start_table();
895 ArrayStatsBuilder {
896 fbb_: _fbb,
897 start_: start,
898 }
899 }
900 #[inline]
901 pub fn finish(self) -> ::flatbuffers::WIPOffset<ArrayStats<'a>> {
902 let o = self.fbb_.end_table(self.start_);
903 ::flatbuffers::WIPOffset::new(o.value())
904 }
905}
906
907impl ::core::fmt::Debug for ArrayStats<'_> {
908 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
909 let mut ds = f.debug_struct("ArrayStats");
910 ds.field("min", &self.min());
911 ds.field("min_precision", &self.min_precision());
912 ds.field("max", &self.max());
913 ds.field("max_precision", &self.max_precision());
914 ds.field("sum", &self.sum());
915 ds.field("is_sorted", &self.is_sorted());
916 ds.field("is_strict_sorted", &self.is_strict_sorted());
917 ds.field("is_constant", &self.is_constant());
918 ds.field("null_count", &self.null_count());
919 ds.field("uncompressed_size_in_bytes", &self.uncompressed_size_in_bytes());
920 ds.field("nan_count", &self.nan_count());
921 ds.finish()
922 }
923}
924#[inline]
925pub fn root_as_array(buf: &[u8]) -> Result<Array<'_>, ::flatbuffers::InvalidFlatbuffer> {
932 ::flatbuffers::root::<Array>(buf)
933}
934#[inline]
935pub fn size_prefixed_root_as_array(buf: &[u8]) -> Result<Array<'_>, ::flatbuffers::InvalidFlatbuffer> {
942 ::flatbuffers::size_prefixed_root::<Array>(buf)
943}
944#[inline]
945pub fn root_as_array_with_opts<'b, 'o>(
952 opts: &'o ::flatbuffers::VerifierOptions,
953 buf: &'b [u8],
954) -> Result<Array<'b>, ::flatbuffers::InvalidFlatbuffer> {
955 ::flatbuffers::root_with_opts::<Array<'b>>(opts, buf)
956}
957#[inline]
958pub fn size_prefixed_root_as_array_with_opts<'b, 'o>(
965 opts: &'o ::flatbuffers::VerifierOptions,
966 buf: &'b [u8],
967) -> Result<Array<'b>, ::flatbuffers::InvalidFlatbuffer> {
968 ::flatbuffers::size_prefixed_root_with_opts::<Array<'b>>(opts, buf)
969}
970#[inline]
971pub unsafe fn root_as_array_unchecked(buf: &[u8]) -> Array<'_> {
975 unsafe { ::flatbuffers::root_unchecked::<Array>(buf) }
976}
977#[inline]
978pub unsafe fn size_prefixed_root_as_array_unchecked(buf: &[u8]) -> Array<'_> {
982 unsafe { ::flatbuffers::size_prefixed_root_unchecked::<Array>(buf) }
983}
984#[inline]
985pub fn finish_array_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(
986 fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
987 root: ::flatbuffers::WIPOffset<Array<'a>>) {
988 fbb.finish(root, None);
989}
990
991#[inline]
992pub fn finish_size_prefixed_array_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>, root: ::flatbuffers::WIPOffset<Array<'a>>) {
993 fbb.finish_size_prefixed(root, None);
994}