arrow_ipc/gen/
Schema.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#![allow(dead_code)]
19#![allow(unused_imports)]
20
21use flatbuffers::EndianScalar;
22use std::{cmp::Ordering, mem};
23// automatically generated by the FlatBuffers compiler, do not modify
24
25// @generated
26
27#[deprecated(
28    since = "2.0.0",
29    note = "Use associated constants instead. This will no longer be generated in 2021."
30)]
31pub const ENUM_MIN_METADATA_VERSION: i16 = 0;
32#[deprecated(
33    since = "2.0.0",
34    note = "Use associated constants instead. This will no longer be generated in 2021."
35)]
36pub const ENUM_MAX_METADATA_VERSION: i16 = 4;
37#[deprecated(
38    since = "2.0.0",
39    note = "Use associated constants instead. This will no longer be generated in 2021."
40)]
41#[allow(non_camel_case_types)]
42pub const ENUM_VALUES_METADATA_VERSION: [MetadataVersion; 5] = [
43    MetadataVersion::V1,
44    MetadataVersion::V2,
45    MetadataVersion::V3,
46    MetadataVersion::V4,
47    MetadataVersion::V5,
48];
49
50#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
51#[repr(transparent)]
52pub struct MetadataVersion(pub i16);
53#[allow(non_upper_case_globals)]
54impl MetadataVersion {
55    /// 0.1.0 (October 2016).
56    pub const V1: Self = Self(0);
57    /// 0.2.0 (February 2017). Non-backwards compatible with V1.
58    pub const V2: Self = Self(1);
59    /// 0.3.0 -> 0.7.1 (May - December 2017). Non-backwards compatible with V2.
60    pub const V3: Self = Self(2);
61    /// >= 0.8.0 (December 2017). Non-backwards compatible with V3.
62    pub const V4: Self = Self(3);
63    /// >= 1.0.0 (July 2020). Backwards compatible with V4 (V5 readers can read V4
64    /// metadata and IPC messages). Implementations are recommended to provide a
65    /// V4 compatibility mode with V5 format changes disabled.
66    ///
67    /// Incompatible changes between V4 and V5:
68    /// - Union buffer layout has changed. In V5, Unions don't have a validity
69    ///   bitmap buffer.
70    pub const V5: Self = Self(4);
71
72    pub const ENUM_MIN: i16 = 0;
73    pub const ENUM_MAX: i16 = 4;
74    pub const ENUM_VALUES: &'static [Self] = &[Self::V1, Self::V2, Self::V3, Self::V4, Self::V5];
75    /// Returns the variant's name or "" if unknown.
76    pub fn variant_name(self) -> Option<&'static str> {
77        match self {
78            Self::V1 => Some("V1"),
79            Self::V2 => Some("V2"),
80            Self::V3 => Some("V3"),
81            Self::V4 => Some("V4"),
82            Self::V5 => Some("V5"),
83            _ => None,
84        }
85    }
86}
87impl core::fmt::Debug for MetadataVersion {
88    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
89        if let Some(name) = self.variant_name() {
90            f.write_str(name)
91        } else {
92            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
93        }
94    }
95}
96impl<'a> flatbuffers::Follow<'a> for MetadataVersion {
97    type Inner = Self;
98    #[inline]
99    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
100        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
101        Self(b)
102    }
103}
104
105impl flatbuffers::Push for MetadataVersion {
106    type Output = MetadataVersion;
107    #[inline]
108    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
109        flatbuffers::emplace_scalar::<i16>(dst, self.0);
110    }
111}
112
113impl flatbuffers::EndianScalar for MetadataVersion {
114    type Scalar = i16;
115    #[inline]
116    fn to_little_endian(self) -> i16 {
117        self.0.to_le()
118    }
119    #[inline]
120    #[allow(clippy::wrong_self_convention)]
121    fn from_little_endian(v: i16) -> Self {
122        let b = i16::from_le(v);
123        Self(b)
124    }
125}
126
127impl<'a> flatbuffers::Verifiable for MetadataVersion {
128    #[inline]
129    fn run_verifier(
130        v: &mut flatbuffers::Verifier,
131        pos: usize,
132    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
133        use flatbuffers::Verifiable;
134        i16::run_verifier(v, pos)
135    }
136}
137
138impl flatbuffers::SimpleToVerifyInSlice for MetadataVersion {}
139#[deprecated(
140    since = "2.0.0",
141    note = "Use associated constants instead. This will no longer be generated in 2021."
142)]
143pub const ENUM_MIN_FEATURE: i64 = 0;
144#[deprecated(
145    since = "2.0.0",
146    note = "Use associated constants instead. This will no longer be generated in 2021."
147)]
148pub const ENUM_MAX_FEATURE: i64 = 2;
149#[deprecated(
150    since = "2.0.0",
151    note = "Use associated constants instead. This will no longer be generated in 2021."
152)]
153#[allow(non_camel_case_types)]
154pub const ENUM_VALUES_FEATURE: [Feature; 3] = [
155    Feature::UNUSED,
156    Feature::DICTIONARY_REPLACEMENT,
157    Feature::COMPRESSED_BODY,
158];
159
160/// Represents Arrow Features that might not have full support
161/// within implementations. This is intended to be used in
162/// two scenarios:
163///  1.  A mechanism for readers of Arrow Streams
164///      and files to understand that the stream or file makes
165///      use of a feature that isn't supported or unknown to
166///      the implementation (and therefore can meet the Arrow
167///      forward compatibility guarantees).
168///  2.  A means of negotiating between a client and server
169///      what features a stream is allowed to use. The enums
170///      values here are intented to represent higher level
171///      features, additional details maybe negotiated
172///      with key-value pairs specific to the protocol.
173///
174/// Enums added to this list should be assigned power-of-two values
175/// to facilitate exchanging and comparing bitmaps for supported
176/// features.
177#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
178#[repr(transparent)]
179pub struct Feature(pub i64);
180#[allow(non_upper_case_globals)]
181impl Feature {
182    /// Needed to make flatbuffers happy.
183    pub const UNUSED: Self = Self(0);
184    /// The stream makes use of multiple full dictionaries with the
185    /// same ID and assumes clients implement dictionary replacement
186    /// correctly.
187    pub const DICTIONARY_REPLACEMENT: Self = Self(1);
188    /// The stream makes use of compressed bodies as described
189    /// in Message.fbs.
190    pub const COMPRESSED_BODY: Self = Self(2);
191
192    pub const ENUM_MIN: i64 = 0;
193    pub const ENUM_MAX: i64 = 2;
194    pub const ENUM_VALUES: &'static [Self] = &[
195        Self::UNUSED,
196        Self::DICTIONARY_REPLACEMENT,
197        Self::COMPRESSED_BODY,
198    ];
199    /// Returns the variant's name or "" if unknown.
200    pub fn variant_name(self) -> Option<&'static str> {
201        match self {
202            Self::UNUSED => Some("UNUSED"),
203            Self::DICTIONARY_REPLACEMENT => Some("DICTIONARY_REPLACEMENT"),
204            Self::COMPRESSED_BODY => Some("COMPRESSED_BODY"),
205            _ => None,
206        }
207    }
208}
209impl core::fmt::Debug for Feature {
210    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
211        if let Some(name) = self.variant_name() {
212            f.write_str(name)
213        } else {
214            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
215        }
216    }
217}
218impl<'a> flatbuffers::Follow<'a> for Feature {
219    type Inner = Self;
220    #[inline]
221    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
222        let b = flatbuffers::read_scalar_at::<i64>(buf, loc);
223        Self(b)
224    }
225}
226
227impl flatbuffers::Push for Feature {
228    type Output = Feature;
229    #[inline]
230    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
231        flatbuffers::emplace_scalar::<i64>(dst, self.0);
232    }
233}
234
235impl flatbuffers::EndianScalar for Feature {
236    type Scalar = i64;
237    #[inline]
238    fn to_little_endian(self) -> i64 {
239        self.0.to_le()
240    }
241    #[inline]
242    #[allow(clippy::wrong_self_convention)]
243    fn from_little_endian(v: i64) -> Self {
244        let b = i64::from_le(v);
245        Self(b)
246    }
247}
248
249impl<'a> flatbuffers::Verifiable for Feature {
250    #[inline]
251    fn run_verifier(
252        v: &mut flatbuffers::Verifier,
253        pos: usize,
254    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
255        use flatbuffers::Verifiable;
256        i64::run_verifier(v, pos)
257    }
258}
259
260impl flatbuffers::SimpleToVerifyInSlice for Feature {}
261#[deprecated(
262    since = "2.0.0",
263    note = "Use associated constants instead. This will no longer be generated in 2021."
264)]
265pub const ENUM_MIN_UNION_MODE: i16 = 0;
266#[deprecated(
267    since = "2.0.0",
268    note = "Use associated constants instead. This will no longer be generated in 2021."
269)]
270pub const ENUM_MAX_UNION_MODE: i16 = 1;
271#[deprecated(
272    since = "2.0.0",
273    note = "Use associated constants instead. This will no longer be generated in 2021."
274)]
275#[allow(non_camel_case_types)]
276pub const ENUM_VALUES_UNION_MODE: [UnionMode; 2] = [UnionMode::Sparse, UnionMode::Dense];
277
278#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
279#[repr(transparent)]
280pub struct UnionMode(pub i16);
281#[allow(non_upper_case_globals)]
282impl UnionMode {
283    pub const Sparse: Self = Self(0);
284    pub const Dense: Self = Self(1);
285
286    pub const ENUM_MIN: i16 = 0;
287    pub const ENUM_MAX: i16 = 1;
288    pub const ENUM_VALUES: &'static [Self] = &[Self::Sparse, Self::Dense];
289    /// Returns the variant's name or "" if unknown.
290    pub fn variant_name(self) -> Option<&'static str> {
291        match self {
292            Self::Sparse => Some("Sparse"),
293            Self::Dense => Some("Dense"),
294            _ => None,
295        }
296    }
297}
298impl core::fmt::Debug for UnionMode {
299    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
300        if let Some(name) = self.variant_name() {
301            f.write_str(name)
302        } else {
303            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
304        }
305    }
306}
307impl<'a> flatbuffers::Follow<'a> for UnionMode {
308    type Inner = Self;
309    #[inline]
310    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
311        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
312        Self(b)
313    }
314}
315
316impl flatbuffers::Push for UnionMode {
317    type Output = UnionMode;
318    #[inline]
319    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
320        flatbuffers::emplace_scalar::<i16>(dst, self.0);
321    }
322}
323
324impl flatbuffers::EndianScalar for UnionMode {
325    type Scalar = i16;
326    #[inline]
327    fn to_little_endian(self) -> i16 {
328        self.0.to_le()
329    }
330    #[inline]
331    #[allow(clippy::wrong_self_convention)]
332    fn from_little_endian(v: i16) -> Self {
333        let b = i16::from_le(v);
334        Self(b)
335    }
336}
337
338impl<'a> flatbuffers::Verifiable for UnionMode {
339    #[inline]
340    fn run_verifier(
341        v: &mut flatbuffers::Verifier,
342        pos: usize,
343    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
344        use flatbuffers::Verifiable;
345        i16::run_verifier(v, pos)
346    }
347}
348
349impl flatbuffers::SimpleToVerifyInSlice for UnionMode {}
350#[deprecated(
351    since = "2.0.0",
352    note = "Use associated constants instead. This will no longer be generated in 2021."
353)]
354pub const ENUM_MIN_PRECISION: i16 = 0;
355#[deprecated(
356    since = "2.0.0",
357    note = "Use associated constants instead. This will no longer be generated in 2021."
358)]
359pub const ENUM_MAX_PRECISION: i16 = 2;
360#[deprecated(
361    since = "2.0.0",
362    note = "Use associated constants instead. This will no longer be generated in 2021."
363)]
364#[allow(non_camel_case_types)]
365pub const ENUM_VALUES_PRECISION: [Precision; 3] =
366    [Precision::HALF, Precision::SINGLE, Precision::DOUBLE];
367
368#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
369#[repr(transparent)]
370pub struct Precision(pub i16);
371#[allow(non_upper_case_globals)]
372impl Precision {
373    pub const HALF: Self = Self(0);
374    pub const SINGLE: Self = Self(1);
375    pub const DOUBLE: Self = Self(2);
376
377    pub const ENUM_MIN: i16 = 0;
378    pub const ENUM_MAX: i16 = 2;
379    pub const ENUM_VALUES: &'static [Self] = &[Self::HALF, Self::SINGLE, Self::DOUBLE];
380    /// Returns the variant's name or "" if unknown.
381    pub fn variant_name(self) -> Option<&'static str> {
382        match self {
383            Self::HALF => Some("HALF"),
384            Self::SINGLE => Some("SINGLE"),
385            Self::DOUBLE => Some("DOUBLE"),
386            _ => None,
387        }
388    }
389}
390impl core::fmt::Debug for Precision {
391    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
392        if let Some(name) = self.variant_name() {
393            f.write_str(name)
394        } else {
395            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
396        }
397    }
398}
399impl<'a> flatbuffers::Follow<'a> for Precision {
400    type Inner = Self;
401    #[inline]
402    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
403        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
404        Self(b)
405    }
406}
407
408impl flatbuffers::Push for Precision {
409    type Output = Precision;
410    #[inline]
411    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
412        flatbuffers::emplace_scalar::<i16>(dst, self.0);
413    }
414}
415
416impl flatbuffers::EndianScalar for Precision {
417    type Scalar = i16;
418    #[inline]
419    fn to_little_endian(self) -> i16 {
420        self.0.to_le()
421    }
422    #[inline]
423    #[allow(clippy::wrong_self_convention)]
424    fn from_little_endian(v: i16) -> Self {
425        let b = i16::from_le(v);
426        Self(b)
427    }
428}
429
430impl<'a> flatbuffers::Verifiable for Precision {
431    #[inline]
432    fn run_verifier(
433        v: &mut flatbuffers::Verifier,
434        pos: usize,
435    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
436        use flatbuffers::Verifiable;
437        i16::run_verifier(v, pos)
438    }
439}
440
441impl flatbuffers::SimpleToVerifyInSlice for Precision {}
442#[deprecated(
443    since = "2.0.0",
444    note = "Use associated constants instead. This will no longer be generated in 2021."
445)]
446pub const ENUM_MIN_DATE_UNIT: i16 = 0;
447#[deprecated(
448    since = "2.0.0",
449    note = "Use associated constants instead. This will no longer be generated in 2021."
450)]
451pub const ENUM_MAX_DATE_UNIT: i16 = 1;
452#[deprecated(
453    since = "2.0.0",
454    note = "Use associated constants instead. This will no longer be generated in 2021."
455)]
456#[allow(non_camel_case_types)]
457pub const ENUM_VALUES_DATE_UNIT: [DateUnit; 2] = [DateUnit::DAY, DateUnit::MILLISECOND];
458
459#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
460#[repr(transparent)]
461pub struct DateUnit(pub i16);
462#[allow(non_upper_case_globals)]
463impl DateUnit {
464    pub const DAY: Self = Self(0);
465    pub const MILLISECOND: Self = Self(1);
466
467    pub const ENUM_MIN: i16 = 0;
468    pub const ENUM_MAX: i16 = 1;
469    pub const ENUM_VALUES: &'static [Self] = &[Self::DAY, Self::MILLISECOND];
470    /// Returns the variant's name or "" if unknown.
471    pub fn variant_name(self) -> Option<&'static str> {
472        match self {
473            Self::DAY => Some("DAY"),
474            Self::MILLISECOND => Some("MILLISECOND"),
475            _ => None,
476        }
477    }
478}
479impl core::fmt::Debug for DateUnit {
480    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
481        if let Some(name) = self.variant_name() {
482            f.write_str(name)
483        } else {
484            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
485        }
486    }
487}
488impl<'a> flatbuffers::Follow<'a> for DateUnit {
489    type Inner = Self;
490    #[inline]
491    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
492        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
493        Self(b)
494    }
495}
496
497impl flatbuffers::Push for DateUnit {
498    type Output = DateUnit;
499    #[inline]
500    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
501        flatbuffers::emplace_scalar::<i16>(dst, self.0);
502    }
503}
504
505impl flatbuffers::EndianScalar for DateUnit {
506    type Scalar = i16;
507    #[inline]
508    fn to_little_endian(self) -> i16 {
509        self.0.to_le()
510    }
511    #[inline]
512    #[allow(clippy::wrong_self_convention)]
513    fn from_little_endian(v: i16) -> Self {
514        let b = i16::from_le(v);
515        Self(b)
516    }
517}
518
519impl<'a> flatbuffers::Verifiable for DateUnit {
520    #[inline]
521    fn run_verifier(
522        v: &mut flatbuffers::Verifier,
523        pos: usize,
524    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
525        use flatbuffers::Verifiable;
526        i16::run_verifier(v, pos)
527    }
528}
529
530impl flatbuffers::SimpleToVerifyInSlice for DateUnit {}
531#[deprecated(
532    since = "2.0.0",
533    note = "Use associated constants instead. This will no longer be generated in 2021."
534)]
535pub const ENUM_MIN_TIME_UNIT: i16 = 0;
536#[deprecated(
537    since = "2.0.0",
538    note = "Use associated constants instead. This will no longer be generated in 2021."
539)]
540pub const ENUM_MAX_TIME_UNIT: i16 = 3;
541#[deprecated(
542    since = "2.0.0",
543    note = "Use associated constants instead. This will no longer be generated in 2021."
544)]
545#[allow(non_camel_case_types)]
546pub const ENUM_VALUES_TIME_UNIT: [TimeUnit; 4] = [
547    TimeUnit::SECOND,
548    TimeUnit::MILLISECOND,
549    TimeUnit::MICROSECOND,
550    TimeUnit::NANOSECOND,
551];
552
553#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
554#[repr(transparent)]
555pub struct TimeUnit(pub i16);
556#[allow(non_upper_case_globals)]
557impl TimeUnit {
558    pub const SECOND: Self = Self(0);
559    pub const MILLISECOND: Self = Self(1);
560    pub const MICROSECOND: Self = Self(2);
561    pub const NANOSECOND: Self = Self(3);
562
563    pub const ENUM_MIN: i16 = 0;
564    pub const ENUM_MAX: i16 = 3;
565    pub const ENUM_VALUES: &'static [Self] = &[
566        Self::SECOND,
567        Self::MILLISECOND,
568        Self::MICROSECOND,
569        Self::NANOSECOND,
570    ];
571    /// Returns the variant's name or "" if unknown.
572    pub fn variant_name(self) -> Option<&'static str> {
573        match self {
574            Self::SECOND => Some("SECOND"),
575            Self::MILLISECOND => Some("MILLISECOND"),
576            Self::MICROSECOND => Some("MICROSECOND"),
577            Self::NANOSECOND => Some("NANOSECOND"),
578            _ => None,
579        }
580    }
581}
582impl core::fmt::Debug for TimeUnit {
583    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
584        if let Some(name) = self.variant_name() {
585            f.write_str(name)
586        } else {
587            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
588        }
589    }
590}
591impl<'a> flatbuffers::Follow<'a> for TimeUnit {
592    type Inner = Self;
593    #[inline]
594    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
595        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
596        Self(b)
597    }
598}
599
600impl flatbuffers::Push for TimeUnit {
601    type Output = TimeUnit;
602    #[inline]
603    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
604        flatbuffers::emplace_scalar::<i16>(dst, self.0);
605    }
606}
607
608impl flatbuffers::EndianScalar for TimeUnit {
609    type Scalar = i16;
610    #[inline]
611    fn to_little_endian(self) -> i16 {
612        self.0.to_le()
613    }
614    #[inline]
615    #[allow(clippy::wrong_self_convention)]
616    fn from_little_endian(v: i16) -> Self {
617        let b = i16::from_le(v);
618        Self(b)
619    }
620}
621
622impl<'a> flatbuffers::Verifiable for TimeUnit {
623    #[inline]
624    fn run_verifier(
625        v: &mut flatbuffers::Verifier,
626        pos: usize,
627    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
628        use flatbuffers::Verifiable;
629        i16::run_verifier(v, pos)
630    }
631}
632
633impl flatbuffers::SimpleToVerifyInSlice for TimeUnit {}
634#[deprecated(
635    since = "2.0.0",
636    note = "Use associated constants instead. This will no longer be generated in 2021."
637)]
638pub const ENUM_MIN_INTERVAL_UNIT: i16 = 0;
639#[deprecated(
640    since = "2.0.0",
641    note = "Use associated constants instead. This will no longer be generated in 2021."
642)]
643pub const ENUM_MAX_INTERVAL_UNIT: i16 = 2;
644#[deprecated(
645    since = "2.0.0",
646    note = "Use associated constants instead. This will no longer be generated in 2021."
647)]
648#[allow(non_camel_case_types)]
649pub const ENUM_VALUES_INTERVAL_UNIT: [IntervalUnit; 3] = [
650    IntervalUnit::YEAR_MONTH,
651    IntervalUnit::DAY_TIME,
652    IntervalUnit::MONTH_DAY_NANO,
653];
654
655#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
656#[repr(transparent)]
657pub struct IntervalUnit(pub i16);
658#[allow(non_upper_case_globals)]
659impl IntervalUnit {
660    pub const YEAR_MONTH: Self = Self(0);
661    pub const DAY_TIME: Self = Self(1);
662    pub const MONTH_DAY_NANO: Self = Self(2);
663
664    pub const ENUM_MIN: i16 = 0;
665    pub const ENUM_MAX: i16 = 2;
666    pub const ENUM_VALUES: &'static [Self] =
667        &[Self::YEAR_MONTH, Self::DAY_TIME, Self::MONTH_DAY_NANO];
668    /// Returns the variant's name or "" if unknown.
669    pub fn variant_name(self) -> Option<&'static str> {
670        match self {
671            Self::YEAR_MONTH => Some("YEAR_MONTH"),
672            Self::DAY_TIME => Some("DAY_TIME"),
673            Self::MONTH_DAY_NANO => Some("MONTH_DAY_NANO"),
674            _ => None,
675        }
676    }
677}
678impl core::fmt::Debug for IntervalUnit {
679    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
680        if let Some(name) = self.variant_name() {
681            f.write_str(name)
682        } else {
683            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
684        }
685    }
686}
687impl<'a> flatbuffers::Follow<'a> for IntervalUnit {
688    type Inner = Self;
689    #[inline]
690    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
691        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
692        Self(b)
693    }
694}
695
696impl flatbuffers::Push for IntervalUnit {
697    type Output = IntervalUnit;
698    #[inline]
699    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
700        flatbuffers::emplace_scalar::<i16>(dst, self.0);
701    }
702}
703
704impl flatbuffers::EndianScalar for IntervalUnit {
705    type Scalar = i16;
706    #[inline]
707    fn to_little_endian(self) -> i16 {
708        self.0.to_le()
709    }
710    #[inline]
711    #[allow(clippy::wrong_self_convention)]
712    fn from_little_endian(v: i16) -> Self {
713        let b = i16::from_le(v);
714        Self(b)
715    }
716}
717
718impl<'a> flatbuffers::Verifiable for IntervalUnit {
719    #[inline]
720    fn run_verifier(
721        v: &mut flatbuffers::Verifier,
722        pos: usize,
723    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
724        use flatbuffers::Verifiable;
725        i16::run_verifier(v, pos)
726    }
727}
728
729impl flatbuffers::SimpleToVerifyInSlice for IntervalUnit {}
730#[deprecated(
731    since = "2.0.0",
732    note = "Use associated constants instead. This will no longer be generated in 2021."
733)]
734pub const ENUM_MIN_TYPE: u8 = 0;
735#[deprecated(
736    since = "2.0.0",
737    note = "Use associated constants instead. This will no longer be generated in 2021."
738)]
739pub const ENUM_MAX_TYPE: u8 = 26;
740#[deprecated(
741    since = "2.0.0",
742    note = "Use associated constants instead. This will no longer be generated in 2021."
743)]
744#[allow(non_camel_case_types)]
745pub const ENUM_VALUES_TYPE: [Type; 27] = [
746    Type::NONE,
747    Type::Null,
748    Type::Int,
749    Type::FloatingPoint,
750    Type::Binary,
751    Type::Utf8,
752    Type::Bool,
753    Type::Decimal,
754    Type::Date,
755    Type::Time,
756    Type::Timestamp,
757    Type::Interval,
758    Type::List,
759    Type::Struct_,
760    Type::Union,
761    Type::FixedSizeBinary,
762    Type::FixedSizeList,
763    Type::Map,
764    Type::Duration,
765    Type::LargeBinary,
766    Type::LargeUtf8,
767    Type::LargeList,
768    Type::RunEndEncoded,
769    Type::BinaryView,
770    Type::Utf8View,
771    Type::ListView,
772    Type::LargeListView,
773];
774
775/// ----------------------------------------------------------------------
776/// Top-level Type value, enabling extensible type-specific metadata. We can
777/// add new logical types to Type without breaking backwards compatibility
778#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
779#[repr(transparent)]
780pub struct Type(pub u8);
781#[allow(non_upper_case_globals)]
782impl Type {
783    pub const NONE: Self = Self(0);
784    pub const Null: Self = Self(1);
785    pub const Int: Self = Self(2);
786    pub const FloatingPoint: Self = Self(3);
787    pub const Binary: Self = Self(4);
788    pub const Utf8: Self = Self(5);
789    pub const Bool: Self = Self(6);
790    pub const Decimal: Self = Self(7);
791    pub const Date: Self = Self(8);
792    pub const Time: Self = Self(9);
793    pub const Timestamp: Self = Self(10);
794    pub const Interval: Self = Self(11);
795    pub const List: Self = Self(12);
796    pub const Struct_: Self = Self(13);
797    pub const Union: Self = Self(14);
798    pub const FixedSizeBinary: Self = Self(15);
799    pub const FixedSizeList: Self = Self(16);
800    pub const Map: Self = Self(17);
801    pub const Duration: Self = Self(18);
802    pub const LargeBinary: Self = Self(19);
803    pub const LargeUtf8: Self = Self(20);
804    pub const LargeList: Self = Self(21);
805    pub const RunEndEncoded: Self = Self(22);
806    pub const BinaryView: Self = Self(23);
807    pub const Utf8View: Self = Self(24);
808    pub const ListView: Self = Self(25);
809    pub const LargeListView: Self = Self(26);
810
811    pub const ENUM_MIN: u8 = 0;
812    pub const ENUM_MAX: u8 = 26;
813    pub const ENUM_VALUES: &'static [Self] = &[
814        Self::NONE,
815        Self::Null,
816        Self::Int,
817        Self::FloatingPoint,
818        Self::Binary,
819        Self::Utf8,
820        Self::Bool,
821        Self::Decimal,
822        Self::Date,
823        Self::Time,
824        Self::Timestamp,
825        Self::Interval,
826        Self::List,
827        Self::Struct_,
828        Self::Union,
829        Self::FixedSizeBinary,
830        Self::FixedSizeList,
831        Self::Map,
832        Self::Duration,
833        Self::LargeBinary,
834        Self::LargeUtf8,
835        Self::LargeList,
836        Self::RunEndEncoded,
837        Self::BinaryView,
838        Self::Utf8View,
839        Self::ListView,
840        Self::LargeListView,
841    ];
842    /// Returns the variant's name or "" if unknown.
843    pub fn variant_name(self) -> Option<&'static str> {
844        match self {
845            Self::NONE => Some("NONE"),
846            Self::Null => Some("Null"),
847            Self::Int => Some("Int"),
848            Self::FloatingPoint => Some("FloatingPoint"),
849            Self::Binary => Some("Binary"),
850            Self::Utf8 => Some("Utf8"),
851            Self::Bool => Some("Bool"),
852            Self::Decimal => Some("Decimal"),
853            Self::Date => Some("Date"),
854            Self::Time => Some("Time"),
855            Self::Timestamp => Some("Timestamp"),
856            Self::Interval => Some("Interval"),
857            Self::List => Some("List"),
858            Self::Struct_ => Some("Struct_"),
859            Self::Union => Some("Union"),
860            Self::FixedSizeBinary => Some("FixedSizeBinary"),
861            Self::FixedSizeList => Some("FixedSizeList"),
862            Self::Map => Some("Map"),
863            Self::Duration => Some("Duration"),
864            Self::LargeBinary => Some("LargeBinary"),
865            Self::LargeUtf8 => Some("LargeUtf8"),
866            Self::LargeList => Some("LargeList"),
867            Self::RunEndEncoded => Some("RunEndEncoded"),
868            Self::BinaryView => Some("BinaryView"),
869            Self::Utf8View => Some("Utf8View"),
870            Self::ListView => Some("ListView"),
871            Self::LargeListView => Some("LargeListView"),
872            _ => None,
873        }
874    }
875}
876impl core::fmt::Debug for Type {
877    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
878        if let Some(name) = self.variant_name() {
879            f.write_str(name)
880        } else {
881            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
882        }
883    }
884}
885impl<'a> flatbuffers::Follow<'a> for Type {
886    type Inner = Self;
887    #[inline]
888    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
889        let b = flatbuffers::read_scalar_at::<u8>(buf, loc);
890        Self(b)
891    }
892}
893
894impl flatbuffers::Push for Type {
895    type Output = Type;
896    #[inline]
897    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
898        flatbuffers::emplace_scalar::<u8>(dst, self.0);
899    }
900}
901
902impl flatbuffers::EndianScalar for Type {
903    type Scalar = u8;
904    #[inline]
905    fn to_little_endian(self) -> u8 {
906        self.0.to_le()
907    }
908    #[inline]
909    #[allow(clippy::wrong_self_convention)]
910    fn from_little_endian(v: u8) -> Self {
911        let b = u8::from_le(v);
912        Self(b)
913    }
914}
915
916impl<'a> flatbuffers::Verifiable for Type {
917    #[inline]
918    fn run_verifier(
919        v: &mut flatbuffers::Verifier,
920        pos: usize,
921    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
922        use flatbuffers::Verifiable;
923        u8::run_verifier(v, pos)
924    }
925}
926
927impl flatbuffers::SimpleToVerifyInSlice for Type {}
928pub struct TypeUnionTableOffset {}
929
930#[deprecated(
931    since = "2.0.0",
932    note = "Use associated constants instead. This will no longer be generated in 2021."
933)]
934pub const ENUM_MIN_DICTIONARY_KIND: i16 = 0;
935#[deprecated(
936    since = "2.0.0",
937    note = "Use associated constants instead. This will no longer be generated in 2021."
938)]
939pub const ENUM_MAX_DICTIONARY_KIND: i16 = 0;
940#[deprecated(
941    since = "2.0.0",
942    note = "Use associated constants instead. This will no longer be generated in 2021."
943)]
944#[allow(non_camel_case_types)]
945pub const ENUM_VALUES_DICTIONARY_KIND: [DictionaryKind; 1] = [DictionaryKind::DenseArray];
946
947/// ----------------------------------------------------------------------
948/// Dictionary encoding metadata
949/// Maintained for forwards compatibility, in the future
950/// Dictionaries might be explicit maps between integers and values
951/// allowing for non-contiguous index values
952#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
953#[repr(transparent)]
954pub struct DictionaryKind(pub i16);
955#[allow(non_upper_case_globals)]
956impl DictionaryKind {
957    pub const DenseArray: Self = Self(0);
958
959    pub const ENUM_MIN: i16 = 0;
960    pub const ENUM_MAX: i16 = 0;
961    pub const ENUM_VALUES: &'static [Self] = &[Self::DenseArray];
962    /// Returns the variant's name or "" if unknown.
963    pub fn variant_name(self) -> Option<&'static str> {
964        match self {
965            Self::DenseArray => Some("DenseArray"),
966            _ => None,
967        }
968    }
969}
970impl core::fmt::Debug for DictionaryKind {
971    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
972        if let Some(name) = self.variant_name() {
973            f.write_str(name)
974        } else {
975            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
976        }
977    }
978}
979impl<'a> flatbuffers::Follow<'a> for DictionaryKind {
980    type Inner = Self;
981    #[inline]
982    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
983        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
984        Self(b)
985    }
986}
987
988impl flatbuffers::Push for DictionaryKind {
989    type Output = DictionaryKind;
990    #[inline]
991    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
992        flatbuffers::emplace_scalar::<i16>(dst, self.0);
993    }
994}
995
996impl flatbuffers::EndianScalar for DictionaryKind {
997    type Scalar = i16;
998    #[inline]
999    fn to_little_endian(self) -> i16 {
1000        self.0.to_le()
1001    }
1002    #[inline]
1003    #[allow(clippy::wrong_self_convention)]
1004    fn from_little_endian(v: i16) -> Self {
1005        let b = i16::from_le(v);
1006        Self(b)
1007    }
1008}
1009
1010impl<'a> flatbuffers::Verifiable for DictionaryKind {
1011    #[inline]
1012    fn run_verifier(
1013        v: &mut flatbuffers::Verifier,
1014        pos: usize,
1015    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1016        use flatbuffers::Verifiable;
1017        i16::run_verifier(v, pos)
1018    }
1019}
1020
1021impl flatbuffers::SimpleToVerifyInSlice for DictionaryKind {}
1022#[deprecated(
1023    since = "2.0.0",
1024    note = "Use associated constants instead. This will no longer be generated in 2021."
1025)]
1026pub const ENUM_MIN_ENDIANNESS: i16 = 0;
1027#[deprecated(
1028    since = "2.0.0",
1029    note = "Use associated constants instead. This will no longer be generated in 2021."
1030)]
1031pub const ENUM_MAX_ENDIANNESS: i16 = 1;
1032#[deprecated(
1033    since = "2.0.0",
1034    note = "Use associated constants instead. This will no longer be generated in 2021."
1035)]
1036#[allow(non_camel_case_types)]
1037pub const ENUM_VALUES_ENDIANNESS: [Endianness; 2] = [Endianness::Little, Endianness::Big];
1038
1039/// ----------------------------------------------------------------------
1040/// Endianness of the platform producing the data
1041#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
1042#[repr(transparent)]
1043pub struct Endianness(pub i16);
1044#[allow(non_upper_case_globals)]
1045impl Endianness {
1046    pub const Little: Self = Self(0);
1047    pub const Big: Self = Self(1);
1048
1049    pub const ENUM_MIN: i16 = 0;
1050    pub const ENUM_MAX: i16 = 1;
1051    pub const ENUM_VALUES: &'static [Self] = &[Self::Little, Self::Big];
1052    /// Returns the variant's name or "" if unknown.
1053    pub fn variant_name(self) -> Option<&'static str> {
1054        match self {
1055            Self::Little => Some("Little"),
1056            Self::Big => Some("Big"),
1057            _ => None,
1058        }
1059    }
1060
1061    /// Returns true if the endianness of the source system matches the endianness of the target system.
1062    pub fn equals_to_target_endianness(self) -> bool {
1063        match self {
1064            Self::Little => cfg!(target_endian = "little"),
1065            Self::Big => cfg!(target_endian = "big"),
1066            _ => false,
1067        }
1068    }
1069}
1070impl core::fmt::Debug for Endianness {
1071    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1072        if let Some(name) = self.variant_name() {
1073            f.write_str(name)
1074        } else {
1075            f.write_fmt(format_args!("<UNKNOWN {:?}>", self.0))
1076        }
1077    }
1078}
1079impl<'a> flatbuffers::Follow<'a> for Endianness {
1080    type Inner = Self;
1081    #[inline]
1082    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1083        let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
1084        Self(b)
1085    }
1086}
1087
1088impl flatbuffers::Push for Endianness {
1089    type Output = Endianness;
1090    #[inline]
1091    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1092        flatbuffers::emplace_scalar::<i16>(dst, self.0);
1093    }
1094}
1095
1096impl flatbuffers::EndianScalar for Endianness {
1097    type Scalar = i16;
1098    #[inline]
1099    fn to_little_endian(self) -> i16 {
1100        self.0.to_le()
1101    }
1102    #[inline]
1103    #[allow(clippy::wrong_self_convention)]
1104    fn from_little_endian(v: i16) -> Self {
1105        let b = i16::from_le(v);
1106        Self(b)
1107    }
1108}
1109
1110impl<'a> flatbuffers::Verifiable for Endianness {
1111    #[inline]
1112    fn run_verifier(
1113        v: &mut flatbuffers::Verifier,
1114        pos: usize,
1115    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1116        use flatbuffers::Verifiable;
1117        i16::run_verifier(v, pos)
1118    }
1119}
1120
1121impl flatbuffers::SimpleToVerifyInSlice for Endianness {}
1122/// ----------------------------------------------------------------------
1123/// A Buffer represents a single contiguous memory segment
1124// struct Buffer, aligned to 8
1125#[repr(transparent)]
1126#[derive(Clone, Copy, PartialEq)]
1127pub struct Buffer(pub [u8; 16]);
1128impl Default for Buffer {
1129    fn default() -> Self {
1130        Self([0; 16])
1131    }
1132}
1133impl core::fmt::Debug for Buffer {
1134    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
1135        f.debug_struct("Buffer")
1136            .field("offset", &self.offset())
1137            .field("length", &self.length())
1138            .finish()
1139    }
1140}
1141
1142impl flatbuffers::SimpleToVerifyInSlice for Buffer {}
1143impl<'a> flatbuffers::Follow<'a> for Buffer {
1144    type Inner = &'a Buffer;
1145    #[inline]
1146    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1147        <&'a Buffer>::follow(buf, loc)
1148    }
1149}
1150impl<'a> flatbuffers::Follow<'a> for &'a Buffer {
1151    type Inner = &'a Buffer;
1152    #[inline]
1153    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1154        flatbuffers::follow_cast_ref::<Buffer>(buf, loc)
1155    }
1156}
1157impl<'b> flatbuffers::Push for Buffer {
1158    type Output = Buffer;
1159    #[inline]
1160    unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
1161        let src = ::core::slice::from_raw_parts(self as *const Buffer as *const u8, Self::size());
1162        dst.copy_from_slice(src);
1163    }
1164}
1165
1166impl<'a> flatbuffers::Verifiable for Buffer {
1167    #[inline]
1168    fn run_verifier(
1169        v: &mut flatbuffers::Verifier,
1170        pos: usize,
1171    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1172        use flatbuffers::Verifiable;
1173        v.in_buffer::<Self>(pos)
1174    }
1175}
1176
1177impl<'a> Buffer {
1178    #[allow(clippy::too_many_arguments)]
1179    pub fn new(offset: i64, length: i64) -> Self {
1180        let mut s = Self([0; 16]);
1181        s.set_offset(offset);
1182        s.set_length(length);
1183        s
1184    }
1185
1186    /// The relative offset into the shared memory page where the bytes for this
1187    /// buffer starts
1188    pub fn offset(&self) -> i64 {
1189        let mut mem = core::mem::MaybeUninit::<<i64 as EndianScalar>::Scalar>::uninit();
1190        // Safety:
1191        // Created from a valid Table for this object
1192        // Which contains a valid value in this slot
1193        EndianScalar::from_little_endian(unsafe {
1194            core::ptr::copy_nonoverlapping(
1195                self.0[0..].as_ptr(),
1196                mem.as_mut_ptr() as *mut u8,
1197                core::mem::size_of::<<i64 as EndianScalar>::Scalar>(),
1198            );
1199            mem.assume_init()
1200        })
1201    }
1202
1203    pub fn set_offset(&mut self, x: i64) {
1204        let x_le = x.to_little_endian();
1205        // Safety:
1206        // Created from a valid Table for this object
1207        // Which contains a valid value in this slot
1208        unsafe {
1209            core::ptr::copy_nonoverlapping(
1210                &x_le as *const _ as *const u8,
1211                self.0[0..].as_mut_ptr(),
1212                core::mem::size_of::<<i64 as EndianScalar>::Scalar>(),
1213            );
1214        }
1215    }
1216
1217    /// The absolute length (in bytes) of the memory buffer. The memory is found
1218    /// from offset (inclusive) to offset + length (non-inclusive). When building
1219    /// messages using the encapsulated IPC message, padding bytes may be written
1220    /// after a buffer, but such padding bytes do not need to be accounted for in
1221    /// the size here.
1222    pub fn length(&self) -> i64 {
1223        let mut mem = core::mem::MaybeUninit::<<i64 as EndianScalar>::Scalar>::uninit();
1224        // Safety:
1225        // Created from a valid Table for this object
1226        // Which contains a valid value in this slot
1227        EndianScalar::from_little_endian(unsafe {
1228            core::ptr::copy_nonoverlapping(
1229                self.0[8..].as_ptr(),
1230                mem.as_mut_ptr() as *mut u8,
1231                core::mem::size_of::<<i64 as EndianScalar>::Scalar>(),
1232            );
1233            mem.assume_init()
1234        })
1235    }
1236
1237    pub fn set_length(&mut self, x: i64) {
1238        let x_le = x.to_little_endian();
1239        // Safety:
1240        // Created from a valid Table for this object
1241        // Which contains a valid value in this slot
1242        unsafe {
1243            core::ptr::copy_nonoverlapping(
1244                &x_le as *const _ as *const u8,
1245                self.0[8..].as_mut_ptr(),
1246                core::mem::size_of::<<i64 as EndianScalar>::Scalar>(),
1247            );
1248        }
1249    }
1250}
1251
1252pub enum NullOffset {}
1253#[derive(Copy, Clone, PartialEq)]
1254
1255/// These are stored in the flatbuffer in the Type union below
1256pub struct Null<'a> {
1257    pub _tab: flatbuffers::Table<'a>,
1258}
1259
1260impl<'a> flatbuffers::Follow<'a> for Null<'a> {
1261    type Inner = Null<'a>;
1262    #[inline]
1263    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1264        Self {
1265            _tab: flatbuffers::Table::new(buf, loc),
1266        }
1267    }
1268}
1269
1270impl<'a> Null<'a> {
1271    #[inline]
1272    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1273        Null { _tab: table }
1274    }
1275    #[allow(unused_mut)]
1276    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1277        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1278        _args: &'args NullArgs,
1279    ) -> flatbuffers::WIPOffset<Null<'bldr>> {
1280        let mut builder = NullBuilder::new(_fbb);
1281        builder.finish()
1282    }
1283}
1284
1285impl flatbuffers::Verifiable for Null<'_> {
1286    #[inline]
1287    fn run_verifier(
1288        v: &mut flatbuffers::Verifier,
1289        pos: usize,
1290    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1291        use flatbuffers::Verifiable;
1292        v.visit_table(pos)?.finish();
1293        Ok(())
1294    }
1295}
1296pub struct NullArgs {}
1297impl<'a> Default for NullArgs {
1298    #[inline]
1299    fn default() -> Self {
1300        NullArgs {}
1301    }
1302}
1303
1304pub struct NullBuilder<'a: 'b, 'b> {
1305    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1306    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1307}
1308impl<'a: 'b, 'b> NullBuilder<'a, 'b> {
1309    #[inline]
1310    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> NullBuilder<'a, 'b> {
1311        let start = _fbb.start_table();
1312        NullBuilder {
1313            fbb_: _fbb,
1314            start_: start,
1315        }
1316    }
1317    #[inline]
1318    pub fn finish(self) -> flatbuffers::WIPOffset<Null<'a>> {
1319        let o = self.fbb_.end_table(self.start_);
1320        flatbuffers::WIPOffset::new(o.value())
1321    }
1322}
1323
1324impl core::fmt::Debug for Null<'_> {
1325    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1326        let mut ds = f.debug_struct("Null");
1327        ds.finish()
1328    }
1329}
1330pub enum Struct_Offset {}
1331#[derive(Copy, Clone, PartialEq)]
1332
1333/// A Struct_ in the flatbuffer metadata is the same as an Arrow Struct
1334/// (according to the physical memory layout). We used Struct_ here as
1335/// Struct is a reserved word in Flatbuffers
1336pub struct Struct_<'a> {
1337    pub _tab: flatbuffers::Table<'a>,
1338}
1339
1340impl<'a> flatbuffers::Follow<'a> for Struct_<'a> {
1341    type Inner = Struct_<'a>;
1342    #[inline]
1343    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1344        Self {
1345            _tab: flatbuffers::Table::new(buf, loc),
1346        }
1347    }
1348}
1349
1350impl<'a> Struct_<'a> {
1351    #[inline]
1352    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1353        Struct_ { _tab: table }
1354    }
1355    #[allow(unused_mut)]
1356    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1357        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1358        _args: &'args Struct_Args,
1359    ) -> flatbuffers::WIPOffset<Struct_<'bldr>> {
1360        let mut builder = Struct_Builder::new(_fbb);
1361        builder.finish()
1362    }
1363}
1364
1365impl flatbuffers::Verifiable for Struct_<'_> {
1366    #[inline]
1367    fn run_verifier(
1368        v: &mut flatbuffers::Verifier,
1369        pos: usize,
1370    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1371        use flatbuffers::Verifiable;
1372        v.visit_table(pos)?.finish();
1373        Ok(())
1374    }
1375}
1376pub struct Struct_Args {}
1377impl<'a> Default for Struct_Args {
1378    #[inline]
1379    fn default() -> Self {
1380        Struct_Args {}
1381    }
1382}
1383
1384pub struct Struct_Builder<'a: 'b, 'b> {
1385    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1386    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1387}
1388impl<'a: 'b, 'b> Struct_Builder<'a, 'b> {
1389    #[inline]
1390    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> Struct_Builder<'a, 'b> {
1391        let start = _fbb.start_table();
1392        Struct_Builder {
1393            fbb_: _fbb,
1394            start_: start,
1395        }
1396    }
1397    #[inline]
1398    pub fn finish(self) -> flatbuffers::WIPOffset<Struct_<'a>> {
1399        let o = self.fbb_.end_table(self.start_);
1400        flatbuffers::WIPOffset::new(o.value())
1401    }
1402}
1403
1404impl core::fmt::Debug for Struct_<'_> {
1405    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1406        let mut ds = f.debug_struct("Struct_");
1407        ds.finish()
1408    }
1409}
1410pub enum ListOffset {}
1411#[derive(Copy, Clone, PartialEq)]
1412
1413pub struct List<'a> {
1414    pub _tab: flatbuffers::Table<'a>,
1415}
1416
1417impl<'a> flatbuffers::Follow<'a> for List<'a> {
1418    type Inner = List<'a>;
1419    #[inline]
1420    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1421        Self {
1422            _tab: flatbuffers::Table::new(buf, loc),
1423        }
1424    }
1425}
1426
1427impl<'a> List<'a> {
1428    #[inline]
1429    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1430        List { _tab: table }
1431    }
1432    #[allow(unused_mut)]
1433    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1434        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1435        _args: &'args ListArgs,
1436    ) -> flatbuffers::WIPOffset<List<'bldr>> {
1437        let mut builder = ListBuilder::new(_fbb);
1438        builder.finish()
1439    }
1440}
1441
1442impl flatbuffers::Verifiable for List<'_> {
1443    #[inline]
1444    fn run_verifier(
1445        v: &mut flatbuffers::Verifier,
1446        pos: usize,
1447    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1448        use flatbuffers::Verifiable;
1449        v.visit_table(pos)?.finish();
1450        Ok(())
1451    }
1452}
1453pub struct ListArgs {}
1454impl<'a> Default for ListArgs {
1455    #[inline]
1456    fn default() -> Self {
1457        ListArgs {}
1458    }
1459}
1460
1461pub struct ListBuilder<'a: 'b, 'b> {
1462    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1463    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1464}
1465impl<'a: 'b, 'b> ListBuilder<'a, 'b> {
1466    #[inline]
1467    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ListBuilder<'a, 'b> {
1468        let start = _fbb.start_table();
1469        ListBuilder {
1470            fbb_: _fbb,
1471            start_: start,
1472        }
1473    }
1474    #[inline]
1475    pub fn finish(self) -> flatbuffers::WIPOffset<List<'a>> {
1476        let o = self.fbb_.end_table(self.start_);
1477        flatbuffers::WIPOffset::new(o.value())
1478    }
1479}
1480
1481impl core::fmt::Debug for List<'_> {
1482    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1483        let mut ds = f.debug_struct("List");
1484        ds.finish()
1485    }
1486}
1487pub enum LargeListOffset {}
1488#[derive(Copy, Clone, PartialEq)]
1489
1490/// Same as List, but with 64-bit offsets, allowing to represent
1491/// extremely large data values.
1492pub struct LargeList<'a> {
1493    pub _tab: flatbuffers::Table<'a>,
1494}
1495
1496impl<'a> flatbuffers::Follow<'a> for LargeList<'a> {
1497    type Inner = LargeList<'a>;
1498    #[inline]
1499    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1500        Self {
1501            _tab: flatbuffers::Table::new(buf, loc),
1502        }
1503    }
1504}
1505
1506impl<'a> LargeList<'a> {
1507    #[inline]
1508    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1509        LargeList { _tab: table }
1510    }
1511    #[allow(unused_mut)]
1512    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1513        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1514        _args: &'args LargeListArgs,
1515    ) -> flatbuffers::WIPOffset<LargeList<'bldr>> {
1516        let mut builder = LargeListBuilder::new(_fbb);
1517        builder.finish()
1518    }
1519}
1520
1521impl flatbuffers::Verifiable for LargeList<'_> {
1522    #[inline]
1523    fn run_verifier(
1524        v: &mut flatbuffers::Verifier,
1525        pos: usize,
1526    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1527        use flatbuffers::Verifiable;
1528        v.visit_table(pos)?.finish();
1529        Ok(())
1530    }
1531}
1532pub struct LargeListArgs {}
1533impl<'a> Default for LargeListArgs {
1534    #[inline]
1535    fn default() -> Self {
1536        LargeListArgs {}
1537    }
1538}
1539
1540pub struct LargeListBuilder<'a: 'b, 'b> {
1541    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1542    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1543}
1544impl<'a: 'b, 'b> LargeListBuilder<'a, 'b> {
1545    #[inline]
1546    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LargeListBuilder<'a, 'b> {
1547        let start = _fbb.start_table();
1548        LargeListBuilder {
1549            fbb_: _fbb,
1550            start_: start,
1551        }
1552    }
1553    #[inline]
1554    pub fn finish(self) -> flatbuffers::WIPOffset<LargeList<'a>> {
1555        let o = self.fbb_.end_table(self.start_);
1556        flatbuffers::WIPOffset::new(o.value())
1557    }
1558}
1559
1560impl core::fmt::Debug for LargeList<'_> {
1561    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1562        let mut ds = f.debug_struct("LargeList");
1563        ds.finish()
1564    }
1565}
1566pub enum ListViewOffset {}
1567#[derive(Copy, Clone, PartialEq)]
1568
1569/// Represents the same logical types that List can, but contains offsets and
1570/// sizes allowing for writes in any order and sharing of child values among
1571/// list values.
1572pub struct ListView<'a> {
1573    pub _tab: flatbuffers::Table<'a>,
1574}
1575
1576impl<'a> flatbuffers::Follow<'a> for ListView<'a> {
1577    type Inner = ListView<'a>;
1578    #[inline]
1579    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1580        Self {
1581            _tab: flatbuffers::Table::new(buf, loc),
1582        }
1583    }
1584}
1585
1586impl<'a> ListView<'a> {
1587    #[inline]
1588    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1589        ListView { _tab: table }
1590    }
1591    #[allow(unused_mut)]
1592    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1593        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1594        _args: &'args ListViewArgs,
1595    ) -> flatbuffers::WIPOffset<ListView<'bldr>> {
1596        let mut builder = ListViewBuilder::new(_fbb);
1597        builder.finish()
1598    }
1599}
1600
1601impl flatbuffers::Verifiable for ListView<'_> {
1602    #[inline]
1603    fn run_verifier(
1604        v: &mut flatbuffers::Verifier,
1605        pos: usize,
1606    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1607        use flatbuffers::Verifiable;
1608        v.visit_table(pos)?.finish();
1609        Ok(())
1610    }
1611}
1612pub struct ListViewArgs {}
1613impl<'a> Default for ListViewArgs {
1614    #[inline]
1615    fn default() -> Self {
1616        ListViewArgs {}
1617    }
1618}
1619
1620pub struct ListViewBuilder<'a: 'b, 'b> {
1621    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1622    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1623}
1624impl<'a: 'b, 'b> ListViewBuilder<'a, 'b> {
1625    #[inline]
1626    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ListViewBuilder<'a, 'b> {
1627        let start = _fbb.start_table();
1628        ListViewBuilder {
1629            fbb_: _fbb,
1630            start_: start,
1631        }
1632    }
1633    #[inline]
1634    pub fn finish(self) -> flatbuffers::WIPOffset<ListView<'a>> {
1635        let o = self.fbb_.end_table(self.start_);
1636        flatbuffers::WIPOffset::new(o.value())
1637    }
1638}
1639
1640impl core::fmt::Debug for ListView<'_> {
1641    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1642        let mut ds = f.debug_struct("ListView");
1643        ds.finish()
1644    }
1645}
1646pub enum LargeListViewOffset {}
1647#[derive(Copy, Clone, PartialEq)]
1648
1649/// Same as ListView, but with 64-bit offsets and sizes, allowing to represent
1650/// extremely large data values.
1651pub struct LargeListView<'a> {
1652    pub _tab: flatbuffers::Table<'a>,
1653}
1654
1655impl<'a> flatbuffers::Follow<'a> for LargeListView<'a> {
1656    type Inner = LargeListView<'a>;
1657    #[inline]
1658    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1659        Self {
1660            _tab: flatbuffers::Table::new(buf, loc),
1661        }
1662    }
1663}
1664
1665impl<'a> LargeListView<'a> {
1666    #[inline]
1667    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1668        LargeListView { _tab: table }
1669    }
1670    #[allow(unused_mut)]
1671    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1672        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1673        _args: &'args LargeListViewArgs,
1674    ) -> flatbuffers::WIPOffset<LargeListView<'bldr>> {
1675        let mut builder = LargeListViewBuilder::new(_fbb);
1676        builder.finish()
1677    }
1678}
1679
1680impl flatbuffers::Verifiable for LargeListView<'_> {
1681    #[inline]
1682    fn run_verifier(
1683        v: &mut flatbuffers::Verifier,
1684        pos: usize,
1685    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1686        use flatbuffers::Verifiable;
1687        v.visit_table(pos)?.finish();
1688        Ok(())
1689    }
1690}
1691pub struct LargeListViewArgs {}
1692impl<'a> Default for LargeListViewArgs {
1693    #[inline]
1694    fn default() -> Self {
1695        LargeListViewArgs {}
1696    }
1697}
1698
1699pub struct LargeListViewBuilder<'a: 'b, 'b> {
1700    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1701    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1702}
1703impl<'a: 'b, 'b> LargeListViewBuilder<'a, 'b> {
1704    #[inline]
1705    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LargeListViewBuilder<'a, 'b> {
1706        let start = _fbb.start_table();
1707        LargeListViewBuilder {
1708            fbb_: _fbb,
1709            start_: start,
1710        }
1711    }
1712    #[inline]
1713    pub fn finish(self) -> flatbuffers::WIPOffset<LargeListView<'a>> {
1714        let o = self.fbb_.end_table(self.start_);
1715        flatbuffers::WIPOffset::new(o.value())
1716    }
1717}
1718
1719impl core::fmt::Debug for LargeListView<'_> {
1720    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1721        let mut ds = f.debug_struct("LargeListView");
1722        ds.finish()
1723    }
1724}
1725pub enum FixedSizeListOffset {}
1726#[derive(Copy, Clone, PartialEq)]
1727
1728pub struct FixedSizeList<'a> {
1729    pub _tab: flatbuffers::Table<'a>,
1730}
1731
1732impl<'a> flatbuffers::Follow<'a> for FixedSizeList<'a> {
1733    type Inner = FixedSizeList<'a>;
1734    #[inline]
1735    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1736        Self {
1737            _tab: flatbuffers::Table::new(buf, loc),
1738        }
1739    }
1740}
1741
1742impl<'a> FixedSizeList<'a> {
1743    pub const VT_LISTSIZE: flatbuffers::VOffsetT = 4;
1744
1745    #[inline]
1746    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1747        FixedSizeList { _tab: table }
1748    }
1749    #[allow(unused_mut)]
1750    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1751        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1752        args: &'args FixedSizeListArgs,
1753    ) -> flatbuffers::WIPOffset<FixedSizeList<'bldr>> {
1754        let mut builder = FixedSizeListBuilder::new(_fbb);
1755        builder.add_listSize(args.listSize);
1756        builder.finish()
1757    }
1758
1759    /// Number of list items per value
1760    #[inline]
1761    pub fn listSize(&self) -> i32 {
1762        // Safety:
1763        // Created from valid Table for this object
1764        // which contains a valid value in this slot
1765        unsafe {
1766            self._tab
1767                .get::<i32>(FixedSizeList::VT_LISTSIZE, Some(0))
1768                .unwrap()
1769        }
1770    }
1771}
1772
1773impl flatbuffers::Verifiable for FixedSizeList<'_> {
1774    #[inline]
1775    fn run_verifier(
1776        v: &mut flatbuffers::Verifier,
1777        pos: usize,
1778    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1779        use flatbuffers::Verifiable;
1780        v.visit_table(pos)?
1781            .visit_field::<i32>("listSize", Self::VT_LISTSIZE, false)?
1782            .finish();
1783        Ok(())
1784    }
1785}
1786pub struct FixedSizeListArgs {
1787    pub listSize: i32,
1788}
1789impl<'a> Default for FixedSizeListArgs {
1790    #[inline]
1791    fn default() -> Self {
1792        FixedSizeListArgs { listSize: 0 }
1793    }
1794}
1795
1796pub struct FixedSizeListBuilder<'a: 'b, 'b> {
1797    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1798    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1799}
1800impl<'a: 'b, 'b> FixedSizeListBuilder<'a, 'b> {
1801    #[inline]
1802    pub fn add_listSize(&mut self, listSize: i32) {
1803        self.fbb_
1804            .push_slot::<i32>(FixedSizeList::VT_LISTSIZE, listSize, 0);
1805    }
1806    #[inline]
1807    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> FixedSizeListBuilder<'a, 'b> {
1808        let start = _fbb.start_table();
1809        FixedSizeListBuilder {
1810            fbb_: _fbb,
1811            start_: start,
1812        }
1813    }
1814    #[inline]
1815    pub fn finish(self) -> flatbuffers::WIPOffset<FixedSizeList<'a>> {
1816        let o = self.fbb_.end_table(self.start_);
1817        flatbuffers::WIPOffset::new(o.value())
1818    }
1819}
1820
1821impl core::fmt::Debug for FixedSizeList<'_> {
1822    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1823        let mut ds = f.debug_struct("FixedSizeList");
1824        ds.field("listSize", &self.listSize());
1825        ds.finish()
1826    }
1827}
1828pub enum MapOffset {}
1829#[derive(Copy, Clone, PartialEq)]
1830
1831/// A Map is a logical nested type that is represented as
1832///
1833/// List<entries: Struct<key: K, value: V>>
1834///
1835/// In this layout, the keys and values are each respectively contiguous. We do
1836/// not constrain the key and value types, so the application is responsible
1837/// for ensuring that the keys are hashable and unique. Whether the keys are sorted
1838/// may be set in the metadata for this field.
1839///
1840/// In a field with Map type, the field has a child Struct field, which then
1841/// has two children: key type and the second the value type. The names of the
1842/// child fields may be respectively "entries", "key", and "value", but this is
1843/// not enforced.
1844///
1845/// Map
1846/// ```text
1847///   - child[0] entries: Struct
1848///     - child[0] key: K
1849///     - child[1] value: V
1850/// ```
1851/// Neither the "entries" field nor the "key" field may be nullable.
1852///
1853/// The metadata is structured so that Arrow systems without special handling
1854/// for Map can make Map an alias for List. The "layout" attribute for the Map
1855/// field must have the same contents as a List.
1856pub struct Map<'a> {
1857    pub _tab: flatbuffers::Table<'a>,
1858}
1859
1860impl<'a> flatbuffers::Follow<'a> for Map<'a> {
1861    type Inner = Map<'a>;
1862    #[inline]
1863    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1864        Self {
1865            _tab: flatbuffers::Table::new(buf, loc),
1866        }
1867    }
1868}
1869
1870impl<'a> Map<'a> {
1871    pub const VT_KEYSSORTED: flatbuffers::VOffsetT = 4;
1872
1873    #[inline]
1874    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1875        Map { _tab: table }
1876    }
1877    #[allow(unused_mut)]
1878    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1879        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1880        args: &'args MapArgs,
1881    ) -> flatbuffers::WIPOffset<Map<'bldr>> {
1882        let mut builder = MapBuilder::new(_fbb);
1883        builder.add_keysSorted(args.keysSorted);
1884        builder.finish()
1885    }
1886
1887    /// Set to true if the keys within each value are sorted
1888    #[inline]
1889    pub fn keysSorted(&self) -> bool {
1890        // Safety:
1891        // Created from valid Table for this object
1892        // which contains a valid value in this slot
1893        unsafe {
1894            self._tab
1895                .get::<bool>(Map::VT_KEYSSORTED, Some(false))
1896                .unwrap()
1897        }
1898    }
1899}
1900
1901impl flatbuffers::Verifiable for Map<'_> {
1902    #[inline]
1903    fn run_verifier(
1904        v: &mut flatbuffers::Verifier,
1905        pos: usize,
1906    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
1907        use flatbuffers::Verifiable;
1908        v.visit_table(pos)?
1909            .visit_field::<bool>("keysSorted", Self::VT_KEYSSORTED, false)?
1910            .finish();
1911        Ok(())
1912    }
1913}
1914pub struct MapArgs {
1915    pub keysSorted: bool,
1916}
1917impl<'a> Default for MapArgs {
1918    #[inline]
1919    fn default() -> Self {
1920        MapArgs { keysSorted: false }
1921    }
1922}
1923
1924pub struct MapBuilder<'a: 'b, 'b> {
1925    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
1926    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
1927}
1928impl<'a: 'b, 'b> MapBuilder<'a, 'b> {
1929    #[inline]
1930    pub fn add_keysSorted(&mut self, keysSorted: bool) {
1931        self.fbb_
1932            .push_slot::<bool>(Map::VT_KEYSSORTED, keysSorted, false);
1933    }
1934    #[inline]
1935    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> MapBuilder<'a, 'b> {
1936        let start = _fbb.start_table();
1937        MapBuilder {
1938            fbb_: _fbb,
1939            start_: start,
1940        }
1941    }
1942    #[inline]
1943    pub fn finish(self) -> flatbuffers::WIPOffset<Map<'a>> {
1944        let o = self.fbb_.end_table(self.start_);
1945        flatbuffers::WIPOffset::new(o.value())
1946    }
1947}
1948
1949impl core::fmt::Debug for Map<'_> {
1950    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1951        let mut ds = f.debug_struct("Map");
1952        ds.field("keysSorted", &self.keysSorted());
1953        ds.finish()
1954    }
1955}
1956pub enum UnionOffset {}
1957#[derive(Copy, Clone, PartialEq)]
1958
1959/// A union is a complex type with children in Field
1960/// By default ids in the type vector refer to the offsets in the children
1961/// optionally typeIds provides an indirection between the child offset and the type id
1962/// for each child `typeIds[offset]` is the id used in the type vector
1963pub struct Union<'a> {
1964    pub _tab: flatbuffers::Table<'a>,
1965}
1966
1967impl<'a> flatbuffers::Follow<'a> for Union<'a> {
1968    type Inner = Union<'a>;
1969    #[inline]
1970    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
1971        Self {
1972            _tab: flatbuffers::Table::new(buf, loc),
1973        }
1974    }
1975}
1976
1977impl<'a> Union<'a> {
1978    pub const VT_MODE: flatbuffers::VOffsetT = 4;
1979    pub const VT_TYPEIDS: flatbuffers::VOffsetT = 6;
1980
1981    #[inline]
1982    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
1983        Union { _tab: table }
1984    }
1985    #[allow(unused_mut)]
1986    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
1987        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
1988        args: &'args UnionArgs<'args>,
1989    ) -> flatbuffers::WIPOffset<Union<'bldr>> {
1990        let mut builder = UnionBuilder::new(_fbb);
1991        if let Some(x) = args.typeIds {
1992            builder.add_typeIds(x);
1993        }
1994        builder.add_mode(args.mode);
1995        builder.finish()
1996    }
1997
1998    #[inline]
1999    pub fn mode(&self) -> UnionMode {
2000        // Safety:
2001        // Created from valid Table for this object
2002        // which contains a valid value in this slot
2003        unsafe {
2004            self._tab
2005                .get::<UnionMode>(Union::VT_MODE, Some(UnionMode::Sparse))
2006                .unwrap()
2007        }
2008    }
2009    #[inline]
2010    pub fn typeIds(&self) -> Option<flatbuffers::Vector<'a, i32>> {
2011        // Safety:
2012        // Created from valid Table for this object
2013        // which contains a valid value in this slot
2014        unsafe {
2015            self._tab
2016                .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, i32>>>(
2017                    Union::VT_TYPEIDS,
2018                    None,
2019                )
2020        }
2021    }
2022}
2023
2024impl flatbuffers::Verifiable for Union<'_> {
2025    #[inline]
2026    fn run_verifier(
2027        v: &mut flatbuffers::Verifier,
2028        pos: usize,
2029    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2030        use flatbuffers::Verifiable;
2031        v.visit_table(pos)?
2032            .visit_field::<UnionMode>("mode", Self::VT_MODE, false)?
2033            .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, i32>>>(
2034                "typeIds",
2035                Self::VT_TYPEIDS,
2036                false,
2037            )?
2038            .finish();
2039        Ok(())
2040    }
2041}
2042pub struct UnionArgs<'a> {
2043    pub mode: UnionMode,
2044    pub typeIds: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, i32>>>,
2045}
2046impl<'a> Default for UnionArgs<'a> {
2047    #[inline]
2048    fn default() -> Self {
2049        UnionArgs {
2050            mode: UnionMode::Sparse,
2051            typeIds: None,
2052        }
2053    }
2054}
2055
2056pub struct UnionBuilder<'a: 'b, 'b> {
2057    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2058    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2059}
2060impl<'a: 'b, 'b> UnionBuilder<'a, 'b> {
2061    #[inline]
2062    pub fn add_mode(&mut self, mode: UnionMode) {
2063        self.fbb_
2064            .push_slot::<UnionMode>(Union::VT_MODE, mode, UnionMode::Sparse);
2065    }
2066    #[inline]
2067    pub fn add_typeIds(&mut self, typeIds: flatbuffers::WIPOffset<flatbuffers::Vector<'b, i32>>) {
2068        self.fbb_
2069            .push_slot_always::<flatbuffers::WIPOffset<_>>(Union::VT_TYPEIDS, typeIds);
2070    }
2071    #[inline]
2072    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> UnionBuilder<'a, 'b> {
2073        let start = _fbb.start_table();
2074        UnionBuilder {
2075            fbb_: _fbb,
2076            start_: start,
2077        }
2078    }
2079    #[inline]
2080    pub fn finish(self) -> flatbuffers::WIPOffset<Union<'a>> {
2081        let o = self.fbb_.end_table(self.start_);
2082        flatbuffers::WIPOffset::new(o.value())
2083    }
2084}
2085
2086impl core::fmt::Debug for Union<'_> {
2087    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2088        let mut ds = f.debug_struct("Union");
2089        ds.field("mode", &self.mode());
2090        ds.field("typeIds", &self.typeIds());
2091        ds.finish()
2092    }
2093}
2094pub enum IntOffset {}
2095#[derive(Copy, Clone, PartialEq)]
2096
2097pub struct Int<'a> {
2098    pub _tab: flatbuffers::Table<'a>,
2099}
2100
2101impl<'a> flatbuffers::Follow<'a> for Int<'a> {
2102    type Inner = Int<'a>;
2103    #[inline]
2104    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2105        Self {
2106            _tab: flatbuffers::Table::new(buf, loc),
2107        }
2108    }
2109}
2110
2111impl<'a> Int<'a> {
2112    pub const VT_BITWIDTH: flatbuffers::VOffsetT = 4;
2113    pub const VT_IS_SIGNED: flatbuffers::VOffsetT = 6;
2114
2115    #[inline]
2116    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2117        Int { _tab: table }
2118    }
2119    #[allow(unused_mut)]
2120    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2121        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2122        args: &'args IntArgs,
2123    ) -> flatbuffers::WIPOffset<Int<'bldr>> {
2124        let mut builder = IntBuilder::new(_fbb);
2125        builder.add_bitWidth(args.bitWidth);
2126        builder.add_is_signed(args.is_signed);
2127        builder.finish()
2128    }
2129
2130    #[inline]
2131    pub fn bitWidth(&self) -> i32 {
2132        // Safety:
2133        // Created from valid Table for this object
2134        // which contains a valid value in this slot
2135        unsafe { self._tab.get::<i32>(Int::VT_BITWIDTH, Some(0)).unwrap() }
2136    }
2137    #[inline]
2138    pub fn is_signed(&self) -> bool {
2139        // Safety:
2140        // Created from valid Table for this object
2141        // which contains a valid value in this slot
2142        unsafe {
2143            self._tab
2144                .get::<bool>(Int::VT_IS_SIGNED, Some(false))
2145                .unwrap()
2146        }
2147    }
2148}
2149
2150impl flatbuffers::Verifiable for Int<'_> {
2151    #[inline]
2152    fn run_verifier(
2153        v: &mut flatbuffers::Verifier,
2154        pos: usize,
2155    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2156        use flatbuffers::Verifiable;
2157        v.visit_table(pos)?
2158            .visit_field::<i32>("bitWidth", Self::VT_BITWIDTH, false)?
2159            .visit_field::<bool>("is_signed", Self::VT_IS_SIGNED, false)?
2160            .finish();
2161        Ok(())
2162    }
2163}
2164pub struct IntArgs {
2165    pub bitWidth: i32,
2166    pub is_signed: bool,
2167}
2168impl<'a> Default for IntArgs {
2169    #[inline]
2170    fn default() -> Self {
2171        IntArgs {
2172            bitWidth: 0,
2173            is_signed: false,
2174        }
2175    }
2176}
2177
2178pub struct IntBuilder<'a: 'b, 'b> {
2179    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2180    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2181}
2182impl<'a: 'b, 'b> IntBuilder<'a, 'b> {
2183    #[inline]
2184    pub fn add_bitWidth(&mut self, bitWidth: i32) {
2185        self.fbb_.push_slot::<i32>(Int::VT_BITWIDTH, bitWidth, 0);
2186    }
2187    #[inline]
2188    pub fn add_is_signed(&mut self, is_signed: bool) {
2189        self.fbb_
2190            .push_slot::<bool>(Int::VT_IS_SIGNED, is_signed, false);
2191    }
2192    #[inline]
2193    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> IntBuilder<'a, 'b> {
2194        let start = _fbb.start_table();
2195        IntBuilder {
2196            fbb_: _fbb,
2197            start_: start,
2198        }
2199    }
2200    #[inline]
2201    pub fn finish(self) -> flatbuffers::WIPOffset<Int<'a>> {
2202        let o = self.fbb_.end_table(self.start_);
2203        flatbuffers::WIPOffset::new(o.value())
2204    }
2205}
2206
2207impl core::fmt::Debug for Int<'_> {
2208    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2209        let mut ds = f.debug_struct("Int");
2210        ds.field("bitWidth", &self.bitWidth());
2211        ds.field("is_signed", &self.is_signed());
2212        ds.finish()
2213    }
2214}
2215pub enum FloatingPointOffset {}
2216#[derive(Copy, Clone, PartialEq)]
2217
2218pub struct FloatingPoint<'a> {
2219    pub _tab: flatbuffers::Table<'a>,
2220}
2221
2222impl<'a> flatbuffers::Follow<'a> for FloatingPoint<'a> {
2223    type Inner = FloatingPoint<'a>;
2224    #[inline]
2225    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2226        Self {
2227            _tab: flatbuffers::Table::new(buf, loc),
2228        }
2229    }
2230}
2231
2232impl<'a> FloatingPoint<'a> {
2233    pub const VT_PRECISION: flatbuffers::VOffsetT = 4;
2234
2235    #[inline]
2236    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2237        FloatingPoint { _tab: table }
2238    }
2239    #[allow(unused_mut)]
2240    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2241        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2242        args: &'args FloatingPointArgs,
2243    ) -> flatbuffers::WIPOffset<FloatingPoint<'bldr>> {
2244        let mut builder = FloatingPointBuilder::new(_fbb);
2245        builder.add_precision(args.precision);
2246        builder.finish()
2247    }
2248
2249    #[inline]
2250    pub fn precision(&self) -> Precision {
2251        // Safety:
2252        // Created from valid Table for this object
2253        // which contains a valid value in this slot
2254        unsafe {
2255            self._tab
2256                .get::<Precision>(FloatingPoint::VT_PRECISION, Some(Precision::HALF))
2257                .unwrap()
2258        }
2259    }
2260}
2261
2262impl flatbuffers::Verifiable for FloatingPoint<'_> {
2263    #[inline]
2264    fn run_verifier(
2265        v: &mut flatbuffers::Verifier,
2266        pos: usize,
2267    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2268        use flatbuffers::Verifiable;
2269        v.visit_table(pos)?
2270            .visit_field::<Precision>("precision", Self::VT_PRECISION, false)?
2271            .finish();
2272        Ok(())
2273    }
2274}
2275pub struct FloatingPointArgs {
2276    pub precision: Precision,
2277}
2278impl<'a> Default for FloatingPointArgs {
2279    #[inline]
2280    fn default() -> Self {
2281        FloatingPointArgs {
2282            precision: Precision::HALF,
2283        }
2284    }
2285}
2286
2287pub struct FloatingPointBuilder<'a: 'b, 'b> {
2288    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2289    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2290}
2291impl<'a: 'b, 'b> FloatingPointBuilder<'a, 'b> {
2292    #[inline]
2293    pub fn add_precision(&mut self, precision: Precision) {
2294        self.fbb_
2295            .push_slot::<Precision>(FloatingPoint::VT_PRECISION, precision, Precision::HALF);
2296    }
2297    #[inline]
2298    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> FloatingPointBuilder<'a, 'b> {
2299        let start = _fbb.start_table();
2300        FloatingPointBuilder {
2301            fbb_: _fbb,
2302            start_: start,
2303        }
2304    }
2305    #[inline]
2306    pub fn finish(self) -> flatbuffers::WIPOffset<FloatingPoint<'a>> {
2307        let o = self.fbb_.end_table(self.start_);
2308        flatbuffers::WIPOffset::new(o.value())
2309    }
2310}
2311
2312impl core::fmt::Debug for FloatingPoint<'_> {
2313    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2314        let mut ds = f.debug_struct("FloatingPoint");
2315        ds.field("precision", &self.precision());
2316        ds.finish()
2317    }
2318}
2319pub enum Utf8Offset {}
2320#[derive(Copy, Clone, PartialEq)]
2321
2322/// Unicode with UTF-8 encoding
2323pub struct Utf8<'a> {
2324    pub _tab: flatbuffers::Table<'a>,
2325}
2326
2327impl<'a> flatbuffers::Follow<'a> for Utf8<'a> {
2328    type Inner = Utf8<'a>;
2329    #[inline]
2330    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2331        Self {
2332            _tab: flatbuffers::Table::new(buf, loc),
2333        }
2334    }
2335}
2336
2337impl<'a> Utf8<'a> {
2338    #[inline]
2339    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2340        Utf8 { _tab: table }
2341    }
2342    #[allow(unused_mut)]
2343    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2344        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2345        _args: &'args Utf8Args,
2346    ) -> flatbuffers::WIPOffset<Utf8<'bldr>> {
2347        let mut builder = Utf8Builder::new(_fbb);
2348        builder.finish()
2349    }
2350}
2351
2352impl flatbuffers::Verifiable for Utf8<'_> {
2353    #[inline]
2354    fn run_verifier(
2355        v: &mut flatbuffers::Verifier,
2356        pos: usize,
2357    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2358        use flatbuffers::Verifiable;
2359        v.visit_table(pos)?.finish();
2360        Ok(())
2361    }
2362}
2363pub struct Utf8Args {}
2364impl<'a> Default for Utf8Args {
2365    #[inline]
2366    fn default() -> Self {
2367        Utf8Args {}
2368    }
2369}
2370
2371pub struct Utf8Builder<'a: 'b, 'b> {
2372    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2373    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2374}
2375impl<'a: 'b, 'b> Utf8Builder<'a, 'b> {
2376    #[inline]
2377    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> Utf8Builder<'a, 'b> {
2378        let start = _fbb.start_table();
2379        Utf8Builder {
2380            fbb_: _fbb,
2381            start_: start,
2382        }
2383    }
2384    #[inline]
2385    pub fn finish(self) -> flatbuffers::WIPOffset<Utf8<'a>> {
2386        let o = self.fbb_.end_table(self.start_);
2387        flatbuffers::WIPOffset::new(o.value())
2388    }
2389}
2390
2391impl core::fmt::Debug for Utf8<'_> {
2392    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2393        let mut ds = f.debug_struct("Utf8");
2394        ds.finish()
2395    }
2396}
2397pub enum BinaryOffset {}
2398#[derive(Copy, Clone, PartialEq)]
2399
2400/// Opaque binary data
2401pub struct Binary<'a> {
2402    pub _tab: flatbuffers::Table<'a>,
2403}
2404
2405impl<'a> flatbuffers::Follow<'a> for Binary<'a> {
2406    type Inner = Binary<'a>;
2407    #[inline]
2408    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2409        Self {
2410            _tab: flatbuffers::Table::new(buf, loc),
2411        }
2412    }
2413}
2414
2415impl<'a> Binary<'a> {
2416    #[inline]
2417    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2418        Binary { _tab: table }
2419    }
2420    #[allow(unused_mut)]
2421    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2422        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2423        _args: &'args BinaryArgs,
2424    ) -> flatbuffers::WIPOffset<Binary<'bldr>> {
2425        let mut builder = BinaryBuilder::new(_fbb);
2426        builder.finish()
2427    }
2428}
2429
2430impl flatbuffers::Verifiable for Binary<'_> {
2431    #[inline]
2432    fn run_verifier(
2433        v: &mut flatbuffers::Verifier,
2434        pos: usize,
2435    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2436        use flatbuffers::Verifiable;
2437        v.visit_table(pos)?.finish();
2438        Ok(())
2439    }
2440}
2441pub struct BinaryArgs {}
2442impl<'a> Default for BinaryArgs {
2443    #[inline]
2444    fn default() -> Self {
2445        BinaryArgs {}
2446    }
2447}
2448
2449pub struct BinaryBuilder<'a: 'b, 'b> {
2450    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2451    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2452}
2453impl<'a: 'b, 'b> BinaryBuilder<'a, 'b> {
2454    #[inline]
2455    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> BinaryBuilder<'a, 'b> {
2456        let start = _fbb.start_table();
2457        BinaryBuilder {
2458            fbb_: _fbb,
2459            start_: start,
2460        }
2461    }
2462    #[inline]
2463    pub fn finish(self) -> flatbuffers::WIPOffset<Binary<'a>> {
2464        let o = self.fbb_.end_table(self.start_);
2465        flatbuffers::WIPOffset::new(o.value())
2466    }
2467}
2468
2469impl core::fmt::Debug for Binary<'_> {
2470    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2471        let mut ds = f.debug_struct("Binary");
2472        ds.finish()
2473    }
2474}
2475pub enum LargeUtf8Offset {}
2476#[derive(Copy, Clone, PartialEq)]
2477
2478/// Same as Utf8, but with 64-bit offsets, allowing to represent
2479/// extremely large data values.
2480pub struct LargeUtf8<'a> {
2481    pub _tab: flatbuffers::Table<'a>,
2482}
2483
2484impl<'a> flatbuffers::Follow<'a> for LargeUtf8<'a> {
2485    type Inner = LargeUtf8<'a>;
2486    #[inline]
2487    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2488        Self {
2489            _tab: flatbuffers::Table::new(buf, loc),
2490        }
2491    }
2492}
2493
2494impl<'a> LargeUtf8<'a> {
2495    #[inline]
2496    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2497        LargeUtf8 { _tab: table }
2498    }
2499    #[allow(unused_mut)]
2500    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2501        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2502        _args: &'args LargeUtf8Args,
2503    ) -> flatbuffers::WIPOffset<LargeUtf8<'bldr>> {
2504        let mut builder = LargeUtf8Builder::new(_fbb);
2505        builder.finish()
2506    }
2507}
2508
2509impl flatbuffers::Verifiable for LargeUtf8<'_> {
2510    #[inline]
2511    fn run_verifier(
2512        v: &mut flatbuffers::Verifier,
2513        pos: usize,
2514    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2515        use flatbuffers::Verifiable;
2516        v.visit_table(pos)?.finish();
2517        Ok(())
2518    }
2519}
2520pub struct LargeUtf8Args {}
2521impl<'a> Default for LargeUtf8Args {
2522    #[inline]
2523    fn default() -> Self {
2524        LargeUtf8Args {}
2525    }
2526}
2527
2528pub struct LargeUtf8Builder<'a: 'b, 'b> {
2529    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2530    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2531}
2532impl<'a: 'b, 'b> LargeUtf8Builder<'a, 'b> {
2533    #[inline]
2534    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LargeUtf8Builder<'a, 'b> {
2535        let start = _fbb.start_table();
2536        LargeUtf8Builder {
2537            fbb_: _fbb,
2538            start_: start,
2539        }
2540    }
2541    #[inline]
2542    pub fn finish(self) -> flatbuffers::WIPOffset<LargeUtf8<'a>> {
2543        let o = self.fbb_.end_table(self.start_);
2544        flatbuffers::WIPOffset::new(o.value())
2545    }
2546}
2547
2548impl core::fmt::Debug for LargeUtf8<'_> {
2549    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2550        let mut ds = f.debug_struct("LargeUtf8");
2551        ds.finish()
2552    }
2553}
2554pub enum LargeBinaryOffset {}
2555#[derive(Copy, Clone, PartialEq)]
2556
2557/// Same as Binary, but with 64-bit offsets, allowing to represent
2558/// extremely large data values.
2559pub struct LargeBinary<'a> {
2560    pub _tab: flatbuffers::Table<'a>,
2561}
2562
2563impl<'a> flatbuffers::Follow<'a> for LargeBinary<'a> {
2564    type Inner = LargeBinary<'a>;
2565    #[inline]
2566    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2567        Self {
2568            _tab: flatbuffers::Table::new(buf, loc),
2569        }
2570    }
2571}
2572
2573impl<'a> LargeBinary<'a> {
2574    #[inline]
2575    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2576        LargeBinary { _tab: table }
2577    }
2578    #[allow(unused_mut)]
2579    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2580        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2581        _args: &'args LargeBinaryArgs,
2582    ) -> flatbuffers::WIPOffset<LargeBinary<'bldr>> {
2583        let mut builder = LargeBinaryBuilder::new(_fbb);
2584        builder.finish()
2585    }
2586}
2587
2588impl flatbuffers::Verifiable for LargeBinary<'_> {
2589    #[inline]
2590    fn run_verifier(
2591        v: &mut flatbuffers::Verifier,
2592        pos: usize,
2593    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2594        use flatbuffers::Verifiable;
2595        v.visit_table(pos)?.finish();
2596        Ok(())
2597    }
2598}
2599pub struct LargeBinaryArgs {}
2600impl<'a> Default for LargeBinaryArgs {
2601    #[inline]
2602    fn default() -> Self {
2603        LargeBinaryArgs {}
2604    }
2605}
2606
2607pub struct LargeBinaryBuilder<'a: 'b, 'b> {
2608    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2609    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2610}
2611impl<'a: 'b, 'b> LargeBinaryBuilder<'a, 'b> {
2612    #[inline]
2613    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> LargeBinaryBuilder<'a, 'b> {
2614        let start = _fbb.start_table();
2615        LargeBinaryBuilder {
2616            fbb_: _fbb,
2617            start_: start,
2618        }
2619    }
2620    #[inline]
2621    pub fn finish(self) -> flatbuffers::WIPOffset<LargeBinary<'a>> {
2622        let o = self.fbb_.end_table(self.start_);
2623        flatbuffers::WIPOffset::new(o.value())
2624    }
2625}
2626
2627impl core::fmt::Debug for LargeBinary<'_> {
2628    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2629        let mut ds = f.debug_struct("LargeBinary");
2630        ds.finish()
2631    }
2632}
2633pub enum Utf8ViewOffset {}
2634#[derive(Copy, Clone, PartialEq)]
2635
2636/// Logically the same as Utf8, but the internal representation uses a view
2637/// struct that contains the string length and either the string's entire data
2638/// inline (for small strings) or an inlined prefix, an index of another buffer,
2639/// and an offset pointing to a slice in that buffer (for non-small strings).
2640///
2641/// Since it uses a variable number of data buffers, each Field with this type
2642/// must have a corresponding entry in `variadicBufferCounts`.
2643pub struct Utf8View<'a> {
2644    pub _tab: flatbuffers::Table<'a>,
2645}
2646
2647impl<'a> flatbuffers::Follow<'a> for Utf8View<'a> {
2648    type Inner = Utf8View<'a>;
2649    #[inline]
2650    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2651        Self {
2652            _tab: flatbuffers::Table::new(buf, loc),
2653        }
2654    }
2655}
2656
2657impl<'a> Utf8View<'a> {
2658    #[inline]
2659    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2660        Utf8View { _tab: table }
2661    }
2662    #[allow(unused_mut)]
2663    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2664        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2665        _args: &'args Utf8ViewArgs,
2666    ) -> flatbuffers::WIPOffset<Utf8View<'bldr>> {
2667        let mut builder = Utf8ViewBuilder::new(_fbb);
2668        builder.finish()
2669    }
2670}
2671
2672impl flatbuffers::Verifiable for Utf8View<'_> {
2673    #[inline]
2674    fn run_verifier(
2675        v: &mut flatbuffers::Verifier,
2676        pos: usize,
2677    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2678        use flatbuffers::Verifiable;
2679        v.visit_table(pos)?.finish();
2680        Ok(())
2681    }
2682}
2683pub struct Utf8ViewArgs {}
2684impl<'a> Default for Utf8ViewArgs {
2685    #[inline]
2686    fn default() -> Self {
2687        Utf8ViewArgs {}
2688    }
2689}
2690
2691pub struct Utf8ViewBuilder<'a: 'b, 'b> {
2692    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2693    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2694}
2695impl<'a: 'b, 'b> Utf8ViewBuilder<'a, 'b> {
2696    #[inline]
2697    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> Utf8ViewBuilder<'a, 'b> {
2698        let start = _fbb.start_table();
2699        Utf8ViewBuilder {
2700            fbb_: _fbb,
2701            start_: start,
2702        }
2703    }
2704    #[inline]
2705    pub fn finish(self) -> flatbuffers::WIPOffset<Utf8View<'a>> {
2706        let o = self.fbb_.end_table(self.start_);
2707        flatbuffers::WIPOffset::new(o.value())
2708    }
2709}
2710
2711impl core::fmt::Debug for Utf8View<'_> {
2712    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2713        let mut ds = f.debug_struct("Utf8View");
2714        ds.finish()
2715    }
2716}
2717pub enum BinaryViewOffset {}
2718#[derive(Copy, Clone, PartialEq)]
2719
2720/// Logically the same as Binary, but the internal representation uses a view
2721/// struct that contains the string length and either the string's entire data
2722/// inline (for small strings) or an inlined prefix, an index of another buffer,
2723/// and an offset pointing to a slice in that buffer (for non-small strings).
2724///
2725/// Since it uses a variable number of data buffers, each Field with this type
2726/// must have a corresponding entry in `variadicBufferCounts`.
2727pub struct BinaryView<'a> {
2728    pub _tab: flatbuffers::Table<'a>,
2729}
2730
2731impl<'a> flatbuffers::Follow<'a> for BinaryView<'a> {
2732    type Inner = BinaryView<'a>;
2733    #[inline]
2734    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2735        Self {
2736            _tab: flatbuffers::Table::new(buf, loc),
2737        }
2738    }
2739}
2740
2741impl<'a> BinaryView<'a> {
2742    #[inline]
2743    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2744        BinaryView { _tab: table }
2745    }
2746    #[allow(unused_mut)]
2747    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2748        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2749        _args: &'args BinaryViewArgs,
2750    ) -> flatbuffers::WIPOffset<BinaryView<'bldr>> {
2751        let mut builder = BinaryViewBuilder::new(_fbb);
2752        builder.finish()
2753    }
2754}
2755
2756impl flatbuffers::Verifiable for BinaryView<'_> {
2757    #[inline]
2758    fn run_verifier(
2759        v: &mut flatbuffers::Verifier,
2760        pos: usize,
2761    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2762        use flatbuffers::Verifiable;
2763        v.visit_table(pos)?.finish();
2764        Ok(())
2765    }
2766}
2767pub struct BinaryViewArgs {}
2768impl<'a> Default for BinaryViewArgs {
2769    #[inline]
2770    fn default() -> Self {
2771        BinaryViewArgs {}
2772    }
2773}
2774
2775pub struct BinaryViewBuilder<'a: 'b, 'b> {
2776    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2777    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2778}
2779impl<'a: 'b, 'b> BinaryViewBuilder<'a, 'b> {
2780    #[inline]
2781    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> BinaryViewBuilder<'a, 'b> {
2782        let start = _fbb.start_table();
2783        BinaryViewBuilder {
2784            fbb_: _fbb,
2785            start_: start,
2786        }
2787    }
2788    #[inline]
2789    pub fn finish(self) -> flatbuffers::WIPOffset<BinaryView<'a>> {
2790        let o = self.fbb_.end_table(self.start_);
2791        flatbuffers::WIPOffset::new(o.value())
2792    }
2793}
2794
2795impl core::fmt::Debug for BinaryView<'_> {
2796    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2797        let mut ds = f.debug_struct("BinaryView");
2798        ds.finish()
2799    }
2800}
2801pub enum FixedSizeBinaryOffset {}
2802#[derive(Copy, Clone, PartialEq)]
2803
2804pub struct FixedSizeBinary<'a> {
2805    pub _tab: flatbuffers::Table<'a>,
2806}
2807
2808impl<'a> flatbuffers::Follow<'a> for FixedSizeBinary<'a> {
2809    type Inner = FixedSizeBinary<'a>;
2810    #[inline]
2811    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2812        Self {
2813            _tab: flatbuffers::Table::new(buf, loc),
2814        }
2815    }
2816}
2817
2818impl<'a> FixedSizeBinary<'a> {
2819    pub const VT_BYTEWIDTH: flatbuffers::VOffsetT = 4;
2820
2821    #[inline]
2822    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2823        FixedSizeBinary { _tab: table }
2824    }
2825    #[allow(unused_mut)]
2826    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2827        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2828        args: &'args FixedSizeBinaryArgs,
2829    ) -> flatbuffers::WIPOffset<FixedSizeBinary<'bldr>> {
2830        let mut builder = FixedSizeBinaryBuilder::new(_fbb);
2831        builder.add_byteWidth(args.byteWidth);
2832        builder.finish()
2833    }
2834
2835    /// Number of bytes per value
2836    #[inline]
2837    pub fn byteWidth(&self) -> i32 {
2838        // Safety:
2839        // Created from valid Table for this object
2840        // which contains a valid value in this slot
2841        unsafe {
2842            self._tab
2843                .get::<i32>(FixedSizeBinary::VT_BYTEWIDTH, Some(0))
2844                .unwrap()
2845        }
2846    }
2847}
2848
2849impl flatbuffers::Verifiable for FixedSizeBinary<'_> {
2850    #[inline]
2851    fn run_verifier(
2852        v: &mut flatbuffers::Verifier,
2853        pos: usize,
2854    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2855        use flatbuffers::Verifiable;
2856        v.visit_table(pos)?
2857            .visit_field::<i32>("byteWidth", Self::VT_BYTEWIDTH, false)?
2858            .finish();
2859        Ok(())
2860    }
2861}
2862pub struct FixedSizeBinaryArgs {
2863    pub byteWidth: i32,
2864}
2865impl<'a> Default for FixedSizeBinaryArgs {
2866    #[inline]
2867    fn default() -> Self {
2868        FixedSizeBinaryArgs { byteWidth: 0 }
2869    }
2870}
2871
2872pub struct FixedSizeBinaryBuilder<'a: 'b, 'b> {
2873    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2874    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2875}
2876impl<'a: 'b, 'b> FixedSizeBinaryBuilder<'a, 'b> {
2877    #[inline]
2878    pub fn add_byteWidth(&mut self, byteWidth: i32) {
2879        self.fbb_
2880            .push_slot::<i32>(FixedSizeBinary::VT_BYTEWIDTH, byteWidth, 0);
2881    }
2882    #[inline]
2883    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> FixedSizeBinaryBuilder<'a, 'b> {
2884        let start = _fbb.start_table();
2885        FixedSizeBinaryBuilder {
2886            fbb_: _fbb,
2887            start_: start,
2888        }
2889    }
2890    #[inline]
2891    pub fn finish(self) -> flatbuffers::WIPOffset<FixedSizeBinary<'a>> {
2892        let o = self.fbb_.end_table(self.start_);
2893        flatbuffers::WIPOffset::new(o.value())
2894    }
2895}
2896
2897impl core::fmt::Debug for FixedSizeBinary<'_> {
2898    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2899        let mut ds = f.debug_struct("FixedSizeBinary");
2900        ds.field("byteWidth", &self.byteWidth());
2901        ds.finish()
2902    }
2903}
2904pub enum BoolOffset {}
2905#[derive(Copy, Clone, PartialEq)]
2906
2907pub struct Bool<'a> {
2908    pub _tab: flatbuffers::Table<'a>,
2909}
2910
2911impl<'a> flatbuffers::Follow<'a> for Bool<'a> {
2912    type Inner = Bool<'a>;
2913    #[inline]
2914    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2915        Self {
2916            _tab: flatbuffers::Table::new(buf, loc),
2917        }
2918    }
2919}
2920
2921impl<'a> Bool<'a> {
2922    #[inline]
2923    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
2924        Bool { _tab: table }
2925    }
2926    #[allow(unused_mut)]
2927    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
2928        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
2929        _args: &'args BoolArgs,
2930    ) -> flatbuffers::WIPOffset<Bool<'bldr>> {
2931        let mut builder = BoolBuilder::new(_fbb);
2932        builder.finish()
2933    }
2934}
2935
2936impl flatbuffers::Verifiable for Bool<'_> {
2937    #[inline]
2938    fn run_verifier(
2939        v: &mut flatbuffers::Verifier,
2940        pos: usize,
2941    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
2942        use flatbuffers::Verifiable;
2943        v.visit_table(pos)?.finish();
2944        Ok(())
2945    }
2946}
2947pub struct BoolArgs {}
2948impl<'a> Default for BoolArgs {
2949    #[inline]
2950    fn default() -> Self {
2951        BoolArgs {}
2952    }
2953}
2954
2955pub struct BoolBuilder<'a: 'b, 'b> {
2956    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
2957    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
2958}
2959impl<'a: 'b, 'b> BoolBuilder<'a, 'b> {
2960    #[inline]
2961    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> BoolBuilder<'a, 'b> {
2962        let start = _fbb.start_table();
2963        BoolBuilder {
2964            fbb_: _fbb,
2965            start_: start,
2966        }
2967    }
2968    #[inline]
2969    pub fn finish(self) -> flatbuffers::WIPOffset<Bool<'a>> {
2970        let o = self.fbb_.end_table(self.start_);
2971        flatbuffers::WIPOffset::new(o.value())
2972    }
2973}
2974
2975impl core::fmt::Debug for Bool<'_> {
2976    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
2977        let mut ds = f.debug_struct("Bool");
2978        ds.finish()
2979    }
2980}
2981pub enum RunEndEncodedOffset {}
2982#[derive(Copy, Clone, PartialEq)]
2983
2984/// Contains two child arrays, run_ends and values.
2985/// The run_ends child array must be a 16/32/64-bit integer array
2986/// which encodes the indices at which the run with the value in
2987/// each corresponding index in the values child array ends.
2988/// Like list/struct types, the value array can be of any type.
2989pub struct RunEndEncoded<'a> {
2990    pub _tab: flatbuffers::Table<'a>,
2991}
2992
2993impl<'a> flatbuffers::Follow<'a> for RunEndEncoded<'a> {
2994    type Inner = RunEndEncoded<'a>;
2995    #[inline]
2996    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
2997        Self {
2998            _tab: flatbuffers::Table::new(buf, loc),
2999        }
3000    }
3001}
3002
3003impl<'a> RunEndEncoded<'a> {
3004    #[inline]
3005    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3006        RunEndEncoded { _tab: table }
3007    }
3008    #[allow(unused_mut)]
3009    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3010        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3011        _args: &'args RunEndEncodedArgs,
3012    ) -> flatbuffers::WIPOffset<RunEndEncoded<'bldr>> {
3013        let mut builder = RunEndEncodedBuilder::new(_fbb);
3014        builder.finish()
3015    }
3016}
3017
3018impl flatbuffers::Verifiable for RunEndEncoded<'_> {
3019    #[inline]
3020    fn run_verifier(
3021        v: &mut flatbuffers::Verifier,
3022        pos: usize,
3023    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3024        use flatbuffers::Verifiable;
3025        v.visit_table(pos)?.finish();
3026        Ok(())
3027    }
3028}
3029pub struct RunEndEncodedArgs {}
3030impl<'a> Default for RunEndEncodedArgs {
3031    #[inline]
3032    fn default() -> Self {
3033        RunEndEncodedArgs {}
3034    }
3035}
3036
3037pub struct RunEndEncodedBuilder<'a: 'b, 'b> {
3038    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
3039    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3040}
3041impl<'a: 'b, 'b> RunEndEncodedBuilder<'a, 'b> {
3042    #[inline]
3043    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> RunEndEncodedBuilder<'a, 'b> {
3044        let start = _fbb.start_table();
3045        RunEndEncodedBuilder {
3046            fbb_: _fbb,
3047            start_: start,
3048        }
3049    }
3050    #[inline]
3051    pub fn finish(self) -> flatbuffers::WIPOffset<RunEndEncoded<'a>> {
3052        let o = self.fbb_.end_table(self.start_);
3053        flatbuffers::WIPOffset::new(o.value())
3054    }
3055}
3056
3057impl core::fmt::Debug for RunEndEncoded<'_> {
3058    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3059        let mut ds = f.debug_struct("RunEndEncoded");
3060        ds.finish()
3061    }
3062}
3063pub enum DecimalOffset {}
3064#[derive(Copy, Clone, PartialEq)]
3065
3066/// Exact decimal value represented as an integer value in two's
3067/// complement. Currently only 128-bit (16-byte) and 256-bit (32-byte) integers
3068/// are used. The representation uses the endianness indicated
3069/// in the Schema.
3070pub struct Decimal<'a> {
3071    pub _tab: flatbuffers::Table<'a>,
3072}
3073
3074impl<'a> flatbuffers::Follow<'a> for Decimal<'a> {
3075    type Inner = Decimal<'a>;
3076    #[inline]
3077    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3078        Self {
3079            _tab: flatbuffers::Table::new(buf, loc),
3080        }
3081    }
3082}
3083
3084impl<'a> Decimal<'a> {
3085    pub const VT_PRECISION: flatbuffers::VOffsetT = 4;
3086    pub const VT_SCALE: flatbuffers::VOffsetT = 6;
3087    pub const VT_BITWIDTH: flatbuffers::VOffsetT = 8;
3088
3089    #[inline]
3090    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3091        Decimal { _tab: table }
3092    }
3093    #[allow(unused_mut)]
3094    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3095        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3096        args: &'args DecimalArgs,
3097    ) -> flatbuffers::WIPOffset<Decimal<'bldr>> {
3098        let mut builder = DecimalBuilder::new(_fbb);
3099        builder.add_bitWidth(args.bitWidth);
3100        builder.add_scale(args.scale);
3101        builder.add_precision(args.precision);
3102        builder.finish()
3103    }
3104
3105    /// Total number of decimal digits
3106    #[inline]
3107    pub fn precision(&self) -> i32 {
3108        // Safety:
3109        // Created from valid Table for this object
3110        // which contains a valid value in this slot
3111        unsafe {
3112            self._tab
3113                .get::<i32>(Decimal::VT_PRECISION, Some(0))
3114                .unwrap()
3115        }
3116    }
3117    /// Number of digits after the decimal point "."
3118    #[inline]
3119    pub fn scale(&self) -> i32 {
3120        // Safety:
3121        // Created from valid Table for this object
3122        // which contains a valid value in this slot
3123        unsafe { self._tab.get::<i32>(Decimal::VT_SCALE, Some(0)).unwrap() }
3124    }
3125    /// Number of bits per value. The only accepted widths are 128 and 256.
3126    /// We use bitWidth for consistency with Int::bitWidth.
3127    #[inline]
3128    pub fn bitWidth(&self) -> i32 {
3129        // Safety:
3130        // Created from valid Table for this object
3131        // which contains a valid value in this slot
3132        unsafe {
3133            self._tab
3134                .get::<i32>(Decimal::VT_BITWIDTH, Some(128))
3135                .unwrap()
3136        }
3137    }
3138}
3139
3140impl flatbuffers::Verifiable for Decimal<'_> {
3141    #[inline]
3142    fn run_verifier(
3143        v: &mut flatbuffers::Verifier,
3144        pos: usize,
3145    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3146        use flatbuffers::Verifiable;
3147        v.visit_table(pos)?
3148            .visit_field::<i32>("precision", Self::VT_PRECISION, false)?
3149            .visit_field::<i32>("scale", Self::VT_SCALE, false)?
3150            .visit_field::<i32>("bitWidth", Self::VT_BITWIDTH, false)?
3151            .finish();
3152        Ok(())
3153    }
3154}
3155pub struct DecimalArgs {
3156    pub precision: i32,
3157    pub scale: i32,
3158    pub bitWidth: i32,
3159}
3160impl<'a> Default for DecimalArgs {
3161    #[inline]
3162    fn default() -> Self {
3163        DecimalArgs {
3164            precision: 0,
3165            scale: 0,
3166            bitWidth: 128,
3167        }
3168    }
3169}
3170
3171pub struct DecimalBuilder<'a: 'b, 'b> {
3172    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
3173    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3174}
3175impl<'a: 'b, 'b> DecimalBuilder<'a, 'b> {
3176    #[inline]
3177    pub fn add_precision(&mut self, precision: i32) {
3178        self.fbb_
3179            .push_slot::<i32>(Decimal::VT_PRECISION, precision, 0);
3180    }
3181    #[inline]
3182    pub fn add_scale(&mut self, scale: i32) {
3183        self.fbb_.push_slot::<i32>(Decimal::VT_SCALE, scale, 0);
3184    }
3185    #[inline]
3186    pub fn add_bitWidth(&mut self, bitWidth: i32) {
3187        self.fbb_
3188            .push_slot::<i32>(Decimal::VT_BITWIDTH, bitWidth, 128);
3189    }
3190    #[inline]
3191    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> DecimalBuilder<'a, 'b> {
3192        let start = _fbb.start_table();
3193        DecimalBuilder {
3194            fbb_: _fbb,
3195            start_: start,
3196        }
3197    }
3198    #[inline]
3199    pub fn finish(self) -> flatbuffers::WIPOffset<Decimal<'a>> {
3200        let o = self.fbb_.end_table(self.start_);
3201        flatbuffers::WIPOffset::new(o.value())
3202    }
3203}
3204
3205impl core::fmt::Debug for Decimal<'_> {
3206    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3207        let mut ds = f.debug_struct("Decimal");
3208        ds.field("precision", &self.precision());
3209        ds.field("scale", &self.scale());
3210        ds.field("bitWidth", &self.bitWidth());
3211        ds.finish()
3212    }
3213}
3214pub enum DateOffset {}
3215#[derive(Copy, Clone, PartialEq)]
3216
3217/// Date is either a 32-bit or 64-bit signed integer type representing an
3218/// elapsed time since UNIX epoch (1970-01-01), stored in either of two units:
3219///
3220/// * Milliseconds (64 bits) indicating UNIX time elapsed since the epoch (no
3221///   leap seconds), where the values are evenly divisible by 86400000
3222/// * Days (32 bits) since the UNIX epoch
3223pub struct Date<'a> {
3224    pub _tab: flatbuffers::Table<'a>,
3225}
3226
3227impl<'a> flatbuffers::Follow<'a> for Date<'a> {
3228    type Inner = Date<'a>;
3229    #[inline]
3230    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3231        Self {
3232            _tab: flatbuffers::Table::new(buf, loc),
3233        }
3234    }
3235}
3236
3237impl<'a> Date<'a> {
3238    pub const VT_UNIT: flatbuffers::VOffsetT = 4;
3239
3240    #[inline]
3241    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3242        Date { _tab: table }
3243    }
3244    #[allow(unused_mut)]
3245    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3246        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3247        args: &'args DateArgs,
3248    ) -> flatbuffers::WIPOffset<Date<'bldr>> {
3249        let mut builder = DateBuilder::new(_fbb);
3250        builder.add_unit(args.unit);
3251        builder.finish()
3252    }
3253
3254    #[inline]
3255    pub fn unit(&self) -> DateUnit {
3256        // Safety:
3257        // Created from valid Table for this object
3258        // which contains a valid value in this slot
3259        unsafe {
3260            self._tab
3261                .get::<DateUnit>(Date::VT_UNIT, Some(DateUnit::MILLISECOND))
3262                .unwrap()
3263        }
3264    }
3265}
3266
3267impl flatbuffers::Verifiable for Date<'_> {
3268    #[inline]
3269    fn run_verifier(
3270        v: &mut flatbuffers::Verifier,
3271        pos: usize,
3272    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3273        use flatbuffers::Verifiable;
3274        v.visit_table(pos)?
3275            .visit_field::<DateUnit>("unit", Self::VT_UNIT, false)?
3276            .finish();
3277        Ok(())
3278    }
3279}
3280pub struct DateArgs {
3281    pub unit: DateUnit,
3282}
3283impl<'a> Default for DateArgs {
3284    #[inline]
3285    fn default() -> Self {
3286        DateArgs {
3287            unit: DateUnit::MILLISECOND,
3288        }
3289    }
3290}
3291
3292pub struct DateBuilder<'a: 'b, 'b> {
3293    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
3294    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3295}
3296impl<'a: 'b, 'b> DateBuilder<'a, 'b> {
3297    #[inline]
3298    pub fn add_unit(&mut self, unit: DateUnit) {
3299        self.fbb_
3300            .push_slot::<DateUnit>(Date::VT_UNIT, unit, DateUnit::MILLISECOND);
3301    }
3302    #[inline]
3303    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> DateBuilder<'a, 'b> {
3304        let start = _fbb.start_table();
3305        DateBuilder {
3306            fbb_: _fbb,
3307            start_: start,
3308        }
3309    }
3310    #[inline]
3311    pub fn finish(self) -> flatbuffers::WIPOffset<Date<'a>> {
3312        let o = self.fbb_.end_table(self.start_);
3313        flatbuffers::WIPOffset::new(o.value())
3314    }
3315}
3316
3317impl core::fmt::Debug for Date<'_> {
3318    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3319        let mut ds = f.debug_struct("Date");
3320        ds.field("unit", &self.unit());
3321        ds.finish()
3322    }
3323}
3324pub enum TimeOffset {}
3325#[derive(Copy, Clone, PartialEq)]
3326
3327/// Time is either a 32-bit or 64-bit signed integer type representing an
3328/// elapsed time since midnight, stored in either of four units: seconds,
3329/// milliseconds, microseconds or nanoseconds.
3330///
3331/// The integer `bitWidth` depends on the `unit` and must be one of the following:
3332/// * SECOND and MILLISECOND: 32 bits
3333/// * MICROSECOND and NANOSECOND: 64 bits
3334///
3335/// The allowed values are between 0 (inclusive) and 86400 (=24*60*60) seconds
3336/// (exclusive), adjusted for the time unit (for example, up to 86400000
3337/// exclusive for the MILLISECOND unit).
3338/// This definition doesn't allow for leap seconds. Time values from
3339/// measurements with leap seconds will need to be corrected when ingesting
3340/// into Arrow (for example by replacing the value 86400 with 86399).
3341pub struct Time<'a> {
3342    pub _tab: flatbuffers::Table<'a>,
3343}
3344
3345impl<'a> flatbuffers::Follow<'a> for Time<'a> {
3346    type Inner = Time<'a>;
3347    #[inline]
3348    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3349        Self {
3350            _tab: flatbuffers::Table::new(buf, loc),
3351        }
3352    }
3353}
3354
3355impl<'a> Time<'a> {
3356    pub const VT_UNIT: flatbuffers::VOffsetT = 4;
3357    pub const VT_BITWIDTH: flatbuffers::VOffsetT = 6;
3358
3359    #[inline]
3360    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3361        Time { _tab: table }
3362    }
3363    #[allow(unused_mut)]
3364    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3365        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3366        args: &'args TimeArgs,
3367    ) -> flatbuffers::WIPOffset<Time<'bldr>> {
3368        let mut builder = TimeBuilder::new(_fbb);
3369        builder.add_bitWidth(args.bitWidth);
3370        builder.add_unit(args.unit);
3371        builder.finish()
3372    }
3373
3374    #[inline]
3375    pub fn unit(&self) -> TimeUnit {
3376        // Safety:
3377        // Created from valid Table for this object
3378        // which contains a valid value in this slot
3379        unsafe {
3380            self._tab
3381                .get::<TimeUnit>(Time::VT_UNIT, Some(TimeUnit::MILLISECOND))
3382                .unwrap()
3383        }
3384    }
3385    #[inline]
3386    pub fn bitWidth(&self) -> i32 {
3387        // Safety:
3388        // Created from valid Table for this object
3389        // which contains a valid value in this slot
3390        unsafe { self._tab.get::<i32>(Time::VT_BITWIDTH, Some(32)).unwrap() }
3391    }
3392}
3393
3394impl flatbuffers::Verifiable for Time<'_> {
3395    #[inline]
3396    fn run_verifier(
3397        v: &mut flatbuffers::Verifier,
3398        pos: usize,
3399    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3400        use flatbuffers::Verifiable;
3401        v.visit_table(pos)?
3402            .visit_field::<TimeUnit>("unit", Self::VT_UNIT, false)?
3403            .visit_field::<i32>("bitWidth", Self::VT_BITWIDTH, false)?
3404            .finish();
3405        Ok(())
3406    }
3407}
3408pub struct TimeArgs {
3409    pub unit: TimeUnit,
3410    pub bitWidth: i32,
3411}
3412impl<'a> Default for TimeArgs {
3413    #[inline]
3414    fn default() -> Self {
3415        TimeArgs {
3416            unit: TimeUnit::MILLISECOND,
3417            bitWidth: 32,
3418        }
3419    }
3420}
3421
3422pub struct TimeBuilder<'a: 'b, 'b> {
3423    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
3424    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3425}
3426impl<'a: 'b, 'b> TimeBuilder<'a, 'b> {
3427    #[inline]
3428    pub fn add_unit(&mut self, unit: TimeUnit) {
3429        self.fbb_
3430            .push_slot::<TimeUnit>(Time::VT_UNIT, unit, TimeUnit::MILLISECOND);
3431    }
3432    #[inline]
3433    pub fn add_bitWidth(&mut self, bitWidth: i32) {
3434        self.fbb_.push_slot::<i32>(Time::VT_BITWIDTH, bitWidth, 32);
3435    }
3436    #[inline]
3437    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TimeBuilder<'a, 'b> {
3438        let start = _fbb.start_table();
3439        TimeBuilder {
3440            fbb_: _fbb,
3441            start_: start,
3442        }
3443    }
3444    #[inline]
3445    pub fn finish(self) -> flatbuffers::WIPOffset<Time<'a>> {
3446        let o = self.fbb_.end_table(self.start_);
3447        flatbuffers::WIPOffset::new(o.value())
3448    }
3449}
3450
3451impl core::fmt::Debug for Time<'_> {
3452    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3453        let mut ds = f.debug_struct("Time");
3454        ds.field("unit", &self.unit());
3455        ds.field("bitWidth", &self.bitWidth());
3456        ds.finish()
3457    }
3458}
3459pub enum TimestampOffset {}
3460#[derive(Copy, Clone, PartialEq)]
3461
3462/// Timestamp is a 64-bit signed integer representing an elapsed time since a
3463/// fixed epoch, stored in either of four units: seconds, milliseconds,
3464/// microseconds or nanoseconds, and is optionally annotated with a timezone.
3465///
3466/// Timestamp values do not include any leap seconds (in other words, all
3467/// days are considered 86400 seconds long).
3468///
3469/// Timestamps with a non-empty timezone
3470/// ------------------------------------
3471///
3472/// If a Timestamp column has a non-empty timezone value, its epoch is
3473/// 1970-01-01 00:00:00 (January 1st 1970, midnight) in the *UTC* timezone
3474/// (the Unix epoch), regardless of the Timestamp's own timezone.
3475///
3476/// Therefore, timestamp values with a non-empty timezone correspond to
3477/// physical points in time together with some additional information about
3478/// how the data was obtained and/or how to display it (the timezone).
3479///
3480///   For example, the timestamp value 0 with the timezone string "Europe/Paris"
3481///   corresponds to "January 1st 1970, 00h00" in the UTC timezone, but the
3482///   application may prefer to display it as "January 1st 1970, 01h00" in
3483///   the Europe/Paris timezone (which is the same physical point in time).
3484///
3485/// One consequence is that timestamp values with a non-empty timezone
3486/// can be compared and ordered directly, since they all share the same
3487/// well-known point of reference (the Unix epoch).
3488///
3489/// Timestamps with an unset / empty timezone
3490/// -----------------------------------------
3491///
3492/// If a Timestamp column has no timezone value, its epoch is
3493/// 1970-01-01 00:00:00 (January 1st 1970, midnight) in an *unknown* timezone.
3494///
3495/// Therefore, timestamp values without a timezone cannot be meaningfully
3496/// interpreted as physical points in time, but only as calendar / clock
3497/// indications ("wall clock time") in an unspecified timezone.
3498///
3499///   For example, the timestamp value 0 with an empty timezone string
3500///   corresponds to "January 1st 1970, 00h00" in an unknown timezone: there
3501///   is not enough information to interpret it as a well-defined physical
3502///   point in time.
3503///
3504/// One consequence is that timestamp values without a timezone cannot
3505/// be reliably compared or ordered, since they may have different points of
3506/// reference.  In particular, it is *not* possible to interpret an unset
3507/// or empty timezone as the same as "UTC".
3508///
3509/// Conversion between timezones
3510/// ----------------------------
3511///
3512/// If a Timestamp column has a non-empty timezone, changing the timezone
3513/// to a different non-empty value is a metadata-only operation:
3514/// the timestamp values need not change as their point of reference remains
3515/// the same (the Unix epoch).
3516///
3517/// However, if a Timestamp column has no timezone value, changing it to a
3518/// non-empty value requires to think about the desired semantics.
3519/// One possibility is to assume that the original timestamp values are
3520/// relative to the epoch of the timezone being set; timestamp values should
3521/// then adjusted to the Unix epoch (for example, changing the timezone from
3522/// empty to "Europe/Paris" would require converting the timestamp values
3523/// from "Europe/Paris" to "UTC", which seems counter-intuitive but is
3524/// nevertheless correct).
3525///
3526/// Guidelines for encoding data from external libraries
3527/// ----------------------------------------------------
3528///
3529/// Date & time libraries often have multiple different data types for temporal
3530/// data. In order to ease interoperability between different implementations the
3531/// Arrow project has some recommendations for encoding these types into a Timestamp
3532/// column.
3533///
3534/// An "instant" represents a physical point in time that has no relevant timezone
3535/// (for example, astronomical data). To encode an instant, use a Timestamp with
3536/// the timezone string set to "UTC", and make sure the Timestamp values
3537/// are relative to the UTC epoch (January 1st 1970, midnight).
3538///
3539/// A "zoned date-time" represents a physical point in time annotated with an
3540/// informative timezone (for example, the timezone in which the data was
3541/// recorded).  To encode a zoned date-time, use a Timestamp with the timezone
3542/// string set to the name of the timezone, and make sure the Timestamp values
3543/// are relative to the UTC epoch (January 1st 1970, midnight).
3544///
3545///  (There is some ambiguity between an instant and a zoned date-time with the
3546///   UTC timezone.  Both of these are stored the same in Arrow.  Typically,
3547///   this distinction does not matter.  If it does, then an application should
3548///   use custom metadata or an extension type to distinguish between the two cases.)
3549///
3550/// An "offset date-time" represents a physical point in time combined with an
3551/// explicit offset from UTC.  To encode an offset date-time, use a Timestamp
3552/// with the timezone string set to the numeric timezone offset string
3553/// (e.g. "+03:00"), and make sure the Timestamp values are relative to
3554/// the UTC epoch (January 1st 1970, midnight).
3555///
3556/// A "naive date-time" (also called "local date-time" in some libraries)
3557/// represents a wall clock time combined with a calendar date, but with
3558/// no indication of how to map this information to a physical point in time.
3559/// Naive date-times must be handled with care because of this missing
3560/// information, and also because daylight saving time (DST) may make
3561/// some values ambiguous or nonexistent. A naive date-time may be
3562/// stored as a struct with Date and Time fields. However, it may also be
3563/// encoded into a Timestamp column with an empty timezone. The timestamp
3564/// values should be computed "as if" the timezone of the date-time values
3565/// was UTC; for example, the naive date-time "January 1st 1970, 00h00" would
3566/// be encoded as timestamp value 0.
3567pub struct Timestamp<'a> {
3568    pub _tab: flatbuffers::Table<'a>,
3569}
3570
3571impl<'a> flatbuffers::Follow<'a> for Timestamp<'a> {
3572    type Inner = Timestamp<'a>;
3573    #[inline]
3574    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3575        Self {
3576            _tab: flatbuffers::Table::new(buf, loc),
3577        }
3578    }
3579}
3580
3581impl<'a> Timestamp<'a> {
3582    pub const VT_UNIT: flatbuffers::VOffsetT = 4;
3583    pub const VT_TIMEZONE: flatbuffers::VOffsetT = 6;
3584
3585    #[inline]
3586    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3587        Timestamp { _tab: table }
3588    }
3589    #[allow(unused_mut)]
3590    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3591        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3592        args: &'args TimestampArgs<'args>,
3593    ) -> flatbuffers::WIPOffset<Timestamp<'bldr>> {
3594        let mut builder = TimestampBuilder::new(_fbb);
3595        if let Some(x) = args.timezone {
3596            builder.add_timezone(x);
3597        }
3598        builder.add_unit(args.unit);
3599        builder.finish()
3600    }
3601
3602    #[inline]
3603    pub fn unit(&self) -> TimeUnit {
3604        // Safety:
3605        // Created from valid Table for this object
3606        // which contains a valid value in this slot
3607        unsafe {
3608            self._tab
3609                .get::<TimeUnit>(Timestamp::VT_UNIT, Some(TimeUnit::SECOND))
3610                .unwrap()
3611        }
3612    }
3613    /// The timezone is an optional string indicating the name of a timezone,
3614    /// one of:
3615    ///
3616    /// * As used in the Olson timezone database (the "tz database" or
3617    ///   "tzdata"), such as "America/New_York".
3618    /// * An absolute timezone offset of the form "+XX:XX" or "-XX:XX",
3619    ///   such as "+07:30".
3620    ///
3621    /// Whether a timezone string is present indicates different semantics about
3622    /// the data (see above).
3623    #[inline]
3624    pub fn timezone(&self) -> Option<&'a str> {
3625        // Safety:
3626        // Created from valid Table for this object
3627        // which contains a valid value in this slot
3628        unsafe {
3629            self._tab
3630                .get::<flatbuffers::ForwardsUOffset<&str>>(Timestamp::VT_TIMEZONE, None)
3631        }
3632    }
3633}
3634
3635impl flatbuffers::Verifiable for Timestamp<'_> {
3636    #[inline]
3637    fn run_verifier(
3638        v: &mut flatbuffers::Verifier,
3639        pos: usize,
3640    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3641        use flatbuffers::Verifiable;
3642        v.visit_table(pos)?
3643            .visit_field::<TimeUnit>("unit", Self::VT_UNIT, false)?
3644            .visit_field::<flatbuffers::ForwardsUOffset<&str>>(
3645                "timezone",
3646                Self::VT_TIMEZONE,
3647                false,
3648            )?
3649            .finish();
3650        Ok(())
3651    }
3652}
3653pub struct TimestampArgs<'a> {
3654    pub unit: TimeUnit,
3655    pub timezone: Option<flatbuffers::WIPOffset<&'a str>>,
3656}
3657impl<'a> Default for TimestampArgs<'a> {
3658    #[inline]
3659    fn default() -> Self {
3660        TimestampArgs {
3661            unit: TimeUnit::SECOND,
3662            timezone: None,
3663        }
3664    }
3665}
3666
3667pub struct TimestampBuilder<'a: 'b, 'b> {
3668    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
3669    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3670}
3671impl<'a: 'b, 'b> TimestampBuilder<'a, 'b> {
3672    #[inline]
3673    pub fn add_unit(&mut self, unit: TimeUnit) {
3674        self.fbb_
3675            .push_slot::<TimeUnit>(Timestamp::VT_UNIT, unit, TimeUnit::SECOND);
3676    }
3677    #[inline]
3678    pub fn add_timezone(&mut self, timezone: flatbuffers::WIPOffset<&'b str>) {
3679        self.fbb_
3680            .push_slot_always::<flatbuffers::WIPOffset<_>>(Timestamp::VT_TIMEZONE, timezone);
3681    }
3682    #[inline]
3683    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> TimestampBuilder<'a, 'b> {
3684        let start = _fbb.start_table();
3685        TimestampBuilder {
3686            fbb_: _fbb,
3687            start_: start,
3688        }
3689    }
3690    #[inline]
3691    pub fn finish(self) -> flatbuffers::WIPOffset<Timestamp<'a>> {
3692        let o = self.fbb_.end_table(self.start_);
3693        flatbuffers::WIPOffset::new(o.value())
3694    }
3695}
3696
3697impl core::fmt::Debug for Timestamp<'_> {
3698    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3699        let mut ds = f.debug_struct("Timestamp");
3700        ds.field("unit", &self.unit());
3701        ds.field("timezone", &self.timezone());
3702        ds.finish()
3703    }
3704}
3705pub enum IntervalOffset {}
3706#[derive(Copy, Clone, PartialEq)]
3707
3708pub struct Interval<'a> {
3709    pub _tab: flatbuffers::Table<'a>,
3710}
3711
3712impl<'a> flatbuffers::Follow<'a> for Interval<'a> {
3713    type Inner = Interval<'a>;
3714    #[inline]
3715    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3716        Self {
3717            _tab: flatbuffers::Table::new(buf, loc),
3718        }
3719    }
3720}
3721
3722impl<'a> Interval<'a> {
3723    pub const VT_UNIT: flatbuffers::VOffsetT = 4;
3724
3725    #[inline]
3726    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3727        Interval { _tab: table }
3728    }
3729    #[allow(unused_mut)]
3730    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3731        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3732        args: &'args IntervalArgs,
3733    ) -> flatbuffers::WIPOffset<Interval<'bldr>> {
3734        let mut builder = IntervalBuilder::new(_fbb);
3735        builder.add_unit(args.unit);
3736        builder.finish()
3737    }
3738
3739    #[inline]
3740    pub fn unit(&self) -> IntervalUnit {
3741        // Safety:
3742        // Created from valid Table for this object
3743        // which contains a valid value in this slot
3744        unsafe {
3745            self._tab
3746                .get::<IntervalUnit>(Interval::VT_UNIT, Some(IntervalUnit::YEAR_MONTH))
3747                .unwrap()
3748        }
3749    }
3750}
3751
3752impl flatbuffers::Verifiable for Interval<'_> {
3753    #[inline]
3754    fn run_verifier(
3755        v: &mut flatbuffers::Verifier,
3756        pos: usize,
3757    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3758        use flatbuffers::Verifiable;
3759        v.visit_table(pos)?
3760            .visit_field::<IntervalUnit>("unit", Self::VT_UNIT, false)?
3761            .finish();
3762        Ok(())
3763    }
3764}
3765pub struct IntervalArgs {
3766    pub unit: IntervalUnit,
3767}
3768impl<'a> Default for IntervalArgs {
3769    #[inline]
3770    fn default() -> Self {
3771        IntervalArgs {
3772            unit: IntervalUnit::YEAR_MONTH,
3773        }
3774    }
3775}
3776
3777pub struct IntervalBuilder<'a: 'b, 'b> {
3778    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
3779    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3780}
3781impl<'a: 'b, 'b> IntervalBuilder<'a, 'b> {
3782    #[inline]
3783    pub fn add_unit(&mut self, unit: IntervalUnit) {
3784        self.fbb_
3785            .push_slot::<IntervalUnit>(Interval::VT_UNIT, unit, IntervalUnit::YEAR_MONTH);
3786    }
3787    #[inline]
3788    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> IntervalBuilder<'a, 'b> {
3789        let start = _fbb.start_table();
3790        IntervalBuilder {
3791            fbb_: _fbb,
3792            start_: start,
3793        }
3794    }
3795    #[inline]
3796    pub fn finish(self) -> flatbuffers::WIPOffset<Interval<'a>> {
3797        let o = self.fbb_.end_table(self.start_);
3798        flatbuffers::WIPOffset::new(o.value())
3799    }
3800}
3801
3802impl core::fmt::Debug for Interval<'_> {
3803    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3804        let mut ds = f.debug_struct("Interval");
3805        ds.field("unit", &self.unit());
3806        ds.finish()
3807    }
3808}
3809pub enum DurationOffset {}
3810#[derive(Copy, Clone, PartialEq)]
3811
3812pub struct Duration<'a> {
3813    pub _tab: flatbuffers::Table<'a>,
3814}
3815
3816impl<'a> flatbuffers::Follow<'a> for Duration<'a> {
3817    type Inner = Duration<'a>;
3818    #[inline]
3819    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3820        Self {
3821            _tab: flatbuffers::Table::new(buf, loc),
3822        }
3823    }
3824}
3825
3826impl<'a> Duration<'a> {
3827    pub const VT_UNIT: flatbuffers::VOffsetT = 4;
3828
3829    #[inline]
3830    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3831        Duration { _tab: table }
3832    }
3833    #[allow(unused_mut)]
3834    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3835        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3836        args: &'args DurationArgs,
3837    ) -> flatbuffers::WIPOffset<Duration<'bldr>> {
3838        let mut builder = DurationBuilder::new(_fbb);
3839        builder.add_unit(args.unit);
3840        builder.finish()
3841    }
3842
3843    #[inline]
3844    pub fn unit(&self) -> TimeUnit {
3845        // Safety:
3846        // Created from valid Table for this object
3847        // which contains a valid value in this slot
3848        unsafe {
3849            self._tab
3850                .get::<TimeUnit>(Duration::VT_UNIT, Some(TimeUnit::MILLISECOND))
3851                .unwrap()
3852        }
3853    }
3854}
3855
3856impl flatbuffers::Verifiable for Duration<'_> {
3857    #[inline]
3858    fn run_verifier(
3859        v: &mut flatbuffers::Verifier,
3860        pos: usize,
3861    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3862        use flatbuffers::Verifiable;
3863        v.visit_table(pos)?
3864            .visit_field::<TimeUnit>("unit", Self::VT_UNIT, false)?
3865            .finish();
3866        Ok(())
3867    }
3868}
3869pub struct DurationArgs {
3870    pub unit: TimeUnit,
3871}
3872impl<'a> Default for DurationArgs {
3873    #[inline]
3874    fn default() -> Self {
3875        DurationArgs {
3876            unit: TimeUnit::MILLISECOND,
3877        }
3878    }
3879}
3880
3881pub struct DurationBuilder<'a: 'b, 'b> {
3882    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
3883    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
3884}
3885impl<'a: 'b, 'b> DurationBuilder<'a, 'b> {
3886    #[inline]
3887    pub fn add_unit(&mut self, unit: TimeUnit) {
3888        self.fbb_
3889            .push_slot::<TimeUnit>(Duration::VT_UNIT, unit, TimeUnit::MILLISECOND);
3890    }
3891    #[inline]
3892    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> DurationBuilder<'a, 'b> {
3893        let start = _fbb.start_table();
3894        DurationBuilder {
3895            fbb_: _fbb,
3896            start_: start,
3897        }
3898    }
3899    #[inline]
3900    pub fn finish(self) -> flatbuffers::WIPOffset<Duration<'a>> {
3901        let o = self.fbb_.end_table(self.start_);
3902        flatbuffers::WIPOffset::new(o.value())
3903    }
3904}
3905
3906impl core::fmt::Debug for Duration<'_> {
3907    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
3908        let mut ds = f.debug_struct("Duration");
3909        ds.field("unit", &self.unit());
3910        ds.finish()
3911    }
3912}
3913pub enum KeyValueOffset {}
3914#[derive(Copy, Clone, PartialEq)]
3915
3916/// ----------------------------------------------------------------------
3917/// user defined key value pairs to add custom metadata to arrow
3918/// key namespacing is the responsibility of the user
3919pub struct KeyValue<'a> {
3920    pub _tab: flatbuffers::Table<'a>,
3921}
3922
3923impl<'a> flatbuffers::Follow<'a> for KeyValue<'a> {
3924    type Inner = KeyValue<'a>;
3925    #[inline]
3926    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
3927        Self {
3928            _tab: flatbuffers::Table::new(buf, loc),
3929        }
3930    }
3931}
3932
3933impl<'a> KeyValue<'a> {
3934    pub const VT_KEY: flatbuffers::VOffsetT = 4;
3935    pub const VT_VALUE: flatbuffers::VOffsetT = 6;
3936
3937    #[inline]
3938    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
3939        KeyValue { _tab: table }
3940    }
3941    #[allow(unused_mut)]
3942    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
3943        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
3944        args: &'args KeyValueArgs<'args>,
3945    ) -> flatbuffers::WIPOffset<KeyValue<'bldr>> {
3946        let mut builder = KeyValueBuilder::new(_fbb);
3947        if let Some(x) = args.value {
3948            builder.add_value(x);
3949        }
3950        if let Some(x) = args.key {
3951            builder.add_key(x);
3952        }
3953        builder.finish()
3954    }
3955
3956    #[inline]
3957    pub fn key(&self) -> Option<&'a str> {
3958        // Safety:
3959        // Created from valid Table for this object
3960        // which contains a valid value in this slot
3961        unsafe {
3962            self._tab
3963                .get::<flatbuffers::ForwardsUOffset<&str>>(KeyValue::VT_KEY, None)
3964        }
3965    }
3966    #[inline]
3967    pub fn value(&self) -> Option<&'a str> {
3968        // Safety:
3969        // Created from valid Table for this object
3970        // which contains a valid value in this slot
3971        unsafe {
3972            self._tab
3973                .get::<flatbuffers::ForwardsUOffset<&str>>(KeyValue::VT_VALUE, None)
3974        }
3975    }
3976}
3977
3978impl flatbuffers::Verifiable for KeyValue<'_> {
3979    #[inline]
3980    fn run_verifier(
3981        v: &mut flatbuffers::Verifier,
3982        pos: usize,
3983    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
3984        use flatbuffers::Verifiable;
3985        v.visit_table(pos)?
3986            .visit_field::<flatbuffers::ForwardsUOffset<&str>>("key", Self::VT_KEY, false)?
3987            .visit_field::<flatbuffers::ForwardsUOffset<&str>>("value", Self::VT_VALUE, false)?
3988            .finish();
3989        Ok(())
3990    }
3991}
3992pub struct KeyValueArgs<'a> {
3993    pub key: Option<flatbuffers::WIPOffset<&'a str>>,
3994    pub value: Option<flatbuffers::WIPOffset<&'a str>>,
3995}
3996impl<'a> Default for KeyValueArgs<'a> {
3997    #[inline]
3998    fn default() -> Self {
3999        KeyValueArgs {
4000            key: None,
4001            value: None,
4002        }
4003    }
4004}
4005
4006pub struct KeyValueBuilder<'a: 'b, 'b> {
4007    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
4008    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4009}
4010impl<'a: 'b, 'b> KeyValueBuilder<'a, 'b> {
4011    #[inline]
4012    pub fn add_key(&mut self, key: flatbuffers::WIPOffset<&'b str>) {
4013        self.fbb_
4014            .push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_KEY, key);
4015    }
4016    #[inline]
4017    pub fn add_value(&mut self, value: flatbuffers::WIPOffset<&'b str>) {
4018        self.fbb_
4019            .push_slot_always::<flatbuffers::WIPOffset<_>>(KeyValue::VT_VALUE, value);
4020    }
4021    #[inline]
4022    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> KeyValueBuilder<'a, 'b> {
4023        let start = _fbb.start_table();
4024        KeyValueBuilder {
4025            fbb_: _fbb,
4026            start_: start,
4027        }
4028    }
4029    #[inline]
4030    pub fn finish(self) -> flatbuffers::WIPOffset<KeyValue<'a>> {
4031        let o = self.fbb_.end_table(self.start_);
4032        flatbuffers::WIPOffset::new(o.value())
4033    }
4034}
4035
4036impl core::fmt::Debug for KeyValue<'_> {
4037    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4038        let mut ds = f.debug_struct("KeyValue");
4039        ds.field("key", &self.key());
4040        ds.field("value", &self.value());
4041        ds.finish()
4042    }
4043}
4044pub enum DictionaryEncodingOffset {}
4045#[derive(Copy, Clone, PartialEq)]
4046
4047pub struct DictionaryEncoding<'a> {
4048    pub _tab: flatbuffers::Table<'a>,
4049}
4050
4051impl<'a> flatbuffers::Follow<'a> for DictionaryEncoding<'a> {
4052    type Inner = DictionaryEncoding<'a>;
4053    #[inline]
4054    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4055        Self {
4056            _tab: flatbuffers::Table::new(buf, loc),
4057        }
4058    }
4059}
4060
4061impl<'a> DictionaryEncoding<'a> {
4062    pub const VT_ID: flatbuffers::VOffsetT = 4;
4063    pub const VT_INDEXTYPE: flatbuffers::VOffsetT = 6;
4064    pub const VT_ISORDERED: flatbuffers::VOffsetT = 8;
4065    pub const VT_DICTIONARYKIND: flatbuffers::VOffsetT = 10;
4066
4067    #[inline]
4068    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4069        DictionaryEncoding { _tab: table }
4070    }
4071    #[allow(unused_mut)]
4072    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
4073        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
4074        args: &'args DictionaryEncodingArgs<'args>,
4075    ) -> flatbuffers::WIPOffset<DictionaryEncoding<'bldr>> {
4076        let mut builder = DictionaryEncodingBuilder::new(_fbb);
4077        builder.add_id(args.id);
4078        if let Some(x) = args.indexType {
4079            builder.add_indexType(x);
4080        }
4081        builder.add_dictionaryKind(args.dictionaryKind);
4082        builder.add_isOrdered(args.isOrdered);
4083        builder.finish()
4084    }
4085
4086    /// The known dictionary id in the application where this data is used. In
4087    /// the file or streaming formats, the dictionary ids are found in the
4088    /// DictionaryBatch messages
4089    #[inline]
4090    pub fn id(&self) -> i64 {
4091        // Safety:
4092        // Created from valid Table for this object
4093        // which contains a valid value in this slot
4094        unsafe {
4095            self._tab
4096                .get::<i64>(DictionaryEncoding::VT_ID, Some(0))
4097                .unwrap()
4098        }
4099    }
4100    /// The dictionary indices are constrained to be non-negative integers. If
4101    /// this field is null, the indices must be signed int32. To maximize
4102    /// cross-language compatibility and performance, implementations are
4103    /// recommended to prefer signed integer types over unsigned integer types
4104    /// and to avoid uint64 indices unless they are required by an application.
4105    #[inline]
4106    pub fn indexType(&self) -> Option<Int<'a>> {
4107        // Safety:
4108        // Created from valid Table for this object
4109        // which contains a valid value in this slot
4110        unsafe {
4111            self._tab
4112                .get::<flatbuffers::ForwardsUOffset<Int>>(DictionaryEncoding::VT_INDEXTYPE, None)
4113        }
4114    }
4115    /// By default, dictionaries are not ordered, or the order does not have
4116    /// semantic meaning. In some statistical, applications, dictionary-encoding
4117    /// is used to represent ordered categorical data, and we provide a way to
4118    /// preserve that metadata here
4119    #[inline]
4120    pub fn isOrdered(&self) -> bool {
4121        // Safety:
4122        // Created from valid Table for this object
4123        // which contains a valid value in this slot
4124        unsafe {
4125            self._tab
4126                .get::<bool>(DictionaryEncoding::VT_ISORDERED, Some(false))
4127                .unwrap()
4128        }
4129    }
4130    #[inline]
4131    pub fn dictionaryKind(&self) -> DictionaryKind {
4132        // Safety:
4133        // Created from valid Table for this object
4134        // which contains a valid value in this slot
4135        unsafe {
4136            self._tab
4137                .get::<DictionaryKind>(
4138                    DictionaryEncoding::VT_DICTIONARYKIND,
4139                    Some(DictionaryKind::DenseArray),
4140                )
4141                .unwrap()
4142        }
4143    }
4144}
4145
4146impl flatbuffers::Verifiable for DictionaryEncoding<'_> {
4147    #[inline]
4148    fn run_verifier(
4149        v: &mut flatbuffers::Verifier,
4150        pos: usize,
4151    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4152        use flatbuffers::Verifiable;
4153        v.visit_table(pos)?
4154            .visit_field::<i64>("id", Self::VT_ID, false)?
4155            .visit_field::<flatbuffers::ForwardsUOffset<Int>>(
4156                "indexType",
4157                Self::VT_INDEXTYPE,
4158                false,
4159            )?
4160            .visit_field::<bool>("isOrdered", Self::VT_ISORDERED, false)?
4161            .visit_field::<DictionaryKind>("dictionaryKind", Self::VT_DICTIONARYKIND, false)?
4162            .finish();
4163        Ok(())
4164    }
4165}
4166pub struct DictionaryEncodingArgs<'a> {
4167    pub id: i64,
4168    pub indexType: Option<flatbuffers::WIPOffset<Int<'a>>>,
4169    pub isOrdered: bool,
4170    pub dictionaryKind: DictionaryKind,
4171}
4172impl<'a> Default for DictionaryEncodingArgs<'a> {
4173    #[inline]
4174    fn default() -> Self {
4175        DictionaryEncodingArgs {
4176            id: 0,
4177            indexType: None,
4178            isOrdered: false,
4179            dictionaryKind: DictionaryKind::DenseArray,
4180        }
4181    }
4182}
4183
4184pub struct DictionaryEncodingBuilder<'a: 'b, 'b> {
4185    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
4186    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4187}
4188impl<'a: 'b, 'b> DictionaryEncodingBuilder<'a, 'b> {
4189    #[inline]
4190    pub fn add_id(&mut self, id: i64) {
4191        self.fbb_.push_slot::<i64>(DictionaryEncoding::VT_ID, id, 0);
4192    }
4193    #[inline]
4194    pub fn add_indexType(&mut self, indexType: flatbuffers::WIPOffset<Int<'b>>) {
4195        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Int>>(
4196            DictionaryEncoding::VT_INDEXTYPE,
4197            indexType,
4198        );
4199    }
4200    #[inline]
4201    pub fn add_isOrdered(&mut self, isOrdered: bool) {
4202        self.fbb_
4203            .push_slot::<bool>(DictionaryEncoding::VT_ISORDERED, isOrdered, false);
4204    }
4205    #[inline]
4206    pub fn add_dictionaryKind(&mut self, dictionaryKind: DictionaryKind) {
4207        self.fbb_.push_slot::<DictionaryKind>(
4208            DictionaryEncoding::VT_DICTIONARYKIND,
4209            dictionaryKind,
4210            DictionaryKind::DenseArray,
4211        );
4212    }
4213    #[inline]
4214    pub fn new(
4215        _fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
4216    ) -> DictionaryEncodingBuilder<'a, 'b> {
4217        let start = _fbb.start_table();
4218        DictionaryEncodingBuilder {
4219            fbb_: _fbb,
4220            start_: start,
4221        }
4222    }
4223    #[inline]
4224    pub fn finish(self) -> flatbuffers::WIPOffset<DictionaryEncoding<'a>> {
4225        let o = self.fbb_.end_table(self.start_);
4226        flatbuffers::WIPOffset::new(o.value())
4227    }
4228}
4229
4230impl core::fmt::Debug for DictionaryEncoding<'_> {
4231    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
4232        let mut ds = f.debug_struct("DictionaryEncoding");
4233        ds.field("id", &self.id());
4234        ds.field("indexType", &self.indexType());
4235        ds.field("isOrdered", &self.isOrdered());
4236        ds.field("dictionaryKind", &self.dictionaryKind());
4237        ds.finish()
4238    }
4239}
4240pub enum FieldOffset {}
4241#[derive(Copy, Clone, PartialEq)]
4242
4243/// ----------------------------------------------------------------------
4244/// A field represents a named column in a record / row batch or child of a
4245/// nested type.
4246pub struct Field<'a> {
4247    pub _tab: flatbuffers::Table<'a>,
4248}
4249
4250impl<'a> flatbuffers::Follow<'a> for Field<'a> {
4251    type Inner = Field<'a>;
4252    #[inline]
4253    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
4254        Self {
4255            _tab: flatbuffers::Table::new(buf, loc),
4256        }
4257    }
4258}
4259
4260impl<'a> Field<'a> {
4261    pub const VT_NAME: flatbuffers::VOffsetT = 4;
4262    pub const VT_NULLABLE: flatbuffers::VOffsetT = 6;
4263    pub const VT_TYPE_TYPE: flatbuffers::VOffsetT = 8;
4264    pub const VT_TYPE_: flatbuffers::VOffsetT = 10;
4265    pub const VT_DICTIONARY: flatbuffers::VOffsetT = 12;
4266    pub const VT_CHILDREN: flatbuffers::VOffsetT = 14;
4267    pub const VT_CUSTOM_METADATA: flatbuffers::VOffsetT = 16;
4268
4269    #[inline]
4270    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
4271        Field { _tab: table }
4272    }
4273    #[allow(unused_mut)]
4274    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
4275        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
4276        args: &'args FieldArgs<'args>,
4277    ) -> flatbuffers::WIPOffset<Field<'bldr>> {
4278        let mut builder = FieldBuilder::new(_fbb);
4279        if let Some(x) = args.custom_metadata {
4280            builder.add_custom_metadata(x);
4281        }
4282        if let Some(x) = args.children {
4283            builder.add_children(x);
4284        }
4285        if let Some(x) = args.dictionary {
4286            builder.add_dictionary(x);
4287        }
4288        if let Some(x) = args.type_ {
4289            builder.add_type_(x);
4290        }
4291        if let Some(x) = args.name {
4292            builder.add_name(x);
4293        }
4294        builder.add_type_type(args.type_type);
4295        builder.add_nullable(args.nullable);
4296        builder.finish()
4297    }
4298
4299    /// Name is not required, in i.e. a List
4300    #[inline]
4301    pub fn name(&self) -> Option<&'a str> {
4302        // Safety:
4303        // Created from valid Table for this object
4304        // which contains a valid value in this slot
4305        unsafe {
4306            self._tab
4307                .get::<flatbuffers::ForwardsUOffset<&str>>(Field::VT_NAME, None)
4308        }
4309    }
4310    /// Whether or not this field can contain nulls. Should be true in general.
4311    #[inline]
4312    pub fn nullable(&self) -> bool {
4313        // Safety:
4314        // Created from valid Table for this object
4315        // which contains a valid value in this slot
4316        unsafe {
4317            self._tab
4318                .get::<bool>(Field::VT_NULLABLE, Some(false))
4319                .unwrap()
4320        }
4321    }
4322    #[inline]
4323    pub fn type_type(&self) -> Type {
4324        // Safety:
4325        // Created from valid Table for this object
4326        // which contains a valid value in this slot
4327        unsafe {
4328            self._tab
4329                .get::<Type>(Field::VT_TYPE_TYPE, Some(Type::NONE))
4330                .unwrap()
4331        }
4332    }
4333    /// This is the type of the decoded value if the field is dictionary encoded.
4334    #[inline]
4335    pub fn type_(&self) -> Option<flatbuffers::Table<'a>> {
4336        // Safety:
4337        // Created from valid Table for this object
4338        // which contains a valid value in this slot
4339        unsafe {
4340            self._tab
4341                .get::<flatbuffers::ForwardsUOffset<flatbuffers::Table<'a>>>(Field::VT_TYPE_, None)
4342        }
4343    }
4344    /// Present only if the field is dictionary encoded.
4345    #[inline]
4346    pub fn dictionary(&self) -> Option<DictionaryEncoding<'a>> {
4347        // Safety:
4348        // Created from valid Table for this object
4349        // which contains a valid value in this slot
4350        unsafe {
4351            self._tab
4352                .get::<flatbuffers::ForwardsUOffset<DictionaryEncoding>>(Field::VT_DICTIONARY, None)
4353        }
4354    }
4355    /// children apply only to nested data types like Struct, List and Union. For
4356    /// primitive types children will have length 0.
4357    #[inline]
4358    pub fn children(
4359        &self,
4360    ) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field<'a>>>> {
4361        // Safety:
4362        // Created from valid Table for this object
4363        // which contains a valid value in this slot
4364        unsafe {
4365            self._tab.get::<flatbuffers::ForwardsUOffset<
4366                flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field>>,
4367            >>(Field::VT_CHILDREN, None)
4368        }
4369    }
4370    /// User-defined metadata
4371    #[inline]
4372    pub fn custom_metadata(
4373        &self,
4374    ) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
4375        // Safety:
4376        // Created from valid Table for this object
4377        // which contains a valid value in this slot
4378        unsafe {
4379            self._tab.get::<flatbuffers::ForwardsUOffset<
4380                flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>,
4381            >>(Field::VT_CUSTOM_METADATA, None)
4382        }
4383    }
4384    #[inline]
4385    #[allow(non_snake_case)]
4386    pub fn type_as_null(&self) -> Option<Null<'a>> {
4387        if self.type_type() == Type::Null {
4388            self.type_().map(|t| {
4389                // Safety:
4390                // Created from a valid Table for this object
4391                // Which contains a valid union in this slot
4392                unsafe { Null::init_from_table(t) }
4393            })
4394        } else {
4395            None
4396        }
4397    }
4398
4399    #[inline]
4400    #[allow(non_snake_case)]
4401    pub fn type_as_int(&self) -> Option<Int<'a>> {
4402        if self.type_type() == Type::Int {
4403            self.type_().map(|t| {
4404                // Safety:
4405                // Created from a valid Table for this object
4406                // Which contains a valid union in this slot
4407                unsafe { Int::init_from_table(t) }
4408            })
4409        } else {
4410            None
4411        }
4412    }
4413
4414    #[inline]
4415    #[allow(non_snake_case)]
4416    pub fn type_as_floating_point(&self) -> Option<FloatingPoint<'a>> {
4417        if self.type_type() == Type::FloatingPoint {
4418            self.type_().map(|t| {
4419                // Safety:
4420                // Created from a valid Table for this object
4421                // Which contains a valid union in this slot
4422                unsafe { FloatingPoint::init_from_table(t) }
4423            })
4424        } else {
4425            None
4426        }
4427    }
4428
4429    #[inline]
4430    #[allow(non_snake_case)]
4431    pub fn type_as_binary(&self) -> Option<Binary<'a>> {
4432        if self.type_type() == Type::Binary {
4433            self.type_().map(|t| {
4434                // Safety:
4435                // Created from a valid Table for this object
4436                // Which contains a valid union in this slot
4437                unsafe { Binary::init_from_table(t) }
4438            })
4439        } else {
4440            None
4441        }
4442    }
4443
4444    #[inline]
4445    #[allow(non_snake_case)]
4446    pub fn type_as_utf_8(&self) -> Option<Utf8<'a>> {
4447        if self.type_type() == Type::Utf8 {
4448            self.type_().map(|t| {
4449                // Safety:
4450                // Created from a valid Table for this object
4451                // Which contains a valid union in this slot
4452                unsafe { Utf8::init_from_table(t) }
4453            })
4454        } else {
4455            None
4456        }
4457    }
4458
4459    #[inline]
4460    #[allow(non_snake_case)]
4461    pub fn type_as_bool(&self) -> Option<Bool<'a>> {
4462        if self.type_type() == Type::Bool {
4463            self.type_().map(|t| {
4464                // Safety:
4465                // Created from a valid Table for this object
4466                // Which contains a valid union in this slot
4467                unsafe { Bool::init_from_table(t) }
4468            })
4469        } else {
4470            None
4471        }
4472    }
4473
4474    #[inline]
4475    #[allow(non_snake_case)]
4476    pub fn type_as_decimal(&self) -> Option<Decimal<'a>> {
4477        if self.type_type() == Type::Decimal {
4478            self.type_().map(|t| {
4479                // Safety:
4480                // Created from a valid Table for this object
4481                // Which contains a valid union in this slot
4482                unsafe { Decimal::init_from_table(t) }
4483            })
4484        } else {
4485            None
4486        }
4487    }
4488
4489    #[inline]
4490    #[allow(non_snake_case)]
4491    pub fn type_as_date(&self) -> Option<Date<'a>> {
4492        if self.type_type() == Type::Date {
4493            self.type_().map(|t| {
4494                // Safety:
4495                // Created from a valid Table for this object
4496                // Which contains a valid union in this slot
4497                unsafe { Date::init_from_table(t) }
4498            })
4499        } else {
4500            None
4501        }
4502    }
4503
4504    #[inline]
4505    #[allow(non_snake_case)]
4506    pub fn type_as_time(&self) -> Option<Time<'a>> {
4507        if self.type_type() == Type::Time {
4508            self.type_().map(|t| {
4509                // Safety:
4510                // Created from a valid Table for this object
4511                // Which contains a valid union in this slot
4512                unsafe { Time::init_from_table(t) }
4513            })
4514        } else {
4515            None
4516        }
4517    }
4518
4519    #[inline]
4520    #[allow(non_snake_case)]
4521    pub fn type_as_timestamp(&self) -> Option<Timestamp<'a>> {
4522        if self.type_type() == Type::Timestamp {
4523            self.type_().map(|t| {
4524                // Safety:
4525                // Created from a valid Table for this object
4526                // Which contains a valid union in this slot
4527                unsafe { Timestamp::init_from_table(t) }
4528            })
4529        } else {
4530            None
4531        }
4532    }
4533
4534    #[inline]
4535    #[allow(non_snake_case)]
4536    pub fn type_as_interval(&self) -> Option<Interval<'a>> {
4537        if self.type_type() == Type::Interval {
4538            self.type_().map(|t| {
4539                // Safety:
4540                // Created from a valid Table for this object
4541                // Which contains a valid union in this slot
4542                unsafe { Interval::init_from_table(t) }
4543            })
4544        } else {
4545            None
4546        }
4547    }
4548
4549    #[inline]
4550    #[allow(non_snake_case)]
4551    pub fn type_as_list(&self) -> Option<List<'a>> {
4552        if self.type_type() == Type::List {
4553            self.type_().map(|t| {
4554                // Safety:
4555                // Created from a valid Table for this object
4556                // Which contains a valid union in this slot
4557                unsafe { List::init_from_table(t) }
4558            })
4559        } else {
4560            None
4561        }
4562    }
4563
4564    #[inline]
4565    #[allow(non_snake_case)]
4566    pub fn type_as_struct_(&self) -> Option<Struct_<'a>> {
4567        if self.type_type() == Type::Struct_ {
4568            self.type_().map(|t| {
4569                // Safety:
4570                // Created from a valid Table for this object
4571                // Which contains a valid union in this slot
4572                unsafe { Struct_::init_from_table(t) }
4573            })
4574        } else {
4575            None
4576        }
4577    }
4578
4579    #[inline]
4580    #[allow(non_snake_case)]
4581    pub fn type_as_union(&self) -> Option<Union<'a>> {
4582        if self.type_type() == Type::Union {
4583            self.type_().map(|t| {
4584                // Safety:
4585                // Created from a valid Table for this object
4586                // Which contains a valid union in this slot
4587                unsafe { Union::init_from_table(t) }
4588            })
4589        } else {
4590            None
4591        }
4592    }
4593
4594    #[inline]
4595    #[allow(non_snake_case)]
4596    pub fn type_as_fixed_size_binary(&self) -> Option<FixedSizeBinary<'a>> {
4597        if self.type_type() == Type::FixedSizeBinary {
4598            self.type_().map(|t| {
4599                // Safety:
4600                // Created from a valid Table for this object
4601                // Which contains a valid union in this slot
4602                unsafe { FixedSizeBinary::init_from_table(t) }
4603            })
4604        } else {
4605            None
4606        }
4607    }
4608
4609    #[inline]
4610    #[allow(non_snake_case)]
4611    pub fn type_as_fixed_size_list(&self) -> Option<FixedSizeList<'a>> {
4612        if self.type_type() == Type::FixedSizeList {
4613            self.type_().map(|t| {
4614                // Safety:
4615                // Created from a valid Table for this object
4616                // Which contains a valid union in this slot
4617                unsafe { FixedSizeList::init_from_table(t) }
4618            })
4619        } else {
4620            None
4621        }
4622    }
4623
4624    #[inline]
4625    #[allow(non_snake_case)]
4626    pub fn type_as_map(&self) -> Option<Map<'a>> {
4627        if self.type_type() == Type::Map {
4628            self.type_().map(|t| {
4629                // Safety:
4630                // Created from a valid Table for this object
4631                // Which contains a valid union in this slot
4632                unsafe { Map::init_from_table(t) }
4633            })
4634        } else {
4635            None
4636        }
4637    }
4638
4639    #[inline]
4640    #[allow(non_snake_case)]
4641    pub fn type_as_duration(&self) -> Option<Duration<'a>> {
4642        if self.type_type() == Type::Duration {
4643            self.type_().map(|t| {
4644                // Safety:
4645                // Created from a valid Table for this object
4646                // Which contains a valid union in this slot
4647                unsafe { Duration::init_from_table(t) }
4648            })
4649        } else {
4650            None
4651        }
4652    }
4653
4654    #[inline]
4655    #[allow(non_snake_case)]
4656    pub fn type_as_large_binary(&self) -> Option<LargeBinary<'a>> {
4657        if self.type_type() == Type::LargeBinary {
4658            self.type_().map(|t| {
4659                // Safety:
4660                // Created from a valid Table for this object
4661                // Which contains a valid union in this slot
4662                unsafe { LargeBinary::init_from_table(t) }
4663            })
4664        } else {
4665            None
4666        }
4667    }
4668
4669    #[inline]
4670    #[allow(non_snake_case)]
4671    pub fn type_as_large_utf_8(&self) -> Option<LargeUtf8<'a>> {
4672        if self.type_type() == Type::LargeUtf8 {
4673            self.type_().map(|t| {
4674                // Safety:
4675                // Created from a valid Table for this object
4676                // Which contains a valid union in this slot
4677                unsafe { LargeUtf8::init_from_table(t) }
4678            })
4679        } else {
4680            None
4681        }
4682    }
4683
4684    #[inline]
4685    #[allow(non_snake_case)]
4686    pub fn type_as_large_list(&self) -> Option<LargeList<'a>> {
4687        if self.type_type() == Type::LargeList {
4688            self.type_().map(|t| {
4689                // Safety:
4690                // Created from a valid Table for this object
4691                // Which contains a valid union in this slot
4692                unsafe { LargeList::init_from_table(t) }
4693            })
4694        } else {
4695            None
4696        }
4697    }
4698
4699    #[inline]
4700    #[allow(non_snake_case)]
4701    pub fn type_as_run_end_encoded(&self) -> Option<RunEndEncoded<'a>> {
4702        if self.type_type() == Type::RunEndEncoded {
4703            self.type_().map(|t| {
4704                // Safety:
4705                // Created from a valid Table for this object
4706                // Which contains a valid union in this slot
4707                unsafe { RunEndEncoded::init_from_table(t) }
4708            })
4709        } else {
4710            None
4711        }
4712    }
4713
4714    #[inline]
4715    #[allow(non_snake_case)]
4716    pub fn type_as_binary_view(&self) -> Option<BinaryView<'a>> {
4717        if self.type_type() == Type::BinaryView {
4718            self.type_().map(|t| {
4719                // Safety:
4720                // Created from a valid Table for this object
4721                // Which contains a valid union in this slot
4722                unsafe { BinaryView::init_from_table(t) }
4723            })
4724        } else {
4725            None
4726        }
4727    }
4728
4729    #[inline]
4730    #[allow(non_snake_case)]
4731    pub fn type_as_utf_8_view(&self) -> Option<Utf8View<'a>> {
4732        if self.type_type() == Type::Utf8View {
4733            self.type_().map(|t| {
4734                // Safety:
4735                // Created from a valid Table for this object
4736                // Which contains a valid union in this slot
4737                unsafe { Utf8View::init_from_table(t) }
4738            })
4739        } else {
4740            None
4741        }
4742    }
4743
4744    #[inline]
4745    #[allow(non_snake_case)]
4746    pub fn type_as_list_view(&self) -> Option<ListView<'a>> {
4747        if self.type_type() == Type::ListView {
4748            self.type_().map(|t| {
4749                // Safety:
4750                // Created from a valid Table for this object
4751                // Which contains a valid union in this slot
4752                unsafe { ListView::init_from_table(t) }
4753            })
4754        } else {
4755            None
4756        }
4757    }
4758
4759    #[inline]
4760    #[allow(non_snake_case)]
4761    pub fn type_as_large_list_view(&self) -> Option<LargeListView<'a>> {
4762        if self.type_type() == Type::LargeListView {
4763            self.type_().map(|t| {
4764                // Safety:
4765                // Created from a valid Table for this object
4766                // Which contains a valid union in this slot
4767                unsafe { LargeListView::init_from_table(t) }
4768            })
4769        } else {
4770            None
4771        }
4772    }
4773}
4774
4775impl flatbuffers::Verifiable for Field<'_> {
4776    #[inline]
4777    fn run_verifier(
4778        v: &mut flatbuffers::Verifier,
4779        pos: usize,
4780    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
4781        use flatbuffers::Verifiable;
4782        v.visit_table(pos)?
4783            .visit_field::<flatbuffers::ForwardsUOffset<&str>>("name", Self::VT_NAME, false)?
4784            .visit_field::<bool>("nullable", Self::VT_NULLABLE, false)?
4785            .visit_union::<Type, _>(
4786                "type_type",
4787                Self::VT_TYPE_TYPE,
4788                "type_",
4789                Self::VT_TYPE_,
4790                false,
4791                |key, v, pos| match key {
4792                    Type::Null => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Null>>(
4793                        "Type::Null",
4794                        pos,
4795                    ),
4796                    Type::Int => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Int>>(
4797                        "Type::Int",
4798                        pos,
4799                    ),
4800                    Type::FloatingPoint => v
4801                        .verify_union_variant::<flatbuffers::ForwardsUOffset<FloatingPoint>>(
4802                            "Type::FloatingPoint",
4803                            pos,
4804                        ),
4805                    Type::Binary => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Binary>>(
4806                        "Type::Binary",
4807                        pos,
4808                    ),
4809                    Type::Utf8 => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Utf8>>(
4810                        "Type::Utf8",
4811                        pos,
4812                    ),
4813                    Type::Bool => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Bool>>(
4814                        "Type::Bool",
4815                        pos,
4816                    ),
4817                    Type::Decimal => v
4818                        .verify_union_variant::<flatbuffers::ForwardsUOffset<Decimal>>(
4819                            "Type::Decimal",
4820                            pos,
4821                        ),
4822                    Type::Date => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Date>>(
4823                        "Type::Date",
4824                        pos,
4825                    ),
4826                    Type::Time => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Time>>(
4827                        "Type::Time",
4828                        pos,
4829                    ),
4830                    Type::Timestamp => v
4831                        .verify_union_variant::<flatbuffers::ForwardsUOffset<Timestamp>>(
4832                            "Type::Timestamp",
4833                            pos,
4834                        ),
4835                    Type::Interval => v
4836                        .verify_union_variant::<flatbuffers::ForwardsUOffset<Interval>>(
4837                            "Type::Interval",
4838                            pos,
4839                        ),
4840                    Type::List => v.verify_union_variant::<flatbuffers::ForwardsUOffset<List>>(
4841                        "Type::List",
4842                        pos,
4843                    ),
4844                    Type::Struct_ => v
4845                        .verify_union_variant::<flatbuffers::ForwardsUOffset<Struct_>>(
4846                            "Type::Struct_",
4847                            pos,
4848                        ),
4849                    Type::Union => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Union>>(
4850                        "Type::Union",
4851                        pos,
4852                    ),
4853                    Type::FixedSizeBinary => v
4854                        .verify_union_variant::<flatbuffers::ForwardsUOffset<FixedSizeBinary>>(
4855                            "Type::FixedSizeBinary",
4856                            pos,
4857                        ),
4858                    Type::FixedSizeList => v
4859                        .verify_union_variant::<flatbuffers::ForwardsUOffset<FixedSizeList>>(
4860                            "Type::FixedSizeList",
4861                            pos,
4862                        ),
4863                    Type::Map => v.verify_union_variant::<flatbuffers::ForwardsUOffset<Map>>(
4864                        "Type::Map",
4865                        pos,
4866                    ),
4867                    Type::Duration => v
4868                        .verify_union_variant::<flatbuffers::ForwardsUOffset<Duration>>(
4869                            "Type::Duration",
4870                            pos,
4871                        ),
4872                    Type::LargeBinary => v
4873                        .verify_union_variant::<flatbuffers::ForwardsUOffset<LargeBinary>>(
4874                            "Type::LargeBinary",
4875                            pos,
4876                        ),
4877                    Type::LargeUtf8 => v
4878                        .verify_union_variant::<flatbuffers::ForwardsUOffset<LargeUtf8>>(
4879                            "Type::LargeUtf8",
4880                            pos,
4881                        ),
4882                    Type::LargeList => v
4883                        .verify_union_variant::<flatbuffers::ForwardsUOffset<LargeList>>(
4884                            "Type::LargeList",
4885                            pos,
4886                        ),
4887                    Type::RunEndEncoded => v
4888                        .verify_union_variant::<flatbuffers::ForwardsUOffset<RunEndEncoded>>(
4889                            "Type::RunEndEncoded",
4890                            pos,
4891                        ),
4892                    Type::BinaryView => v
4893                        .verify_union_variant::<flatbuffers::ForwardsUOffset<BinaryView>>(
4894                            "Type::BinaryView",
4895                            pos,
4896                        ),
4897                    Type::Utf8View => v
4898                        .verify_union_variant::<flatbuffers::ForwardsUOffset<Utf8View>>(
4899                            "Type::Utf8View",
4900                            pos,
4901                        ),
4902                    Type::ListView => v
4903                        .verify_union_variant::<flatbuffers::ForwardsUOffset<ListView>>(
4904                            "Type::ListView",
4905                            pos,
4906                        ),
4907                    Type::LargeListView => v
4908                        .verify_union_variant::<flatbuffers::ForwardsUOffset<LargeListView>>(
4909                            "Type::LargeListView",
4910                            pos,
4911                        ),
4912                    _ => Ok(()),
4913                },
4914            )?
4915            .visit_field::<flatbuffers::ForwardsUOffset<DictionaryEncoding>>(
4916                "dictionary",
4917                Self::VT_DICTIONARY,
4918                false,
4919            )?
4920            .visit_field::<flatbuffers::ForwardsUOffset<
4921                flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Field>>,
4922            >>("children", Self::VT_CHILDREN, false)?
4923            .visit_field::<flatbuffers::ForwardsUOffset<
4924                flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>,
4925            >>("custom_metadata", Self::VT_CUSTOM_METADATA, false)?
4926            .finish();
4927        Ok(())
4928    }
4929}
4930pub struct FieldArgs<'a> {
4931    pub name: Option<flatbuffers::WIPOffset<&'a str>>,
4932    pub nullable: bool,
4933    pub type_type: Type,
4934    pub type_: Option<flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>>,
4935    pub dictionary: Option<flatbuffers::WIPOffset<DictionaryEncoding<'a>>>,
4936    pub children: Option<
4937        flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field<'a>>>>,
4938    >,
4939    pub custom_metadata: Option<
4940        flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>,
4941    >,
4942}
4943impl<'a> Default for FieldArgs<'a> {
4944    #[inline]
4945    fn default() -> Self {
4946        FieldArgs {
4947            name: None,
4948            nullable: false,
4949            type_type: Type::NONE,
4950            type_: None,
4951            dictionary: None,
4952            children: None,
4953            custom_metadata: None,
4954        }
4955    }
4956}
4957
4958pub struct FieldBuilder<'a: 'b, 'b> {
4959    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
4960    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
4961}
4962impl<'a: 'b, 'b> FieldBuilder<'a, 'b> {
4963    #[inline]
4964    pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b str>) {
4965        self.fbb_
4966            .push_slot_always::<flatbuffers::WIPOffset<_>>(Field::VT_NAME, name);
4967    }
4968    #[inline]
4969    pub fn add_nullable(&mut self, nullable: bool) {
4970        self.fbb_
4971            .push_slot::<bool>(Field::VT_NULLABLE, nullable, false);
4972    }
4973    #[inline]
4974    pub fn add_type_type(&mut self, type_type: Type) {
4975        self.fbb_
4976            .push_slot::<Type>(Field::VT_TYPE_TYPE, type_type, Type::NONE);
4977    }
4978    #[inline]
4979    pub fn add_type_(&mut self, type_: flatbuffers::WIPOffset<flatbuffers::UnionWIPOffset>) {
4980        self.fbb_
4981            .push_slot_always::<flatbuffers::WIPOffset<_>>(Field::VT_TYPE_, type_);
4982    }
4983    #[inline]
4984    pub fn add_dictionary(&mut self, dictionary: flatbuffers::WIPOffset<DictionaryEncoding<'b>>) {
4985        self.fbb_
4986            .push_slot_always::<flatbuffers::WIPOffset<DictionaryEncoding>>(
4987                Field::VT_DICTIONARY,
4988                dictionary,
4989            );
4990    }
4991    #[inline]
4992    pub fn add_children(
4993        &mut self,
4994        children: flatbuffers::WIPOffset<
4995            flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<Field<'b>>>,
4996        >,
4997    ) {
4998        self.fbb_
4999            .push_slot_always::<flatbuffers::WIPOffset<_>>(Field::VT_CHILDREN, children);
5000    }
5001    #[inline]
5002    pub fn add_custom_metadata(
5003        &mut self,
5004        custom_metadata: flatbuffers::WIPOffset<
5005            flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<KeyValue<'b>>>,
5006        >,
5007    ) {
5008        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
5009            Field::VT_CUSTOM_METADATA,
5010            custom_metadata,
5011        );
5012    }
5013    #[inline]
5014    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> FieldBuilder<'a, 'b> {
5015        let start = _fbb.start_table();
5016        FieldBuilder {
5017            fbb_: _fbb,
5018            start_: start,
5019        }
5020    }
5021    #[inline]
5022    pub fn finish(self) -> flatbuffers::WIPOffset<Field<'a>> {
5023        let o = self.fbb_.end_table(self.start_);
5024        flatbuffers::WIPOffset::new(o.value())
5025    }
5026}
5027
5028impl core::fmt::Debug for Field<'_> {
5029    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5030        let mut ds = f.debug_struct("Field");
5031        ds.field("name", &self.name());
5032        ds.field("nullable", &self.nullable());
5033        ds.field("type_type", &self.type_type());
5034        match self.type_type() {
5035            Type::Null => {
5036                if let Some(x) = self.type_as_null() {
5037                    ds.field("type_", &x)
5038                } else {
5039                    ds.field(
5040                        "type_",
5041                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5042                    )
5043                }
5044            }
5045            Type::Int => {
5046                if let Some(x) = self.type_as_int() {
5047                    ds.field("type_", &x)
5048                } else {
5049                    ds.field(
5050                        "type_",
5051                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5052                    )
5053                }
5054            }
5055            Type::FloatingPoint => {
5056                if let Some(x) = self.type_as_floating_point() {
5057                    ds.field("type_", &x)
5058                } else {
5059                    ds.field(
5060                        "type_",
5061                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5062                    )
5063                }
5064            }
5065            Type::Binary => {
5066                if let Some(x) = self.type_as_binary() {
5067                    ds.field("type_", &x)
5068                } else {
5069                    ds.field(
5070                        "type_",
5071                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5072                    )
5073                }
5074            }
5075            Type::Utf8 => {
5076                if let Some(x) = self.type_as_utf_8() {
5077                    ds.field("type_", &x)
5078                } else {
5079                    ds.field(
5080                        "type_",
5081                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5082                    )
5083                }
5084            }
5085            Type::Bool => {
5086                if let Some(x) = self.type_as_bool() {
5087                    ds.field("type_", &x)
5088                } else {
5089                    ds.field(
5090                        "type_",
5091                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5092                    )
5093                }
5094            }
5095            Type::Decimal => {
5096                if let Some(x) = self.type_as_decimal() {
5097                    ds.field("type_", &x)
5098                } else {
5099                    ds.field(
5100                        "type_",
5101                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5102                    )
5103                }
5104            }
5105            Type::Date => {
5106                if let Some(x) = self.type_as_date() {
5107                    ds.field("type_", &x)
5108                } else {
5109                    ds.field(
5110                        "type_",
5111                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5112                    )
5113                }
5114            }
5115            Type::Time => {
5116                if let Some(x) = self.type_as_time() {
5117                    ds.field("type_", &x)
5118                } else {
5119                    ds.field(
5120                        "type_",
5121                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5122                    )
5123                }
5124            }
5125            Type::Timestamp => {
5126                if let Some(x) = self.type_as_timestamp() {
5127                    ds.field("type_", &x)
5128                } else {
5129                    ds.field(
5130                        "type_",
5131                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5132                    )
5133                }
5134            }
5135            Type::Interval => {
5136                if let Some(x) = self.type_as_interval() {
5137                    ds.field("type_", &x)
5138                } else {
5139                    ds.field(
5140                        "type_",
5141                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5142                    )
5143                }
5144            }
5145            Type::List => {
5146                if let Some(x) = self.type_as_list() {
5147                    ds.field("type_", &x)
5148                } else {
5149                    ds.field(
5150                        "type_",
5151                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5152                    )
5153                }
5154            }
5155            Type::Struct_ => {
5156                if let Some(x) = self.type_as_struct_() {
5157                    ds.field("type_", &x)
5158                } else {
5159                    ds.field(
5160                        "type_",
5161                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5162                    )
5163                }
5164            }
5165            Type::Union => {
5166                if let Some(x) = self.type_as_union() {
5167                    ds.field("type_", &x)
5168                } else {
5169                    ds.field(
5170                        "type_",
5171                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5172                    )
5173                }
5174            }
5175            Type::FixedSizeBinary => {
5176                if let Some(x) = self.type_as_fixed_size_binary() {
5177                    ds.field("type_", &x)
5178                } else {
5179                    ds.field(
5180                        "type_",
5181                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5182                    )
5183                }
5184            }
5185            Type::FixedSizeList => {
5186                if let Some(x) = self.type_as_fixed_size_list() {
5187                    ds.field("type_", &x)
5188                } else {
5189                    ds.field(
5190                        "type_",
5191                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5192                    )
5193                }
5194            }
5195            Type::Map => {
5196                if let Some(x) = self.type_as_map() {
5197                    ds.field("type_", &x)
5198                } else {
5199                    ds.field(
5200                        "type_",
5201                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5202                    )
5203                }
5204            }
5205            Type::Duration => {
5206                if let Some(x) = self.type_as_duration() {
5207                    ds.field("type_", &x)
5208                } else {
5209                    ds.field(
5210                        "type_",
5211                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5212                    )
5213                }
5214            }
5215            Type::LargeBinary => {
5216                if let Some(x) = self.type_as_large_binary() {
5217                    ds.field("type_", &x)
5218                } else {
5219                    ds.field(
5220                        "type_",
5221                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5222                    )
5223                }
5224            }
5225            Type::LargeUtf8 => {
5226                if let Some(x) = self.type_as_large_utf_8() {
5227                    ds.field("type_", &x)
5228                } else {
5229                    ds.field(
5230                        "type_",
5231                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5232                    )
5233                }
5234            }
5235            Type::LargeList => {
5236                if let Some(x) = self.type_as_large_list() {
5237                    ds.field("type_", &x)
5238                } else {
5239                    ds.field(
5240                        "type_",
5241                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5242                    )
5243                }
5244            }
5245            Type::RunEndEncoded => {
5246                if let Some(x) = self.type_as_run_end_encoded() {
5247                    ds.field("type_", &x)
5248                } else {
5249                    ds.field(
5250                        "type_",
5251                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5252                    )
5253                }
5254            }
5255            Type::BinaryView => {
5256                if let Some(x) = self.type_as_binary_view() {
5257                    ds.field("type_", &x)
5258                } else {
5259                    ds.field(
5260                        "type_",
5261                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5262                    )
5263                }
5264            }
5265            Type::Utf8View => {
5266                if let Some(x) = self.type_as_utf_8_view() {
5267                    ds.field("type_", &x)
5268                } else {
5269                    ds.field(
5270                        "type_",
5271                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5272                    )
5273                }
5274            }
5275            Type::ListView => {
5276                if let Some(x) = self.type_as_list_view() {
5277                    ds.field("type_", &x)
5278                } else {
5279                    ds.field(
5280                        "type_",
5281                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5282                    )
5283                }
5284            }
5285            Type::LargeListView => {
5286                if let Some(x) = self.type_as_large_list_view() {
5287                    ds.field("type_", &x)
5288                } else {
5289                    ds.field(
5290                        "type_",
5291                        &"InvalidFlatbuffer: Union discriminant does not match value.",
5292                    )
5293                }
5294            }
5295            _ => {
5296                let x: Option<()> = None;
5297                ds.field("type_", &x)
5298            }
5299        };
5300        ds.field("dictionary", &self.dictionary());
5301        ds.field("children", &self.children());
5302        ds.field("custom_metadata", &self.custom_metadata());
5303        ds.finish()
5304    }
5305}
5306pub enum SchemaOffset {}
5307#[derive(Copy, Clone, PartialEq)]
5308
5309/// ----------------------------------------------------------------------
5310/// A Schema describes the columns in a row batch
5311pub struct Schema<'a> {
5312    pub _tab: flatbuffers::Table<'a>,
5313}
5314
5315impl<'a> flatbuffers::Follow<'a> for Schema<'a> {
5316    type Inner = Schema<'a>;
5317    #[inline]
5318    unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
5319        Self {
5320            _tab: flatbuffers::Table::new(buf, loc),
5321        }
5322    }
5323}
5324
5325impl<'a> Schema<'a> {
5326    pub const VT_ENDIANNESS: flatbuffers::VOffsetT = 4;
5327    pub const VT_FIELDS: flatbuffers::VOffsetT = 6;
5328    pub const VT_CUSTOM_METADATA: flatbuffers::VOffsetT = 8;
5329    pub const VT_FEATURES: flatbuffers::VOffsetT = 10;
5330
5331    #[inline]
5332    pub unsafe fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
5333        Schema { _tab: table }
5334    }
5335    #[allow(unused_mut)]
5336    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
5337        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
5338        args: &'args SchemaArgs<'args>,
5339    ) -> flatbuffers::WIPOffset<Schema<'bldr>> {
5340        let mut builder = SchemaBuilder::new(_fbb);
5341        if let Some(x) = args.features {
5342            builder.add_features(x);
5343        }
5344        if let Some(x) = args.custom_metadata {
5345            builder.add_custom_metadata(x);
5346        }
5347        if let Some(x) = args.fields {
5348            builder.add_fields(x);
5349        }
5350        builder.add_endianness(args.endianness);
5351        builder.finish()
5352    }
5353
5354    /// endianness of the buffer
5355    /// it is Little Endian by default
5356    /// if endianness doesn't match the underlying system then the vectors need to be converted
5357    #[inline]
5358    pub fn endianness(&self) -> Endianness {
5359        // Safety:
5360        // Created from valid Table for this object
5361        // which contains a valid value in this slot
5362        unsafe {
5363            self._tab
5364                .get::<Endianness>(Schema::VT_ENDIANNESS, Some(Endianness::Little))
5365                .unwrap()
5366        }
5367    }
5368    #[inline]
5369    pub fn fields(
5370        &self,
5371    ) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field<'a>>>> {
5372        // Safety:
5373        // Created from valid Table for this object
5374        // which contains a valid value in this slot
5375        unsafe {
5376            self._tab.get::<flatbuffers::ForwardsUOffset<
5377                flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field>>,
5378            >>(Schema::VT_FIELDS, None)
5379        }
5380    }
5381    #[inline]
5382    pub fn custom_metadata(
5383        &self,
5384    ) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>> {
5385        // Safety:
5386        // Created from valid Table for this object
5387        // which contains a valid value in this slot
5388        unsafe {
5389            self._tab.get::<flatbuffers::ForwardsUOffset<
5390                flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue>>,
5391            >>(Schema::VT_CUSTOM_METADATA, None)
5392        }
5393    }
5394    /// Features used in the stream/file.
5395    #[inline]
5396    pub fn features(&self) -> Option<flatbuffers::Vector<'a, Feature>> {
5397        // Safety:
5398        // Created from valid Table for this object
5399        // which contains a valid value in this slot
5400        unsafe {
5401            self._tab
5402                .get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, Feature>>>(
5403                    Schema::VT_FEATURES,
5404                    None,
5405                )
5406        }
5407    }
5408}
5409
5410impl flatbuffers::Verifiable for Schema<'_> {
5411    #[inline]
5412    fn run_verifier(
5413        v: &mut flatbuffers::Verifier,
5414        pos: usize,
5415    ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
5416        use flatbuffers::Verifiable;
5417        v.visit_table(pos)?
5418            .visit_field::<Endianness>("endianness", Self::VT_ENDIANNESS, false)?
5419            .visit_field::<flatbuffers::ForwardsUOffset<
5420                flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<Field>>,
5421            >>("fields", Self::VT_FIELDS, false)?
5422            .visit_field::<flatbuffers::ForwardsUOffset<
5423                flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<KeyValue>>,
5424            >>("custom_metadata", Self::VT_CUSTOM_METADATA, false)?
5425            .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, Feature>>>(
5426                "features",
5427                Self::VT_FEATURES,
5428                false,
5429            )?
5430            .finish();
5431        Ok(())
5432    }
5433}
5434pub struct SchemaArgs<'a> {
5435    pub endianness: Endianness,
5436    pub fields: Option<
5437        flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Field<'a>>>>,
5438    >,
5439    pub custom_metadata: Option<
5440        flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<KeyValue<'a>>>>,
5441    >,
5442    pub features: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, Feature>>>,
5443}
5444impl<'a> Default for SchemaArgs<'a> {
5445    #[inline]
5446    fn default() -> Self {
5447        SchemaArgs {
5448            endianness: Endianness::Little,
5449            fields: None,
5450            custom_metadata: None,
5451            features: None,
5452        }
5453    }
5454}
5455
5456pub struct SchemaBuilder<'a: 'b, 'b> {
5457    fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
5458    start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
5459}
5460impl<'a: 'b, 'b> SchemaBuilder<'a, 'b> {
5461    #[inline]
5462    pub fn add_endianness(&mut self, endianness: Endianness) {
5463        self.fbb_
5464            .push_slot::<Endianness>(Schema::VT_ENDIANNESS, endianness, Endianness::Little);
5465    }
5466    #[inline]
5467    pub fn add_fields(
5468        &mut self,
5469        fields: flatbuffers::WIPOffset<
5470            flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<Field<'b>>>,
5471        >,
5472    ) {
5473        self.fbb_
5474            .push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_FIELDS, fields);
5475    }
5476    #[inline]
5477    pub fn add_custom_metadata(
5478        &mut self,
5479        custom_metadata: flatbuffers::WIPOffset<
5480            flatbuffers::Vector<'b, flatbuffers::ForwardsUOffset<KeyValue<'b>>>,
5481        >,
5482    ) {
5483        self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(
5484            Schema::VT_CUSTOM_METADATA,
5485            custom_metadata,
5486        );
5487    }
5488    #[inline]
5489    pub fn add_features(
5490        &mut self,
5491        features: flatbuffers::WIPOffset<flatbuffers::Vector<'b, Feature>>,
5492    ) {
5493        self.fbb_
5494            .push_slot_always::<flatbuffers::WIPOffset<_>>(Schema::VT_FEATURES, features);
5495    }
5496    #[inline]
5497    pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> SchemaBuilder<'a, 'b> {
5498        let start = _fbb.start_table();
5499        SchemaBuilder {
5500            fbb_: _fbb,
5501            start_: start,
5502        }
5503    }
5504    #[inline]
5505    pub fn finish(self) -> flatbuffers::WIPOffset<Schema<'a>> {
5506        let o = self.fbb_.end_table(self.start_);
5507        flatbuffers::WIPOffset::new(o.value())
5508    }
5509}
5510
5511impl core::fmt::Debug for Schema<'_> {
5512    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
5513        let mut ds = f.debug_struct("Schema");
5514        ds.field("endianness", &self.endianness());
5515        ds.field("fields", &self.fields());
5516        ds.field("custom_metadata", &self.custom_metadata());
5517        ds.field("features", &self.features());
5518        ds.finish()
5519    }
5520}
5521#[inline]
5522/// Verifies that a buffer of bytes contains a `Schema`
5523/// and returns it.
5524/// Note that verification is still experimental and may not
5525/// catch every error, or be maximally performant. For the
5526/// previous, unchecked, behavior use
5527/// `root_as_schema_unchecked`.
5528pub fn root_as_schema(buf: &[u8]) -> Result<Schema, flatbuffers::InvalidFlatbuffer> {
5529    flatbuffers::root::<Schema>(buf)
5530}
5531#[inline]
5532/// Verifies that a buffer of bytes contains a size prefixed
5533/// `Schema` and returns it.
5534/// Note that verification is still experimental and may not
5535/// catch every error, or be maximally performant. For the
5536/// previous, unchecked, behavior use
5537/// `size_prefixed_root_as_schema_unchecked`.
5538pub fn size_prefixed_root_as_schema(buf: &[u8]) -> Result<Schema, flatbuffers::InvalidFlatbuffer> {
5539    flatbuffers::size_prefixed_root::<Schema>(buf)
5540}
5541#[inline]
5542/// Verifies, with the given options, that a buffer of bytes
5543/// contains a `Schema` and returns it.
5544/// Note that verification is still experimental and may not
5545/// catch every error, or be maximally performant. For the
5546/// previous, unchecked, behavior use
5547/// `root_as_schema_unchecked`.
5548pub fn root_as_schema_with_opts<'b, 'o>(
5549    opts: &'o flatbuffers::VerifierOptions,
5550    buf: &'b [u8],
5551) -> Result<Schema<'b>, flatbuffers::InvalidFlatbuffer> {
5552    flatbuffers::root_with_opts::<Schema<'b>>(opts, buf)
5553}
5554#[inline]
5555/// Verifies, with the given verifier options, that a buffer of
5556/// bytes contains a size prefixed `Schema` and returns
5557/// it. Note that verification is still experimental and may not
5558/// catch every error, or be maximally performant. For the
5559/// previous, unchecked, behavior use
5560/// `root_as_schema_unchecked`.
5561pub fn size_prefixed_root_as_schema_with_opts<'b, 'o>(
5562    opts: &'o flatbuffers::VerifierOptions,
5563    buf: &'b [u8],
5564) -> Result<Schema<'b>, flatbuffers::InvalidFlatbuffer> {
5565    flatbuffers::size_prefixed_root_with_opts::<Schema<'b>>(opts, buf)
5566}
5567#[inline]
5568/// Assumes, without verification, that a buffer of bytes contains a Schema and returns it.
5569/// # Safety
5570/// Callers must trust the given bytes do indeed contain a valid `Schema`.
5571pub unsafe fn root_as_schema_unchecked(buf: &[u8]) -> Schema {
5572    flatbuffers::root_unchecked::<Schema>(buf)
5573}
5574#[inline]
5575/// Assumes, without verification, that a buffer of bytes contains a size prefixed Schema and returns it.
5576/// # Safety
5577/// Callers must trust the given bytes do indeed contain a valid size prefixed `Schema`.
5578pub unsafe fn size_prefixed_root_as_schema_unchecked(buf: &[u8]) -> Schema {
5579    flatbuffers::size_prefixed_root_unchecked::<Schema>(buf)
5580}
5581#[inline]
5582pub fn finish_schema_buffer<'a, 'b>(
5583    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
5584    root: flatbuffers::WIPOffset<Schema<'a>>,
5585) {
5586    fbb.finish(root, None);
5587}
5588
5589#[inline]
5590pub fn finish_size_prefixed_schema_buffer<'a, 'b>(
5591    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
5592    root: flatbuffers::WIPOffset<Schema<'a>>,
5593) {
5594    fbb.finish_size_prefixed(root, None);
5595}