vortex_flatbuffers/generated/
footer.rs

1// automatically generated by the FlatBuffers compiler, do not modify
2
3
4// @generated
5
6use crate::array::*;
7use crate::layout::*;
8use core::mem;
9use core::cmp::Ordering;
10
11extern crate flatbuffers;
12use self::flatbuffers::{EndianScalar, Follow};
13
14#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
15pub const ENUM_MIN_COMPRESSION_SCHEME: u8 = 0;
16#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
17pub const ENUM_MAX_COMPRESSION_SCHEME: u8 = 3;
18#[deprecated(since = "2.0.0", note = "Use associated constants instead. This will no longer be generated in 2021.")]
19#[allow(non_camel_case_types)]
20pub const ENUM_VALUES_COMPRESSION_SCHEME: [CompressionScheme; 4] = [
21  CompressionScheme::None,
22  CompressionScheme::LZ4,
23  CompressionScheme::ZLib,
24  CompressionScheme::ZStd,
25];
26
27#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
28#[repr(transparent)]
29pub struct CompressionScheme(pub u8);
30#[allow(non_upper_case_globals)]
31impl CompressionScheme {
32  pub const None: Self = Self(0);
33  pub const LZ4: Self = Self(1);
34  pub const ZLib: Self = Self(2);
35  pub const ZStd: Self = Self(3);
36
37  pub const ENUM_MIN: u8 = 0;
38  pub const ENUM_MAX: u8 = 3;
39  pub const ENUM_VALUES: &'static [Self] = &[
40    Self::None,
41    Self::LZ4,
42    Self::ZLib,
43    Self::ZStd,
44  ];
45  /// Returns the variant's name or "" if unknown.
46  pub fn variant_name(self) -> Option<&'static str> {
47    match self {
48      Self::None => Some("None"),
49      Self::LZ4 => Some("LZ4"),
50      Self::ZLib => Some("ZLib"),
51      Self::ZStd => Some("ZStd"),
52      _ => None,
53    }
54  }
55}
56impl core::fmt::Debug for CompressionScheme {
57  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
58    if let Some(name) = self.variant_name() {
59      f.write_str(name)
60    } else {
61      f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
62    }
63  }
64}
65impl<'a> flatbuffers::Follow<'a> for CompressionScheme {
66  type Inner = Self;
67  #[inline]
68  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
69    let b = unsafe { flatbuffers::read_scalar_at::<u8>(buf, loc) };
70    Self(b)
71  }
72}
73
74impl flatbuffers::Push for CompressionScheme {
75    type Output = CompressionScheme;
76    #[inline]
77    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
78        unsafe { flatbuffers::emplace_scalar::<u8>(dst, self.0); }
79    }
80}
81
82impl flatbuffers::EndianScalar for CompressionScheme {
83  type Scalar = u8;
84  #[inline]
85  fn to_little_endian(self) -> u8 {
86    self.0.to_le()
87  }
88  #[inline]
89  #[allow(clippy::wrong_self_convention)]
90  fn from_little_endian(v: u8) -> Self {
91    let b = u8::from_le(v);
92    Self(b)
93  }
94}
95
96impl<'a> flatbuffers::Verifiable for CompressionScheme {
97  #[inline]
98  fn run_verifier(
99    v: &mut flatbuffers::Verifier, pos: usize
100  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
101    use self::flatbuffers::Verifiable;
102    u8::run_verifier(v, pos)
103  }
104}
105
106impl flatbuffers::SimpleToVerifyInSlice for CompressionScheme {}
107/// A `SegmentSpec` acts as the locator for a buffer within the file.
108// struct SegmentSpec, aligned to 8
109#[repr(transparent)]
110#[derive(Clone, Copy, PartialEq)]
111pub struct SegmentSpec(pub [u8; 16]);
112impl Default for SegmentSpec { 
113  fn default() -> Self { 
114    Self([0; 16])
115  }
116}
117impl core::fmt::Debug for SegmentSpec {
118  fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
119    f.debug_struct("SegmentSpec")
120      .field("offset", &self.offset())
121      .field("length", &self.length())
122      .field("alignment_exponent", &self.alignment_exponent())
123      .field("_compression", &self._compression())
124      .field("_encryption", &self._encryption())
125      .finish()
126  }
127}
128
129impl flatbuffers::SimpleToVerifyInSlice for SegmentSpec {}
130impl<'a> flatbuffers::Follow<'a> for SegmentSpec {
131  type Inner = &'a SegmentSpec;
132  #[inline]
133  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
134    unsafe { <&'a SegmentSpec>::follow(buf, loc) }
135  }
136}
137impl<'a> flatbuffers::Follow<'a> for &'a SegmentSpec {
138  type Inner = &'a SegmentSpec;
139  #[inline]
140  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
141    unsafe { flatbuffers::follow_cast_ref::<SegmentSpec>(buf, loc) }
142  }
143}
144impl<'b> flatbuffers::Push for SegmentSpec {
145    type Output = SegmentSpec;
146    #[inline]
147    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
148        let src = unsafe { ::core::slice::from_raw_parts(self as *const SegmentSpec as *const u8, <Self as flatbuffers::Push>::size()) };
149        dst.copy_from_slice(src);
150    }
151    #[inline]
152    fn alignment() -> flatbuffers::PushAlignment {
153        flatbuffers::PushAlignment::new(8)
154    }
155}
156
157impl<'a> flatbuffers::Verifiable for SegmentSpec {
158  #[inline]
159  fn run_verifier(
160    v: &mut flatbuffers::Verifier, pos: usize
161  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
162    use self::flatbuffers::Verifiable;
163    v.in_buffer::<Self>(pos)
164  }
165}
166
167impl<'a> SegmentSpec {
168  #[allow(clippy::too_many_arguments)]
169  pub fn new(
170    offset: u64,
171    length: u32,
172    alignment_exponent: u8,
173    _compression: u8,
174    _encryption: u16,
175  ) -> Self {
176    let mut s = Self([0; 16]);
177    s.set_offset(offset);
178    s.set_length(length);
179    s.set_alignment_exponent(alignment_exponent);
180    s.set__compression(_compression);
181    s.set__encryption(_encryption);
182    s
183  }
184
185  /// Offset relative to the start of the file.
186  pub fn offset(&self) -> u64 {
187    let mut mem = core::mem::MaybeUninit::<<u64 as EndianScalar>::Scalar>::uninit();
188    // Safety:
189    // Created from a valid Table for this object
190    // Which contains a valid value in this slot
191    EndianScalar::from_little_endian(unsafe {
192      core::ptr::copy_nonoverlapping(
193        self.0[0..].as_ptr(),
194        mem.as_mut_ptr() as *mut u8,
195        core::mem::size_of::<<u64 as EndianScalar>::Scalar>(),
196      );
197      mem.assume_init()
198    })
199  }
200
201  pub fn set_offset(&mut self, x: u64) {
202    let x_le = x.to_little_endian();
203    // Safety:
204    // Created from a valid Table for this object
205    // Which contains a valid value in this slot
206    unsafe {
207      core::ptr::copy_nonoverlapping(
208        &x_le as *const _ as *const u8,
209        self.0[0..].as_mut_ptr(),
210        core::mem::size_of::<<u64 as EndianScalar>::Scalar>(),
211      );
212    }
213  }
214
215  /// Length in bytes of the segment.
216  pub fn length(&self) -> u32 {
217    let mut mem = core::mem::MaybeUninit::<<u32 as EndianScalar>::Scalar>::uninit();
218    // Safety:
219    // Created from a valid Table for this object
220    // Which contains a valid value in this slot
221    EndianScalar::from_little_endian(unsafe {
222      core::ptr::copy_nonoverlapping(
223        self.0[8..].as_ptr(),
224        mem.as_mut_ptr() as *mut u8,
225        core::mem::size_of::<<u32 as EndianScalar>::Scalar>(),
226      );
227      mem.assume_init()
228    })
229  }
230
231  pub fn set_length(&mut self, x: u32) {
232    let x_le = x.to_little_endian();
233    // Safety:
234    // Created from a valid Table for this object
235    // Which contains a valid value in this slot
236    unsafe {
237      core::ptr::copy_nonoverlapping(
238        &x_le as *const _ as *const u8,
239        self.0[8..].as_mut_ptr(),
240        core::mem::size_of::<<u32 as EndianScalar>::Scalar>(),
241      );
242    }
243  }
244
245  /// Base-2 exponent of the alignment of the segment.
246  pub fn alignment_exponent(&self) -> u8 {
247    let mut mem = core::mem::MaybeUninit::<<u8 as EndianScalar>::Scalar>::uninit();
248    // Safety:
249    // Created from a valid Table for this object
250    // Which contains a valid value in this slot
251    EndianScalar::from_little_endian(unsafe {
252      core::ptr::copy_nonoverlapping(
253        self.0[12..].as_ptr(),
254        mem.as_mut_ptr() as *mut u8,
255        core::mem::size_of::<<u8 as EndianScalar>::Scalar>(),
256      );
257      mem.assume_init()
258    })
259  }
260
261  pub fn set_alignment_exponent(&mut self, x: u8) {
262    let x_le = x.to_little_endian();
263    // Safety:
264    // Created from a valid Table for this object
265    // Which contains a valid value in this slot
266    unsafe {
267      core::ptr::copy_nonoverlapping(
268        &x_le as *const _ as *const u8,
269        self.0[12..].as_mut_ptr(),
270        core::mem::size_of::<<u8 as EndianScalar>::Scalar>(),
271      );
272    }
273  }
274
275  pub fn _compression(&self) -> u8 {
276    let mut mem = core::mem::MaybeUninit::<<u8 as EndianScalar>::Scalar>::uninit();
277    // Safety:
278    // Created from a valid Table for this object
279    // Which contains a valid value in this slot
280    EndianScalar::from_little_endian(unsafe {
281      core::ptr::copy_nonoverlapping(
282        self.0[13..].as_ptr(),
283        mem.as_mut_ptr() as *mut u8,
284        core::mem::size_of::<<u8 as EndianScalar>::Scalar>(),
285      );
286      mem.assume_init()
287    })
288  }
289
290  pub fn set__compression(&mut self, x: u8) {
291    let x_le = x.to_little_endian();
292    // Safety:
293    // Created from a valid Table for this object
294    // Which contains a valid value in this slot
295    unsafe {
296      core::ptr::copy_nonoverlapping(
297        &x_le as *const _ as *const u8,
298        self.0[13..].as_mut_ptr(),
299        core::mem::size_of::<<u8 as EndianScalar>::Scalar>(),
300      );
301    }
302  }
303
304  pub fn _encryption(&self) -> u16 {
305    let mut mem = core::mem::MaybeUninit::<<u16 as EndianScalar>::Scalar>::uninit();
306    // Safety:
307    // Created from a valid Table for this object
308    // Which contains a valid value in this slot
309    EndianScalar::from_little_endian(unsafe {
310      core::ptr::copy_nonoverlapping(
311        self.0[14..].as_ptr(),
312        mem.as_mut_ptr() as *mut u8,
313        core::mem::size_of::<<u16 as EndianScalar>::Scalar>(),
314      );
315      mem.assume_init()
316    })
317  }
318
319  pub fn set__encryption(&mut self, x: u16) {
320    let x_le = x.to_little_endian();
321    // Safety:
322    // Created from a valid Table for this object
323    // Which contains a valid value in this slot
324    unsafe {
325      core::ptr::copy_nonoverlapping(
326        &x_le as *const _ as *const u8,
327        self.0[14..].as_mut_ptr(),
328        core::mem::size_of::<<u16 as EndianScalar>::Scalar>(),
329      );
330    }
331  }
332
333}
334
335pub enum PostscriptOffset {}
336#[derive(Copy, Clone, PartialEq)]
337
338/// The `Postscript` is guaranteed by the file format to never exceed
339/// 65528 bytes (i.e., u16::MAX - 8 bytes) in length, and is immediately
340/// followed by an 8-byte `EndOfFile` struct.
341///
342/// An initial read of a Vortex file defaults to at least 64KB (u16::MAX bytes) and therefore
343/// is guaranteed to cover at least the Postscript.
344///
345/// The reason for a postscript at all is to ensure minimal but all necessary footer information
346/// can be read in two round trips. Since the DType is optional and possibly large, it lives in
347/// its own segment. If the footer were arbitrary size, with a pointer to the DType segment, then
348/// in the worst case we would need one round trip to read the footer length, one to read the full
349/// footer and parse the DType offset, and a third to fetch the DType segment.
350///
351/// The segments pointed to by the postscript have inline compression and encryption specs to avoid
352/// the need to fetch encryption schemes up-front.
353pub struct Postscript<'a> {
354  pub _tab: flatbuffers::Table<'a>,
355}
356
357impl<'a> flatbuffers::Follow<'a> for Postscript<'a> {
358  type Inner = Postscript<'a>;
359  #[inline]
360  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
361    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
362  }
363}
364
365impl<'a> Postscript<'a> {
366  pub const VT_DTYPE: flatbuffers::VOffsetT = 4;
367  pub const VT_LAYOUT: flatbuffers::VOffsetT = 6;
368  pub const VT_STATISTICS: flatbuffers::VOffsetT = 8;
369  pub const VT_FOOTER: flatbuffers::VOffsetT = 10;
370
371  #[inline]
372  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
373    Postscript { _tab: table }
374  }
375  #[allow(unused_mut)]
376  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
377    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
378    args: &'args PostscriptArgs<'args>
379  ) -> flatbuffers::WIPOffset<Postscript<'bldr>> {
380    let mut builder = PostscriptBuilder::new(_fbb);
381    if let Some(x) = args.footer { builder.add_footer(x); }
382    if let Some(x) = args.statistics { builder.add_statistics(x); }
383    if let Some(x) = args.layout { builder.add_layout(x); }
384    if let Some(x) = args.dtype { builder.add_dtype(x); }
385    builder.finish()
386  }
387
388
389  /// Segment containing the root `DType` flatbuffer.
390  #[inline]
391  pub fn dtype(&self) -> Option<PostscriptSegment<'a>> {
392    // Safety:
393    // Created from valid Table for this object
394    // which contains a valid value in this slot
395    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<PostscriptSegment>>(Postscript::VT_DTYPE, None)}
396  }
397  /// Segment containing the root `Layout` flatbuffer (required).
398  #[inline]
399  pub fn layout(&self) -> Option<PostscriptSegment<'a>> {
400    // Safety:
401    // Created from valid Table for this object
402    // which contains a valid value in this slot
403    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<PostscriptSegment>>(Postscript::VT_LAYOUT, None)}
404  }
405  /// Segment containing the file-level `Statistics` flatbuffer.
406  #[inline]
407  pub fn statistics(&self) -> Option<PostscriptSegment<'a>> {
408    // Safety:
409    // Created from valid Table for this object
410    // which contains a valid value in this slot
411    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<PostscriptSegment>>(Postscript::VT_STATISTICS, None)}
412  }
413  /// Segment containing the 'Footer' flatbuffer (required)
414  #[inline]
415  pub fn footer(&self) -> Option<PostscriptSegment<'a>> {
416    // Safety:
417    // Created from valid Table for this object
418    // which contains a valid value in this slot
419    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<PostscriptSegment>>(Postscript::VT_FOOTER, None)}
420  }
421}
422
423impl flatbuffers::Verifiable for Postscript<'_> {
424  #[inline]
425  fn run_verifier(
426    v: &mut flatbuffers::Verifier, pos: usize
427  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
428    use self::flatbuffers::Verifiable;
429    v.visit_table(pos)?
430     .visit_field::<flatbuffers::ForwardsUOffset<PostscriptSegment>>("dtype", Self::VT_DTYPE, false)?
431     .visit_field::<flatbuffers::ForwardsUOffset<PostscriptSegment>>("layout", Self::VT_LAYOUT, false)?
432     .visit_field::<flatbuffers::ForwardsUOffset<PostscriptSegment>>("statistics", Self::VT_STATISTICS, false)?
433     .visit_field::<flatbuffers::ForwardsUOffset<PostscriptSegment>>("footer", Self::VT_FOOTER, false)?
434     .finish();
435    Ok(())
436  }
437}
438pub struct PostscriptArgs<'a> {
439    pub dtype: Option<flatbuffers::WIPOffset<PostscriptSegment<'a>>>,
440    pub layout: Option<flatbuffers::WIPOffset<PostscriptSegment<'a>>>,
441    pub statistics: Option<flatbuffers::WIPOffset<PostscriptSegment<'a>>>,
442    pub footer: Option<flatbuffers::WIPOffset<PostscriptSegment<'a>>>,
443}
444impl<'a> Default for PostscriptArgs<'a> {
445  #[inline]
446  fn default() -> Self {
447    PostscriptArgs {
448      dtype: None,
449      layout: None,
450      statistics: None,
451      footer: None,
452    }
453  }
454}
455
456pub struct PostscriptBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
457  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
458  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
459}
460impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> PostscriptBuilder<'a, 'b, A> {
461  #[inline]
462  pub fn add_dtype(&mut self, dtype: flatbuffers::WIPOffset<PostscriptSegment<'b >>) {
463    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<PostscriptSegment>>(Postscript::VT_DTYPE, dtype);
464  }
465  #[inline]
466  pub fn add_layout(&mut self, layout: flatbuffers::WIPOffset<PostscriptSegment<'b >>) {
467    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<PostscriptSegment>>(Postscript::VT_LAYOUT, layout);
468  }
469  #[inline]
470  pub fn add_statistics(&mut self, statistics: flatbuffers::WIPOffset<PostscriptSegment<'b >>) {
471    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<PostscriptSegment>>(Postscript::VT_STATISTICS, statistics);
472  }
473  #[inline]
474  pub fn add_footer(&mut self, footer: flatbuffers::WIPOffset<PostscriptSegment<'b >>) {
475    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<PostscriptSegment>>(Postscript::VT_FOOTER, footer);
476  }
477  #[inline]
478  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PostscriptBuilder<'a, 'b, A> {
479    let start = _fbb.start_table();
480    PostscriptBuilder {
481      fbb_: _fbb,
482      start_: start,
483    }
484  }
485  #[inline]
486  pub fn finish(self) -> flatbuffers::WIPOffset<Postscript<'a>> {
487    let o = self.fbb_.end_table(self.start_);
488    flatbuffers::WIPOffset::new(o.value())
489  }
490}
491
492impl core::fmt::Debug for Postscript<'_> {
493  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
494    let mut ds = f.debug_struct("Postscript");
495      ds.field("dtype", &self.dtype());
496      ds.field("layout", &self.layout());
497      ds.field("statistics", &self.statistics());
498      ds.field("footer", &self.footer());
499      ds.finish()
500  }
501}
502pub enum PostscriptSegmentOffset {}
503#[derive(Copy, Clone, PartialEq)]
504
505/// A `PostscriptSegment` describes the location of a segment in the file without referencing any
506/// specification objects. That is, encryption and compression are defined inline.
507pub struct PostscriptSegment<'a> {
508  pub _tab: flatbuffers::Table<'a>,
509}
510
511impl<'a> flatbuffers::Follow<'a> for PostscriptSegment<'a> {
512  type Inner = PostscriptSegment<'a>;
513  #[inline]
514  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
515    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
516  }
517}
518
519impl<'a> PostscriptSegment<'a> {
520  pub const VT_OFFSET: flatbuffers::VOffsetT = 4;
521  pub const VT_LENGTH: flatbuffers::VOffsetT = 6;
522  pub const VT_ALIGNMENT_EXPONENT: flatbuffers::VOffsetT = 8;
523  pub const VT__COMPRESSION: flatbuffers::VOffsetT = 10;
524  pub const VT__ENCRYPTION: flatbuffers::VOffsetT = 12;
525
526  #[inline]
527  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
528    PostscriptSegment { _tab: table }
529  }
530  #[allow(unused_mut)]
531  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
532    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
533    args: &'args PostscriptSegmentArgs<'args>
534  ) -> flatbuffers::WIPOffset<PostscriptSegment<'bldr>> {
535    let mut builder = PostscriptSegmentBuilder::new(_fbb);
536    builder.add_offset(args.offset);
537    if let Some(x) = args._encryption { builder.add__encryption(x); }
538    if let Some(x) = args._compression { builder.add__compression(x); }
539    builder.add_length(args.length);
540    builder.add_alignment_exponent(args.alignment_exponent);
541    builder.finish()
542  }
543
544
545  #[inline]
546  pub fn offset(&self) -> u64 {
547    // Safety:
548    // Created from valid Table for this object
549    // which contains a valid value in this slot
550    unsafe { self._tab.get::<u64>(PostscriptSegment::VT_OFFSET, Some(0)).unwrap()}
551  }
552  #[inline]
553  pub fn length(&self) -> u32 {
554    // Safety:
555    // Created from valid Table for this object
556    // which contains a valid value in this slot
557    unsafe { self._tab.get::<u32>(PostscriptSegment::VT_LENGTH, Some(0)).unwrap()}
558  }
559  #[inline]
560  pub fn alignment_exponent(&self) -> u8 {
561    // Safety:
562    // Created from valid Table for this object
563    // which contains a valid value in this slot
564    unsafe { self._tab.get::<u8>(PostscriptSegment::VT_ALIGNMENT_EXPONENT, Some(0)).unwrap()}
565  }
566  #[inline]
567  pub fn _compression(&self) -> Option<CompressionSpec<'a>> {
568    // Safety:
569    // Created from valid Table for this object
570    // which contains a valid value in this slot
571    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<CompressionSpec>>(PostscriptSegment::VT__COMPRESSION, None)}
572  }
573  #[inline]
574  pub fn _encryption(&self) -> Option<EncryptionSpec<'a>> {
575    // Safety:
576    // Created from valid Table for this object
577    // which contains a valid value in this slot
578    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<EncryptionSpec>>(PostscriptSegment::VT__ENCRYPTION, None)}
579  }
580}
581
582impl flatbuffers::Verifiable for PostscriptSegment<'_> {
583  #[inline]
584  fn run_verifier(
585    v: &mut flatbuffers::Verifier, pos: usize
586  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
587    use self::flatbuffers::Verifiable;
588    v.visit_table(pos)?
589     .visit_field::<u64>("offset", Self::VT_OFFSET, false)?
590     .visit_field::<u32>("length", Self::VT_LENGTH, false)?
591     .visit_field::<u8>("alignment_exponent", Self::VT_ALIGNMENT_EXPONENT, false)?
592     .visit_field::<flatbuffers::ForwardsUOffset<CompressionSpec>>("_compression", Self::VT__COMPRESSION, false)?
593     .visit_field::<flatbuffers::ForwardsUOffset<EncryptionSpec>>("_encryption", Self::VT__ENCRYPTION, false)?
594     .finish();
595    Ok(())
596  }
597}
598pub struct PostscriptSegmentArgs<'a> {
599    pub offset: u64,
600    pub length: u32,
601    pub alignment_exponent: u8,
602    pub _compression: Option<flatbuffers::WIPOffset<CompressionSpec<'a>>>,
603    pub _encryption: Option<flatbuffers::WIPOffset<EncryptionSpec<'a>>>,
604}
605impl<'a> Default for PostscriptSegmentArgs<'a> {
606  #[inline]
607  fn default() -> Self {
608    PostscriptSegmentArgs {
609      offset: 0,
610      length: 0,
611      alignment_exponent: 0,
612      _compression: None,
613      _encryption: None,
614    }
615  }
616}
617
618pub struct PostscriptSegmentBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
619  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
620  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
621}
622impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> PostscriptSegmentBuilder<'a, 'b, A> {
623  #[inline]
624  pub fn add_offset(&mut self, offset: u64) {
625    self.fbb_.push_slot::<u64>(PostscriptSegment::VT_OFFSET, offset, 0);
626  }
627  #[inline]
628  pub fn add_length(&mut self, length: u32) {
629    self.fbb_.push_slot::<u32>(PostscriptSegment::VT_LENGTH, length, 0);
630  }
631  #[inline]
632  pub fn add_alignment_exponent(&mut self, alignment_exponent: u8) {
633    self.fbb_.push_slot::<u8>(PostscriptSegment::VT_ALIGNMENT_EXPONENT, alignment_exponent, 0);
634  }
635  #[inline]
636  pub fn add__compression(&mut self, _compression: flatbuffers::WIPOffset<CompressionSpec<'b >>) {
637    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<CompressionSpec>>(PostscriptSegment::VT__COMPRESSION, _compression);
638  }
639  #[inline]
640  pub fn add__encryption(&mut self, _encryption: flatbuffers::WIPOffset<EncryptionSpec<'b >>) {
641    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<EncryptionSpec>>(PostscriptSegment::VT__ENCRYPTION, _encryption);
642  }
643  #[inline]
644  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> PostscriptSegmentBuilder<'a, 'b, A> {
645    let start = _fbb.start_table();
646    PostscriptSegmentBuilder {
647      fbb_: _fbb,
648      start_: start,
649    }
650  }
651  #[inline]
652  pub fn finish(self) -> flatbuffers::WIPOffset<PostscriptSegment<'a>> {
653    let o = self.fbb_.end_table(self.start_);
654    flatbuffers::WIPOffset::new(o.value())
655  }
656}
657
658impl core::fmt::Debug for PostscriptSegment<'_> {
659  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
660    let mut ds = f.debug_struct("PostscriptSegment");
661      ds.field("offset", &self.offset());
662      ds.field("length", &self.length());
663      ds.field("alignment_exponent", &self.alignment_exponent());
664      ds.field("_compression", &self._compression());
665      ds.field("_encryption", &self._encryption());
666      ds.finish()
667  }
668}
669pub enum FileStatisticsOffset {}
670#[derive(Copy, Clone, PartialEq)]
671
672/// The `FileStatistics` object contains file-level statistics for the Vortex file.
673pub struct FileStatistics<'a> {
674  pub _tab: flatbuffers::Table<'a>,
675}
676
677impl<'a> flatbuffers::Follow<'a> for FileStatistics<'a> {
678  type Inner = FileStatistics<'a>;
679  #[inline]
680  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
681    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
682  }
683}
684
685impl<'a> FileStatistics<'a> {
686  pub const VT_FIELD_STATS: flatbuffers::VOffsetT = 4;
687
688  #[inline]
689  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
690    FileStatistics { _tab: table }
691  }
692  #[allow(unused_mut)]
693  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
694    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
695    args: &'args FileStatisticsArgs<'args>
696  ) -> flatbuffers::WIPOffset<FileStatistics<'bldr>> {
697    let mut builder = FileStatisticsBuilder::new(_fbb);
698    if let Some(x) = args.field_stats { builder.add_field_stats(x); }
699    builder.finish()
700  }
701
702
703  /// Statistics for each field in the root schema. If the root schema is not a struct, there will
704  /// be a single entry in this array.
705  #[inline]
706  pub fn field_stats(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArrayStats<'a>>>> {
707    // Safety:
708    // Created from valid Table for this object
709    // which contains a valid value in this slot
710    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArrayStats>>>>(FileStatistics::VT_FIELD_STATS, None)}
711  }
712}
713
714impl flatbuffers::Verifiable for FileStatistics<'_> {
715  #[inline]
716  fn run_verifier(
717    v: &mut flatbuffers::Verifier, pos: usize
718  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
719    use self::flatbuffers::Verifiable;
720    v.visit_table(pos)?
721     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<ArrayStats>>>>("field_stats", Self::VT_FIELD_STATS, false)?
722     .finish();
723    Ok(())
724  }
725}
726pub struct FileStatisticsArgs<'a> {
727    pub field_stats: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArrayStats<'a>>>>>,
728}
729impl<'a> Default for FileStatisticsArgs<'a> {
730  #[inline]
731  fn default() -> Self {
732    FileStatisticsArgs {
733      field_stats: None,
734    }
735  }
736}
737
738pub struct FileStatisticsBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
739  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
740  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
741}
742impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FileStatisticsBuilder<'a, 'b, A> {
743  #[inline]
744  pub fn add_field_stats(&mut self, field_stats: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<ArrayStats<'b >>>>) {
745    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(FileStatistics::VT_FIELD_STATS, field_stats);
746  }
747  #[inline]
748  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> FileStatisticsBuilder<'a, 'b, A> {
749    let start = _fbb.start_table();
750    FileStatisticsBuilder {
751      fbb_: _fbb,
752      start_: start,
753    }
754  }
755  #[inline]
756  pub fn finish(self) -> flatbuffers::WIPOffset<FileStatistics<'a>> {
757    let o = self.fbb_.end_table(self.start_);
758    flatbuffers::WIPOffset::new(o.value())
759  }
760}
761
762impl core::fmt::Debug for FileStatistics<'_> {
763  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
764    let mut ds = f.debug_struct("FileStatistics");
765      ds.field("field_stats", &self.field_stats());
766      ds.finish()
767  }
768}
769pub enum FooterOffset {}
770#[derive(Copy, Clone, PartialEq)]
771
772/// The `Registry` object stores dictionary-encoded configuration for segments,
773/// compression schemes, encryption schemes, etc.
774pub struct Footer<'a> {
775  pub _tab: flatbuffers::Table<'a>,
776}
777
778impl<'a> flatbuffers::Follow<'a> for Footer<'a> {
779  type Inner = Footer<'a>;
780  #[inline]
781  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
782    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
783  }
784}
785
786impl<'a> Footer<'a> {
787  pub const VT_ARRAY_SPECS: flatbuffers::VOffsetT = 4;
788  pub const VT_LAYOUT_SPECS: flatbuffers::VOffsetT = 6;
789  pub const VT_SEGMENT_SPECS: flatbuffers::VOffsetT = 8;
790  pub const VT_COMPRESSION_SPECS: flatbuffers::VOffsetT = 10;
791  pub const VT_ENCRYPTION_SPECS: flatbuffers::VOffsetT = 12;
792
793  #[inline]
794  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
795    Footer { _tab: table }
796  }
797  #[allow(unused_mut)]
798  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
799    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
800    args: &'args FooterArgs<'args>
801  ) -> flatbuffers::WIPOffset<Footer<'bldr>> {
802    let mut builder = FooterBuilder::new(_fbb);
803    if let Some(x) = args.encryption_specs { builder.add_encryption_specs(x); }
804    if let Some(x) = args.compression_specs { builder.add_compression_specs(x); }
805    if let Some(x) = args.segment_specs { builder.add_segment_specs(x); }
806    if let Some(x) = args.layout_specs { builder.add_layout_specs(x); }
807    if let Some(x) = args.array_specs { builder.add_array_specs(x); }
808    builder.finish()
809  }
810
811
812  #[inline]
813  pub fn array_specs(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArraySpec<'a>>>> {
814    // Safety:
815    // Created from valid Table for this object
816    // which contains a valid value in this slot
817    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArraySpec>>>>(Footer::VT_ARRAY_SPECS, None)}
818  }
819  #[inline]
820  pub fn layout_specs(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<LayoutSpec<'a>>>> {
821    // Safety:
822    // Created from valid Table for this object
823    // which contains a valid value in this slot
824    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<LayoutSpec>>>>(Footer::VT_LAYOUT_SPECS, None)}
825  }
826  #[inline]
827  pub fn segment_specs(&self) -> Option<flatbuffers::Vector<'a, SegmentSpec>> {
828    // Safety:
829    // Created from valid Table for this object
830    // which contains a valid value in this slot
831    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, SegmentSpec>>>(Footer::VT_SEGMENT_SPECS, None)}
832  }
833  #[inline]
834  pub fn compression_specs(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<CompressionSpec<'a>>>> {
835    // Safety:
836    // Created from valid Table for this object
837    // which contains a valid value in this slot
838    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<CompressionSpec>>>>(Footer::VT_COMPRESSION_SPECS, None)}
839  }
840  #[inline]
841  pub fn encryption_specs(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<EncryptionSpec<'a>>>> {
842    // Safety:
843    // Created from valid Table for this object
844    // which contains a valid value in this slot
845    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<EncryptionSpec>>>>(Footer::VT_ENCRYPTION_SPECS, None)}
846  }
847}
848
849impl flatbuffers::Verifiable for Footer<'_> {
850  #[inline]
851  fn run_verifier(
852    v: &mut flatbuffers::Verifier, pos: usize
853  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
854    use self::flatbuffers::Verifiable;
855    v.visit_table(pos)?
856     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<ArraySpec>>>>("array_specs", Self::VT_ARRAY_SPECS, false)?
857     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<LayoutSpec>>>>("layout_specs", Self::VT_LAYOUT_SPECS, false)?
858     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, SegmentSpec>>>("segment_specs", Self::VT_SEGMENT_SPECS, false)?
859     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<CompressionSpec>>>>("compression_specs", Self::VT_COMPRESSION_SPECS, false)?
860     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<EncryptionSpec>>>>("encryption_specs", Self::VT_ENCRYPTION_SPECS, false)?
861     .finish();
862    Ok(())
863  }
864}
865pub struct FooterArgs<'a> {
866    pub array_specs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<ArraySpec<'a>>>>>,
867    pub layout_specs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<LayoutSpec<'a>>>>>,
868    pub segment_specs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, SegmentSpec>>>,
869    pub compression_specs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<CompressionSpec<'a>>>>>,
870    pub encryption_specs: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<EncryptionSpec<'a>>>>>,
871}
872impl<'a> Default for FooterArgs<'a> {
873  #[inline]
874  fn default() -> Self {
875    FooterArgs {
876      array_specs: None,
877      layout_specs: None,
878      segment_specs: None,
879      compression_specs: None,
880      encryption_specs: None,
881    }
882  }
883}
884
885pub struct FooterBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
886  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
887  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
888}
889impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> FooterBuilder<'a, 'b, A> {
890  #[inline]
891  pub fn add_array_specs(&mut self, array_specs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<ArraySpec<'b >>>>) {
892    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Footer::VT_ARRAY_SPECS, array_specs);
893  }
894  #[inline]
895  pub fn add_layout_specs(&mut self, layout_specs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<LayoutSpec<'b >>>>) {
896    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Footer::VT_LAYOUT_SPECS, layout_specs);
897  }
898  #[inline]
899  pub fn add_segment_specs(&mut self, segment_specs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , SegmentSpec>>) {
900    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Footer::VT_SEGMENT_SPECS, segment_specs);
901  }
902  #[inline]
903  pub fn add_compression_specs(&mut self, compression_specs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<CompressionSpec<'b >>>>) {
904    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Footer::VT_COMPRESSION_SPECS, compression_specs);
905  }
906  #[inline]
907  pub fn add_encryption_specs(&mut self, encryption_specs: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<EncryptionSpec<'b >>>>) {
908    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Footer::VT_ENCRYPTION_SPECS, encryption_specs);
909  }
910  #[inline]
911  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> FooterBuilder<'a, 'b, A> {
912    let start = _fbb.start_table();
913    FooterBuilder {
914      fbb_: _fbb,
915      start_: start,
916    }
917  }
918  #[inline]
919  pub fn finish(self) -> flatbuffers::WIPOffset<Footer<'a>> {
920    let o = self.fbb_.end_table(self.start_);
921    flatbuffers::WIPOffset::new(o.value())
922  }
923}
924
925impl core::fmt::Debug for Footer<'_> {
926  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
927    let mut ds = f.debug_struct("Footer");
928      ds.field("array_specs", &self.array_specs());
929      ds.field("layout_specs", &self.layout_specs());
930      ds.field("segment_specs", &self.segment_specs());
931      ds.field("compression_specs", &self.compression_specs());
932      ds.field("encryption_specs", &self.encryption_specs());
933      ds.finish()
934  }
935}
936pub enum ArraySpecOffset {}
937#[derive(Copy, Clone, PartialEq)]
938
939/// An `ArraySpec` describes the type of a particular array.
940///
941/// These are identified by a globally unique string identifier, and looked up in the Vortex registry
942/// at read-time.
943pub struct ArraySpec<'a> {
944  pub _tab: flatbuffers::Table<'a>,
945}
946
947impl<'a> flatbuffers::Follow<'a> for ArraySpec<'a> {
948  type Inner = ArraySpec<'a>;
949  #[inline]
950  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
951    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
952  }
953}
954
955impl<'a> ArraySpec<'a> {
956  pub const VT_ID: flatbuffers::VOffsetT = 4;
957
958  #[inline]
959  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
960    ArraySpec { _tab: table }
961  }
962  #[allow(unused_mut)]
963  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
964    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
965    args: &'args ArraySpecArgs<'args>
966  ) -> flatbuffers::WIPOffset<ArraySpec<'bldr>> {
967    let mut builder = ArraySpecBuilder::new(_fbb);
968    if let Some(x) = args.id { builder.add_id(x); }
969    builder.finish()
970  }
971
972
973  #[inline]
974  pub fn id(&self) -> &'a str {
975    // Safety:
976    // Created from valid Table for this object
977    // which contains a valid value in this slot
978    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(ArraySpec::VT_ID, None).unwrap()}
979  }
980}
981
982impl flatbuffers::Verifiable for ArraySpec<'_> {
983  #[inline]
984  fn run_verifier(
985    v: &mut flatbuffers::Verifier, pos: usize
986  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
987    use self::flatbuffers::Verifiable;
988    v.visit_table(pos)?
989     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, true)?
990     .finish();
991    Ok(())
992  }
993}
994pub struct ArraySpecArgs<'a> {
995    pub id: Option<flatbuffers::WIPOffset<&'a str>>,
996}
997impl<'a> Default for ArraySpecArgs<'a> {
998  #[inline]
999  fn default() -> Self {
1000    ArraySpecArgs {
1001      id: None, // required field
1002    }
1003  }
1004}
1005
1006pub struct ArraySpecBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1007  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1008  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1009}
1010impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> ArraySpecBuilder<'a, 'b, A> {
1011  #[inline]
1012  pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b  str>) {
1013    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ArraySpec::VT_ID, id);
1014  }
1015  #[inline]
1016  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> ArraySpecBuilder<'a, 'b, A> {
1017    let start = _fbb.start_table();
1018    ArraySpecBuilder {
1019      fbb_: _fbb,
1020      start_: start,
1021    }
1022  }
1023  #[inline]
1024  pub fn finish(self) -> flatbuffers::WIPOffset<ArraySpec<'a>> {
1025    let o = self.fbb_.end_table(self.start_);
1026    self.fbb_.required(o, ArraySpec::VT_ID,"id");
1027    flatbuffers::WIPOffset::new(o.value())
1028  }
1029}
1030
1031impl core::fmt::Debug for ArraySpec<'_> {
1032  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1033    let mut ds = f.debug_struct("ArraySpec");
1034      ds.field("id", &self.id());
1035      ds.finish()
1036  }
1037}
1038pub enum LayoutSpecOffset {}
1039#[derive(Copy, Clone, PartialEq)]
1040
1041/// A `LayoutSpec` describes the type of a particular layout.
1042///
1043/// These are identified by a globally unique string identifier, and looked up in the Vortex registry
1044/// at read-time.
1045pub struct LayoutSpec<'a> {
1046  pub _tab: flatbuffers::Table<'a>,
1047}
1048
1049impl<'a> flatbuffers::Follow<'a> for LayoutSpec<'a> {
1050  type Inner = LayoutSpec<'a>;
1051  #[inline]
1052  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1053    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
1054  }
1055}
1056
1057impl<'a> LayoutSpec<'a> {
1058  pub const VT_ID: flatbuffers::VOffsetT = 4;
1059
1060  #[inline]
1061  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1062    LayoutSpec { _tab: table }
1063  }
1064  #[allow(unused_mut)]
1065  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1066    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1067    args: &'args LayoutSpecArgs<'args>
1068  ) -> flatbuffers::WIPOffset<LayoutSpec<'bldr>> {
1069    let mut builder = LayoutSpecBuilder::new(_fbb);
1070    if let Some(x) = args.id { builder.add_id(x); }
1071    builder.finish()
1072  }
1073
1074
1075  #[inline]
1076  pub fn id(&self) -> &'a str {
1077    // Safety:
1078    // Created from valid Table for this object
1079    // which contains a valid value in this slot
1080    unsafe { self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(LayoutSpec::VT_ID, None).unwrap()}
1081  }
1082}
1083
1084impl flatbuffers::Verifiable for LayoutSpec<'_> {
1085  #[inline]
1086  fn run_verifier(
1087    v: &mut flatbuffers::Verifier, pos: usize
1088  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1089    use self::flatbuffers::Verifiable;
1090    v.visit_table(pos)?
1091     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, true)?
1092     .finish();
1093    Ok(())
1094  }
1095}
1096pub struct LayoutSpecArgs<'a> {
1097    pub id: Option<flatbuffers::WIPOffset<&'a str>>,
1098}
1099impl<'a> Default for LayoutSpecArgs<'a> {
1100  #[inline]
1101  fn default() -> Self {
1102    LayoutSpecArgs {
1103      id: None, // required field
1104    }
1105  }
1106}
1107
1108pub struct LayoutSpecBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1109  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1110  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1111}
1112impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> LayoutSpecBuilder<'a, 'b, A> {
1113  #[inline]
1114  pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b  str>) {
1115    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(LayoutSpec::VT_ID, id);
1116  }
1117  #[inline]
1118  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> LayoutSpecBuilder<'a, 'b, A> {
1119    let start = _fbb.start_table();
1120    LayoutSpecBuilder {
1121      fbb_: _fbb,
1122      start_: start,
1123    }
1124  }
1125  #[inline]
1126  pub fn finish(self) -> flatbuffers::WIPOffset<LayoutSpec<'a>> {
1127    let o = self.fbb_.end_table(self.start_);
1128    self.fbb_.required(o, LayoutSpec::VT_ID,"id");
1129    flatbuffers::WIPOffset::new(o.value())
1130  }
1131}
1132
1133impl core::fmt::Debug for LayoutSpec<'_> {
1134  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1135    let mut ds = f.debug_struct("LayoutSpec");
1136      ds.field("id", &self.id());
1137      ds.finish()
1138  }
1139}
1140pub enum CompressionSpecOffset {}
1141#[derive(Copy, Clone, PartialEq)]
1142
1143/// Definition of a compression scheme.
1144pub struct CompressionSpec<'a> {
1145  pub _tab: flatbuffers::Table<'a>,
1146}
1147
1148impl<'a> flatbuffers::Follow<'a> for CompressionSpec<'a> {
1149  type Inner = CompressionSpec<'a>;
1150  #[inline]
1151  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1152    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
1153  }
1154}
1155
1156impl<'a> CompressionSpec<'a> {
1157  pub const VT_SCHEME: flatbuffers::VOffsetT = 4;
1158
1159  #[inline]
1160  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1161    CompressionSpec { _tab: table }
1162  }
1163  #[allow(unused_mut)]
1164  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1165    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1166    args: &'args CompressionSpecArgs
1167  ) -> flatbuffers::WIPOffset<CompressionSpec<'bldr>> {
1168    let mut builder = CompressionSpecBuilder::new(_fbb);
1169    builder.add_scheme(args.scheme);
1170    builder.finish()
1171  }
1172
1173
1174  #[inline]
1175  pub fn scheme(&self) -> CompressionScheme {
1176    // Safety:
1177    // Created from valid Table for this object
1178    // which contains a valid value in this slot
1179    unsafe { self._tab.get::<CompressionScheme>(CompressionSpec::VT_SCHEME, Some(CompressionScheme::None)).unwrap()}
1180  }
1181}
1182
1183impl flatbuffers::Verifiable for CompressionSpec<'_> {
1184  #[inline]
1185  fn run_verifier(
1186    v: &mut flatbuffers::Verifier, pos: usize
1187  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1188    use self::flatbuffers::Verifiable;
1189    v.visit_table(pos)?
1190     .visit_field::<CompressionScheme>("scheme", Self::VT_SCHEME, false)?
1191     .finish();
1192    Ok(())
1193  }
1194}
1195pub struct CompressionSpecArgs {
1196    pub scheme: CompressionScheme,
1197}
1198impl<'a> Default for CompressionSpecArgs {
1199  #[inline]
1200  fn default() -> Self {
1201    CompressionSpecArgs {
1202      scheme: CompressionScheme::None,
1203    }
1204  }
1205}
1206
1207pub struct CompressionSpecBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1208  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1209  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1210}
1211impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> CompressionSpecBuilder<'a, 'b, A> {
1212  #[inline]
1213  pub fn add_scheme(&mut self, scheme: CompressionScheme) {
1214    self.fbb_.push_slot::<CompressionScheme>(CompressionSpec::VT_SCHEME, scheme, CompressionScheme::None);
1215  }
1216  #[inline]
1217  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> CompressionSpecBuilder<'a, 'b, A> {
1218    let start = _fbb.start_table();
1219    CompressionSpecBuilder {
1220      fbb_: _fbb,
1221      start_: start,
1222    }
1223  }
1224  #[inline]
1225  pub fn finish(self) -> flatbuffers::WIPOffset<CompressionSpec<'a>> {
1226    let o = self.fbb_.end_table(self.start_);
1227    flatbuffers::WIPOffset::new(o.value())
1228  }
1229}
1230
1231impl core::fmt::Debug for CompressionSpec<'_> {
1232  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1233    let mut ds = f.debug_struct("CompressionSpec");
1234      ds.field("scheme", &self.scheme());
1235      ds.finish()
1236  }
1237}
1238pub enum EncryptionSpecOffset {}
1239#[derive(Copy, Clone, PartialEq)]
1240
1241pub struct EncryptionSpec<'a> {
1242  pub _tab: flatbuffers::Table<'a>,
1243}
1244
1245impl<'a> flatbuffers::Follow<'a> for EncryptionSpec<'a> {
1246  type Inner = EncryptionSpec<'a>;
1247  #[inline]
1248  unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1249    Self { _tab: unsafe { flatbuffers::Table::new(buf, loc) } }
1250  }
1251}
1252
1253impl<'a> EncryptionSpec<'a> {
1254
1255  #[inline]
1256  pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1257    EncryptionSpec { _tab: table }
1258  }
1259  #[allow(unused_mut)]
1260  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: flatbuffers::Allocator + 'bldr>(
1261    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr, A>,
1262    _args: &'args EncryptionSpecArgs
1263  ) -> flatbuffers::WIPOffset<EncryptionSpec<'bldr>> {
1264    let mut builder = EncryptionSpecBuilder::new(_fbb);
1265    builder.finish()
1266  }
1267
1268}
1269
1270impl flatbuffers::Verifiable for EncryptionSpec<'_> {
1271  #[inline]
1272  fn run_verifier(
1273    v: &mut flatbuffers::Verifier, pos: usize
1274  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1275    use self::flatbuffers::Verifiable;
1276    v.visit_table(pos)?
1277     .finish();
1278    Ok(())
1279  }
1280}
1281pub struct EncryptionSpecArgs {
1282}
1283impl<'a> Default for EncryptionSpecArgs {
1284  #[inline]
1285  fn default() -> Self {
1286    EncryptionSpecArgs {
1287    }
1288  }
1289}
1290
1291pub struct EncryptionSpecBuilder<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> {
1292  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1293  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1294}
1295impl<'a: 'b, 'b, A: flatbuffers::Allocator + 'a> EncryptionSpecBuilder<'a, 'b, A> {
1296  #[inline]
1297  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>) -> EncryptionSpecBuilder<'a, 'b, A> {
1298    let start = _fbb.start_table();
1299    EncryptionSpecBuilder {
1300      fbb_: _fbb,
1301      start_: start,
1302    }
1303  }
1304  #[inline]
1305  pub fn finish(self) -> flatbuffers::WIPOffset<EncryptionSpec<'a>> {
1306    let o = self.fbb_.end_table(self.start_);
1307    flatbuffers::WIPOffset::new(o.value())
1308  }
1309}
1310
1311impl core::fmt::Debug for EncryptionSpec<'_> {
1312  fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1313    let mut ds = f.debug_struct("EncryptionSpec");
1314      ds.finish()
1315  }
1316}
1317#[inline]
1318/// Verifies that a buffer of bytes contains a `Postscript`
1319/// and returns it.
1320/// Note that verification is still experimental and may not
1321/// catch every error, or be maximally performant. For the
1322/// previous, unchecked, behavior use
1323/// `root_as_postscript_unchecked`.
1324pub fn root_as_postscript(buf: &[u8]) -> Result<Postscript, flatbuffers::InvalidFlatbuffer> {
1325  flatbuffers::root::<Postscript>(buf)
1326}
1327#[inline]
1328/// Verifies that a buffer of bytes contains a size prefixed
1329/// `Postscript` and returns it.
1330/// Note that verification is still experimental and may not
1331/// catch every error, or be maximally performant. For the
1332/// previous, unchecked, behavior use
1333/// `size_prefixed_root_as_postscript_unchecked`.
1334pub fn size_prefixed_root_as_postscript(buf: &[u8]) -> Result<Postscript, flatbuffers::InvalidFlatbuffer> {
1335  flatbuffers::size_prefixed_root::<Postscript>(buf)
1336}
1337#[inline]
1338/// Verifies, with the given options, that a buffer of bytes
1339/// contains a `Postscript` and returns it.
1340/// Note that verification is still experimental and may not
1341/// catch every error, or be maximally performant. For the
1342/// previous, unchecked, behavior use
1343/// `root_as_postscript_unchecked`.
1344pub fn root_as_postscript_with_opts<'b, 'o>(
1345  opts: &'o flatbuffers::VerifierOptions,
1346  buf: &'b [u8],
1347) -> Result<Postscript<'b>, flatbuffers::InvalidFlatbuffer> {
1348  flatbuffers::root_with_opts::<Postscript<'b>>(opts, buf)
1349}
1350#[inline]
1351/// Verifies, with the given verifier options, that a buffer of
1352/// bytes contains a size prefixed `Postscript` and returns
1353/// it. Note that verification is still experimental and may not
1354/// catch every error, or be maximally performant. For the
1355/// previous, unchecked, behavior use
1356/// `root_as_postscript_unchecked`.
1357pub fn size_prefixed_root_as_postscript_with_opts<'b, 'o>(
1358  opts: &'o flatbuffers::VerifierOptions,
1359  buf: &'b [u8],
1360) -> Result<Postscript<'b>, flatbuffers::InvalidFlatbuffer> {
1361  flatbuffers::size_prefixed_root_with_opts::<Postscript<'b>>(opts, buf)
1362}
1363#[inline]
1364/// Assumes, without verification, that a buffer of bytes contains a Postscript and returns it.
1365/// # Safety
1366/// Callers must trust the given bytes do indeed contain a valid `Postscript`.
1367pub unsafe fn root_as_postscript_unchecked(buf: &[u8]) -> Postscript {
1368  unsafe { flatbuffers::root_unchecked::<Postscript>(buf) }
1369}
1370#[inline]
1371/// Assumes, without verification, that a buffer of bytes contains a size prefixed Postscript and returns it.
1372/// # Safety
1373/// Callers must trust the given bytes do indeed contain a valid size prefixed `Postscript`.
1374pub unsafe fn size_prefixed_root_as_postscript_unchecked(buf: &[u8]) -> Postscript {
1375  unsafe { flatbuffers::size_prefixed_root_unchecked::<Postscript>(buf) }
1376}
1377#[inline]
1378pub fn finish_postscript_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(
1379    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>,
1380    root: flatbuffers::WIPOffset<Postscript<'a>>) {
1381  fbb.finish(root, None);
1382}
1383
1384#[inline]
1385pub fn finish_size_prefixed_postscript_buffer<'a, 'b, A: flatbuffers::Allocator + 'a>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a, A>, root: flatbuffers::WIPOffset<Postscript<'a>>) {
1386  fbb.finish_size_prefixed(root, None);
1387}