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