vortex-flatbuffers 0.69.0

Flatbuffers definitions for Vortex types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
// automatically generated by the FlatBuffers compiler, do not modify


// @generated

use core::mem;
use core::cmp::Ordering;

extern crate flatbuffers;
use self::flatbuffers::{EndianScalar, Follow};

#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_COMPRESSION: u8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_COMPRESSION: u8 = 1;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_COMPRESSION: [Compression; 2] = [
  Compression::None,
  Compression::LZ4,
];

/// The compression mechanism used to compress the buffer.
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct Compression(pub u8);
#[allow(non_upper_case_globals)]
impl Compression {
  pub const None: Self = Self(0);
  pub const LZ4: Self = Self(1);

  pub const ENUM_MIN: u8 = 0;
  pub const ENUM_MAX: u8 = 1;
  pub const ENUM_VALUES: &'static [Self] = &[
    Self::None,
    Self::LZ4,
  ];
  /// Returns the variant's name or "" if unknown.
  pub fn variant_name(self) -> Option<&'static str> {
    match self {
      Self::None => Some("None"),
      Self::LZ4 => Some("LZ4"),
      _ => None,
    }
  }
}
impl core::fmt::Debug for Compression {
  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
    if let Some(name) = self.variant_name() {
      f.write_str(name)
    } else {
      f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
    }
  }
}
impl<'a> flatbuffers::Follow<'a> for Compression {
  type Inner = Self;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    let b = unsafe { flatbuffers::read_scalar_at::<u8>(buf, loc) };
    Self(b)
  }
}

impl flatbuffers::Push for Compression {
    type Output = Compression;
    #[inline]
    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
        unsafe { flatbuffers::emplace_scalar::<u8>(dst, self.0); }
    }
}

impl flatbuffers::EndianScalar for Compression {
  type Scalar = u8;
  #[inline]
  fn to_little_endian(self) -> u8 {
    self.0.to_le()
  }
  #[inline]
  #[allow(clippy::wrong_self_convention)]
  fn from_little_endian(v: u8) -> Self {
    let b = u8::from_le(v);
    Self(b)
  }
}

impl<'a> flatbuffers::Verifiable for Compression {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    u8::run_verifier(v, pos)
  }
}

impl flatbuffers::SimpleToVerifyInSlice for Compression {}
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MIN_PRECISION: u8 = 0;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
pub const ENUM_MAX_PRECISION: u8 = 1;
#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
#[allow(non_camel_case_types)]
pub const ENUM_VALUES_PRECISION: [Precision; 2] = [
  Precision::Inexact,
  Precision::Exact,
];

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[repr(transparent)]
pub struct Precision(pub u8);
#[allow(non_upper_case_globals)]
impl Precision {
  pub const Inexact: Self = Self(0);
  pub const Exact: Self = Self(1);

  pub const ENUM_MIN: u8 = 0;
  pub const ENUM_MAX: u8 = 1;
  pub const ENUM_VALUES: &'static [Self] = &[
    Self::Inexact,
    Self::Exact,
  ];
  /// Returns the variant's name or "" if unknown.
  pub fn variant_name(self) -> Option<&'static str> {
    match self {
      Self::Inexact => Some("Inexact"),
      Self::Exact => Some("Exact"),
      _ => None,
    }
  }
}
impl core::fmt::Debug for Precision {
  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
    if let Some(name) = self.variant_name() {
      f.write_str(name)
    } else {
      f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
    }
  }
}
impl<'a> flatbuffers::Follow<'a> for Precision {
  type Inner = Self;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    let b = unsafe { flatbuffers::read_scalar_at::<u8>(buf, loc) };
    Self(b)
  }
}

impl flatbuffers::Push for Precision {
    type Output = Precision;
    #[inline]
    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
        unsafe { flatbuffers::emplace_scalar::<u8>(dst, self.0); }
    }
}

impl flatbuffers::EndianScalar for Precision {
  type Scalar = u8;
  #[inline]
  fn to_little_endian(self) -> u8 {
    self.0.to_le()
  }
  #[inline]
  #[allow(clippy::wrong_self_convention)]
  fn from_little_endian(v: u8) -> Self {
    let b = u8::from_le(v);
    Self(b)
  }
}

impl<'a> flatbuffers::Verifiable for Precision {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    u8::run_verifier(v, pos)
  }
}

impl flatbuffers::SimpleToVerifyInSlice for Precision {}
/// A Buffer describes the location of a data buffer in the byte stream as a packed 64-bit struct.
// struct Buffer, aligned to 4
#[repr(transparent)]
#[derive(Clone, Copy, PartialEq)]
pub struct Buffer(pub [u8; 8]);
impl Default for Buffer { 
  fn default() -> Self { 
    Self([0; 8])
  }
}
impl core::fmt::Debug for Buffer {
  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
    f.debug_struct("Buffer")
      .field("padding", &self.padding())
      .field("alignment_exponent", &self.alignment_exponent())
      .field("compression", &self.compression())
      .field("length", &self.length())
      .finish()
  }
}

impl flatbuffers::SimpleToVerifyInSlice for Buffer {}
impl<'a> flatbuffers::Follow<'a> for Buffer {
  type Inner = &'a Buffer;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    unsafe { <&'a Buffer>::follow(buf, loc) }
  }
}
impl<'a> flatbuffers::Follow<'a> for &'a Buffer {
  type Inner = &'a Buffer;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    unsafe { flatbuffers::follow_cast_ref::<Buffer>(buf, loc) }
  }
}
impl<'b> flatbuffers::Push for Buffer {
    type Output = Buffer;
    #[inline]
    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
        let src = unsafe { ::core::slice::from_raw_parts(self as *const Buffer as *const u8, <Self as flatbuffers::Push>::size()) };
        dst.copy_from_slice(src);
    }
    #[inline]
    fn alignment() -> flatbuffers::PushAlignment {
        flatbuffers::PushAlignment::new(4)
    }
}

impl<'a> flatbuffers::Verifiable for Buffer {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.in_buffer::<Self>(pos)
  }
}

impl<'a> Buffer {
  #[allow(clippy::too_many_arguments)]
  pub fn new(
    padding: u16,
    alignment_exponent: u8,
    compression: Compression,
    length: u32,
  ) -> Self {
    let mut s = Self([0; 8]);
    s.set_padding(padding);
    s.set_alignment_exponent(alignment_exponent);
    s.set_compression(compression);
    s.set_length(length);
    s
  }

  /// The length of any padding bytes written immediately before the buffer.
  pub fn padding(&self) -> u16 {
    let mut mem = core::mem::MaybeUninit::<<u16 as EndianScalar>::Scalar>::uninit();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    EndianScalar::from_little_endian(unsafe {
      core::ptr::copy_nonoverlapping(
        self.0[0..].as_ptr(),
        mem.as_mut_ptr() as *mut u8,
        core::mem::size_of::<<u16 as EndianScalar>::Scalar>(),
      );
      mem.assume_init()
    })
  }

  pub fn set_padding(&mut self, x: u16) {
    let x_le = x.to_little_endian();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    unsafe {
      core::ptr::copy_nonoverlapping(
        &x_le as *const _ as *const u8,
        self.0[0..].as_mut_ptr(),
        core::mem::size_of::<<u16 as EndianScalar>::Scalar>(),
      );
    }
  }

  /// The minimum alignment of the buffer, stored as an exponent of 2.
  pub fn alignment_exponent(&self) -> u8 {
    let mut mem = core::mem::MaybeUninit::<<u8 as EndianScalar>::Scalar>::uninit();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    EndianScalar::from_little_endian(unsafe {
      core::ptr::copy_nonoverlapping(
        self.0[2..].as_ptr(),
        mem.as_mut_ptr() as *mut u8,
        core::mem::size_of::<<u8 as EndianScalar>::Scalar>(),
      );
      mem.assume_init()
    })
  }

  pub fn set_alignment_exponent(&mut self, x: u8) {
    let x_le = x.to_little_endian();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    unsafe {
      core::ptr::copy_nonoverlapping(
        &x_le as *const _ as *const u8,
        self.0[2..].as_mut_ptr(),
        core::mem::size_of::<<u8 as EndianScalar>::Scalar>(),
      );
    }
  }

  /// The compression algorithm used to compress the buffer.
  pub fn compression(&self) -> Compression {
    let mut mem = core::mem::MaybeUninit::<<Compression as EndianScalar>::Scalar>::uninit();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    EndianScalar::from_little_endian(unsafe {
      core::ptr::copy_nonoverlapping(
        self.0[3..].as_ptr(),
        mem.as_mut_ptr() as *mut u8,
        core::mem::size_of::<<Compression as EndianScalar>::Scalar>(),
      );
      mem.assume_init()
    })
  }

  pub fn set_compression(&mut self, x: Compression) {
    let x_le = x.to_little_endian();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    unsafe {
      core::ptr::copy_nonoverlapping(
        &x_le as *const _ as *const u8,
        self.0[3..].as_mut_ptr(),
        core::mem::size_of::<<Compression as EndianScalar>::Scalar>(),
      );
    }
  }

  /// The length of the buffer in bytes.
  pub fn length(&self) -> u32 {
    let mut mem = core::mem::MaybeUninit::<<u32 as EndianScalar>::Scalar>::uninit();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    EndianScalar::from_little_endian(unsafe {
      core::ptr::copy_nonoverlapping(
        self.0[4..].as_ptr(),
        mem.as_mut_ptr() as *mut u8,
        core::mem::size_of::<<u32 as EndianScalar>::Scalar>(),
      );
      mem.assume_init()
    })
  }

  pub fn set_length(&mut self, x: u32) {
    let x_le = x.to_little_endian();
    // Safety:
    // Created from a valid Table for this object
    // Which contains a valid value in this slot
    unsafe {
      core::ptr::copy_nonoverlapping(
        &x_le as *const _ as *const u8,
        self.0[4..].as_mut_ptr(),
        core::mem::size_of::<<u32 as EndianScalar>::Scalar>(),
      );
    }
  }

}

pub enum ArrayOffset {}
#[derive(Copy, Clone, PartialEq)]

/// An Array describes the hierarchy of an array as well as the locations of the data buffers that appear
/// immediately after the message in the byte stream.
pub struct Array<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

impl<'a> flatbuffers::Follow<'a> for Array<'a> {
  type Inner = Array<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
  }
}

impl<'a> Array<'a> {
  pub const VT_ROOT: flatbuffers::VOffsetT = 4;
  pub const VT_BUFFERS: flatbuffers::VOffsetT = 6;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    Array { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args ArrayArgs<'args>
  ) -> flatbuffers::WIPOffset<Array<'bldr>> {
    let mut builder = ArrayBuilder::new(_fbb);
    if let Some(x) = args.buffers { builder.add_buffers(x); }
    if let Some(x) = args.root { builder.add_root(x); }
    builder.finish()
  }


  /// The array's hierarchical definition.
  #[inline]
  pub fn root(&self) -> Option<ArrayNode<'a>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<ArrayNode>>(Array::VT_ROOT, None)}
  }
  /// The locations of the data buffers of the array
  #[inline]
  pub fn buffers(&self) -> Option<flatbuffers::Vector<'a, Buffer>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, Buffer>>>(Array::VT_BUFFERS, None)}
  }
}

impl flatbuffers::Verifiable for Array<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<flatbuffers::ForwardsUOffset<ArrayNode>>("root", Self::VT_ROOT, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, Buffer>>>("buffers", Self::VT_BUFFERS, false)?
     .finish();
    Ok(())
  }
}
pub struct ArrayArgs<'a> {
    pub root: Option<flatbuffers::WIPOffset<ArrayNode<'a>>>,
    pub buffers: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, Buffer>>>,
}
impl<'a> Default for ArrayArgs<'a> {
  #[inline]
  fn default() -> Self {
    ArrayArgs {
      root: None,
      buffers: None,
    }
  }
}

pub struct ArrayBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ArrayBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_root(&mut self, root: flatbuffers::WIPOffset<ArrayNode<'b >>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<ArrayNode>>(Array::VT_ROOT, root);
  }
  #[inline]
  pub fn add_buffers(&mut self, buffers: flatbuffers::WIPOffset<flatbuffers::Vector<'b , Buffer>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Array::VT_BUFFERS, buffers);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ArrayBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    ArrayBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<Array<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for Array<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("Array");
      ds.field("root", &self.root());
      ds.field("buffers", &self.buffers());
      ds.finish()
  }
}
pub enum ArrayNodeOffset {}
#[derive(Copy, Clone, PartialEq)]

pub struct ArrayNode<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

impl<'a> flatbuffers::Follow<'a> for ArrayNode<'a> {
  type Inner = ArrayNode<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
  }
}

impl<'a> ArrayNode<'a> {
  pub const VT_ENCODING: flatbuffers::VOffsetT = 4;
  pub const VT_METADATA: flatbuffers::VOffsetT = 6;
  pub const VT_CHILDREN: flatbuffers::VOffsetT = 8;
  pub const VT_BUFFERS: flatbuffers::VOffsetT = 10;
  pub const VT_STATS: flatbuffers::VOffsetT = 12;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    ArrayNode { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args ArrayNodeArgs<'args>
  ) -> flatbuffers::WIPOffset<ArrayNode<'bldr>> {
    let mut builder = ArrayNodeBuilder::new(_fbb);
    if let Some(x) = args.stats { builder.add_stats(x); }
    if let Some(x) = args.buffers { builder.add_buffers(x); }
    if let Some(x) = args.children { builder.add_children(x); }
    if let Some(x) = args.metadata { builder.add_metadata(x); }
    builder.add_encoding(args.encoding);
    builder.finish()
  }


  #[inline]
  pub fn encoding(&self) -> u16 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u16>(ArrayNode::VT_ENCODING, Some(0)).unwrap()}
  }
  #[inline]
  pub fn metadata(&self) -> Option<flatbuffers::Vector<'a, u8>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(ArrayNode::VT_METADATA, None)}
  }
  #[inline]
  pub fn children(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArrayNode<'a>>>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArrayNode>>>>(ArrayNode::VT_CHILDREN, None)}
  }
  #[inline]
  pub fn buffers(&self) -> Option<flatbuffers::Vector<'a, u16>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u16>>>(ArrayNode::VT_BUFFERS, None)}
  }
  #[inline]
  pub fn stats(&self) -> Option<ArrayStats<'a>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<ArrayStats>>(ArrayNode::VT_STATS, None)}
  }
}

impl flatbuffers::Verifiable for ArrayNode<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<u16>("encoding", Self::VT_ENCODING, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>("metadata", Self::VT_METADATA, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<ArrayNode>>>>("children", Self::VT_CHILDREN, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u16>>>("buffers", Self::VT_BUFFERS, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<ArrayStats>>("stats", Self::VT_STATS, false)?
     .finish();
    Ok(())
  }
}
pub struct ArrayNodeArgs<'a> {
    pub encoding: u16,
    pub metadata: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
    pub children: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArrayNode<'a>>>>>,
    pub buffers: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u16>>>,
    pub stats: Option<flatbuffers::WIPOffset<ArrayStats<'a>>>,
}
impl<'a> Default for ArrayNodeArgs<'a> {
  #[inline]
  fn default() -> Self {
    ArrayNodeArgs {
      encoding: 0,
      metadata: None,
      children: None,
      buffers: None,
      stats: None,
    }
  }
}

pub struct ArrayNodeBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ArrayNodeBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_encoding(&mut self, encoding: u16) {
    self.fbb_.push_slot::<u16>(ArrayNode::VT_ENCODING, encoding, 0);
  }
  #[inline]
  pub fn add_metadata(&mut self, metadata: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ArrayNode::VT_METADATA, metadata);
  }
  #[inline]
  pub fn add_children(&mut self, children: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<ArrayNode<'b >>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ArrayNode::VT_CHILDREN, children);
  }
  #[inline]
  pub fn add_buffers(&mut self, buffers: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u16>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ArrayNode::VT_BUFFERS, buffers);
  }
  #[inline]
  pub fn add_stats(&mut self, stats: flatbuffers::WIPOffset<ArrayStats<'b >>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<ArrayStats>>(ArrayNode::VT_STATS, stats);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ArrayNodeBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    ArrayNodeBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<ArrayNode<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for ArrayNode<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("ArrayNode");
      ds.field("encoding", &self.encoding());
      ds.field("metadata", &self.metadata());
      ds.field("children", &self.children());
      ds.field("buffers", &self.buffers());
      ds.field("stats", &self.stats());
      ds.finish()
  }
}
pub enum ArrayStatsOffset {}
#[derive(Copy, Clone, PartialEq)]

pub struct ArrayStats<'a> {
  pub _tab: flatbuffers::Table<'a>,
}

impl<'a> flatbuffers::Follow<'a> for ArrayStats<'a> {
  type Inner = ArrayStats<'a>;
  #[inline]
  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
  }
}

impl<'a> ArrayStats<'a> {
  pub const VT_MIN: flatbuffers::VOffsetT = 4;
  pub const VT_MIN_PRECISION: flatbuffers::VOffsetT = 6;
  pub const VT_MAX: flatbuffers::VOffsetT = 8;
  pub const VT_MAX_PRECISION: flatbuffers::VOffsetT = 10;
  pub const VT_SUM: flatbuffers::VOffsetT = 12;
  pub const VT_IS_SORTED: flatbuffers::VOffsetT = 14;
  pub const VT_IS_STRICT_SORTED: flatbuffers::VOffsetT = 16;
  pub const VT_IS_CONSTANT: flatbuffers::VOffsetT = 18;
  pub const VT_NULL_COUNT: flatbuffers::VOffsetT = 20;
  pub const VT_UNCOMPRESSED_SIZE_IN_BYTES: flatbuffers::VOffsetT = 22;
  pub const VT_NAN_COUNT: flatbuffers::VOffsetT = 24;

  #[inline]
  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    ArrayStats { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args ArrayStatsArgs<'args>
  ) -> flatbuffers::WIPOffset<ArrayStats<'bldr>> {
    let mut builder = ArrayStatsBuilder::new(_fbb);
    if let Some(x) = args.nan_count { builder.add_nan_count(x); }
    if let Some(x) = args.uncompressed_size_in_bytes { builder.add_uncompressed_size_in_bytes(x); }
    if let Some(x) = args.null_count { builder.add_null_count(x); }
    if let Some(x) = args.sum { builder.add_sum(x); }
    if let Some(x) = args.max { builder.add_max(x); }
    if let Some(x) = args.min { builder.add_min(x); }
    if let Some(x) = args.is_constant { builder.add_is_constant(x); }
    if let Some(x) = args.is_strict_sorted { builder.add_is_strict_sorted(x); }
    if let Some(x) = args.is_sorted { builder.add_is_sorted(x); }
    builder.add_max_precision(args.max_precision);
    builder.add_min_precision(args.min_precision);
    builder.finish()
  }


  /// Protobuf serialized ScalarValue
  #[inline]
  pub fn min(&self) -> Option<flatbuffers::Vector<'a, u8>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(ArrayStats::VT_MIN, None)}
  }
  #[inline]
  pub fn min_precision(&self) -> Precision {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<Precision>(ArrayStats::VT_MIN_PRECISION, Some(Precision::Inexact)).unwrap()}
  }
  #[inline]
  pub fn max(&self) -> Option<flatbuffers::Vector<'a, u8>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(ArrayStats::VT_MAX, None)}
  }
  #[inline]
  pub fn max_precision(&self) -> Precision {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<Precision>(ArrayStats::VT_MAX_PRECISION, Some(Precision::Inexact)).unwrap()}
  }
  #[inline]
  pub fn sum(&self) -> Option<flatbuffers::Vector<'a, u8>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, u8>>>(ArrayStats::VT_SUM, None)}
  }
  #[inline]
  pub fn is_sorted(&self) -> Option<bool> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(ArrayStats::VT_IS_SORTED, None)}
  }
  #[inline]
  pub fn is_strict_sorted(&self) -> Option<bool> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(ArrayStats::VT_IS_STRICT_SORTED, None)}
  }
  #[inline]
  pub fn is_constant(&self) -> Option<bool> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(ArrayStats::VT_IS_CONSTANT, None)}
  }
  #[inline]
  pub fn null_count(&self) -> Option<u64> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(ArrayStats::VT_NULL_COUNT, None)}
  }
  #[inline]
  pub fn uncompressed_size_in_bytes(&self) -> Option<u64> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(ArrayStats::VT_UNCOMPRESSED_SIZE_IN_BYTES, None)}
  }
  #[inline]
  pub fn nan_count(&self) -> Option<u64> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(ArrayStats::VT_NAN_COUNT, None)}
  }
}

impl flatbuffers::Verifiable for ArrayStats<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>("min", Self::VT_MIN, false)?
     .visit_field::<Precision>("min_precision", Self::VT_MIN_PRECISION, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>("max", Self::VT_MAX, false)?
     .visit_field::<Precision>("max_precision", Self::VT_MAX_PRECISION, false)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, u8>>>("sum", Self::VT_SUM, false)?
     .visit_field::<bool>("is_sorted", Self::VT_IS_SORTED, false)?
     .visit_field::<bool>("is_strict_sorted", Self::VT_IS_STRICT_SORTED, false)?
     .visit_field::<bool>("is_constant", Self::VT_IS_CONSTANT, false)?
     .visit_field::<u64>("null_count", Self::VT_NULL_COUNT, false)?
     .visit_field::<u64>("uncompressed_size_in_bytes", Self::VT_UNCOMPRESSED_SIZE_IN_BYTES, false)?
     .visit_field::<u64>("nan_count", Self::VT_NAN_COUNT, false)?
     .finish();
    Ok(())
  }
}
pub struct ArrayStatsArgs<'a> {
    pub min: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
    pub min_precision: Precision,
    pub max: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
    pub max_precision: Precision,
    pub sum: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, u8>>>,
    pub is_sorted: Option<bool>,
    pub is_strict_sorted: Option<bool>,
    pub is_constant: Option<bool>,
    pub null_count: Option<u64>,
    pub uncompressed_size_in_bytes: Option<u64>,
    pub nan_count: Option<u64>,
}
impl<'a> Default for ArrayStatsArgs<'a> {
  #[inline]
  fn default() -> Self {
    ArrayStatsArgs {
      min: None,
      min_precision: Precision::Inexact,
      max: None,
      max_precision: Precision::Inexact,
      sum: None,
      is_sorted: None,
      is_strict_sorted: None,
      is_constant: None,
      null_count: None,
      uncompressed_size_in_bytes: None,
      nan_count: None,
    }
  }
}

pub struct ArrayStatsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ArrayStatsBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_min(&mut self, min: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ArrayStats::VT_MIN, min);
  }
  #[inline]
  pub fn add_min_precision(&mut self, min_precision: Precision) {
    self.fbb_.push_slot::<Precision>(ArrayStats::VT_MIN_PRECISION, min_precision, Precision::Inexact);
  }
  #[inline]
  pub fn add_max(&mut self, max: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ArrayStats::VT_MAX, max);
  }
  #[inline]
  pub fn add_max_precision(&mut self, max_precision: Precision) {
    self.fbb_.push_slot::<Precision>(ArrayStats::VT_MAX_PRECISION, max_precision, Precision::Inexact);
  }
  #[inline]
  pub fn add_sum(&mut self, sum: flatbuffers::WIPOffset<flatbuffers::Vector<'b , u8>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ArrayStats::VT_SUM, sum);
  }
  #[inline]
  pub fn add_is_sorted(&mut self, is_sorted: bool) {
    self.fbb_.push_slot_always::<bool>(ArrayStats::VT_IS_SORTED, is_sorted);
  }
  #[inline]
  pub fn add_is_strict_sorted(&mut self, is_strict_sorted: bool) {
    self.fbb_.push_slot_always::<bool>(ArrayStats::VT_IS_STRICT_SORTED, is_strict_sorted);
  }
  #[inline]
  pub fn add_is_constant(&mut self, is_constant: bool) {
    self.fbb_.push_slot_always::<bool>(ArrayStats::VT_IS_CONSTANT, is_constant);
  }
  #[inline]
  pub fn add_null_count(&mut self, null_count: u64) {
    self.fbb_.push_slot_always::<u64>(ArrayStats::VT_NULL_COUNT, null_count);
  }
  #[inline]
  pub fn add_uncompressed_size_in_bytes(&mut self, uncompressed_size_in_bytes: u64) {
    self.fbb_.push_slot_always::<u64>(ArrayStats::VT_UNCOMPRESSED_SIZE_IN_BYTES, uncompressed_size_in_bytes);
  }
  #[inline]
  pub fn add_nan_count(&mut self, nan_count: u64) {
    self.fbb_.push_slot_always::<u64>(ArrayStats::VT_NAN_COUNT, nan_count);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ArrayStatsBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    ArrayStatsBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<ArrayStats<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl core::fmt::Debug for ArrayStats<'_> {
  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    let mut ds = f.debug_struct("ArrayStats");
      ds.field("min", &self.min());
      ds.field("min_precision", &self.min_precision());
      ds.field("max", &self.max());
      ds.field("max_precision", &self.max_precision());
      ds.field("sum", &self.sum());
      ds.field("is_sorted", &self.is_sorted());
      ds.field("is_strict_sorted", &self.is_strict_sorted());
      ds.field("is_constant", &self.is_constant());
      ds.field("null_count", &self.null_count());
      ds.field("uncompressed_size_in_bytes", &self.uncompressed_size_in_bytes());
      ds.field("nan_count", &self.nan_count());
      ds.finish()
  }
}
#[inline]
/// Verifies that a buffer of bytes contains a `Array`
/// and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_array_unchecked`.
pub fn root_as_array(buf: &[u8]) -> Result<Array, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root::<Array>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `Array` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `size_prefixed_root_as_array_unchecked`.
pub fn size_prefixed_root_as_array(buf: &[u8]) -> Result<Array, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root::<Array>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `Array` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_array_unchecked`.
pub fn root_as_array_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<Array<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root_with_opts::<Array<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `Array` and returns
/// it. Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_array_unchecked`.
pub fn size_prefixed_root_as_array_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<Array<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root_with_opts::<Array<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a Array and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `Array`.
pub unsafe fn root_as_array_unchecked(buf: &[u8]) -> Array {
  unsafe { flatbuffers::root_unchecked::<Array>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed Array and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `Array`.
pub unsafe fn size_prefixed_root_as_array_unchecked(buf: &[u8]) -> Array {
  unsafe { flatbuffers::size_prefixed_root_unchecked::<Array>(buf) }
}
#[inline]
pub fn finish_array_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
    root: flatbuffers::WIPOffset<Array<'a>>) {
  fbb.finish(root, None);
}

#[inline]
pub fn finish_size_prefixed_array_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset<Array<'a>>) {
  fbb.finish_size_prefixed(root, None);
}