// automatically generated by the FlatBuffers compiler, do not modify

use std::cmp::Ordering;
use std::mem;

extern crate flatbuffers;
use self::flatbuffers::EndianScalar;

#[allow(unused_imports, dead_code)]
#[rustfmt::skip]
pub mod flat_geobuf {

  use std::mem;
  use std::cmp::Ordering;

  extern crate flatbuffers;
  use self::flatbuffers::EndianScalar;

#[allow(non_camel_case_types)]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum GeometryType {
  Unknown = 0,
  Point = 1,
  LineString = 2,
  Polygon = 3,
  MultiPoint = 4,
  MultiLineString = 5,
  MultiPolygon = 6,
  GeometryCollection = 7,
  CircularString = 8,
  CompoundCurve = 9,
  CurvePolygon = 10,
  MultiCurve = 11,
  MultiSurface = 12,
  Curve = 13,
  Surface = 14,
  PolyhedralSurface = 15,
  TIN = 16,
  Triangle = 17,

}

pub const ENUM_MIN_GEOMETRY_TYPE: u8 = 0;
pub const ENUM_MAX_GEOMETRY_TYPE: u8 = 17;

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

impl flatbuffers::EndianScalar for GeometryType {
  #[inline]
  fn to_little_endian(self) -> Self {
    let n = u8::to_le(self as u8);
    let p = &n as *const u8 as *const GeometryType;
    unsafe { *p }
  }
  #[inline]
  fn from_little_endian(self) -> Self {
    let n = u8::from_le(self as u8);
    let p = &n as *const u8 as *const GeometryType;
    unsafe { *p }
  }
}

impl flatbuffers::Push for GeometryType {
    type Output = GeometryType;
    #[inline]
    fn push(&self, dst: &mut [u8], _rest: &[u8]) {
        flatbuffers::emplace_scalar::<GeometryType>(dst, *self);
    }
}

#[allow(non_camel_case_types)]
pub const ENUM_VALUES_GEOMETRY_TYPE:[GeometryType; 18] = [
  GeometryType::Unknown,
  GeometryType::Point,
  GeometryType::LineString,
  GeometryType::Polygon,
  GeometryType::MultiPoint,
  GeometryType::MultiLineString,
  GeometryType::MultiPolygon,
  GeometryType::GeometryCollection,
  GeometryType::CircularString,
  GeometryType::CompoundCurve,
  GeometryType::CurvePolygon,
  GeometryType::MultiCurve,
  GeometryType::MultiSurface,
  GeometryType::Curve,
  GeometryType::Surface,
  GeometryType::PolyhedralSurface,
  GeometryType::TIN,
  GeometryType::Triangle
];

#[allow(non_camel_case_types)]
pub const ENUM_NAMES_GEOMETRY_TYPE:[&'static str; 18] = [
    "Unknown",
    "Point",
    "LineString",
    "Polygon",
    "MultiPoint",
    "MultiLineString",
    "MultiPolygon",
    "GeometryCollection",
    "CircularString",
    "CompoundCurve",
    "CurvePolygon",
    "MultiCurve",
    "MultiSurface",
    "Curve",
    "Surface",
    "PolyhedralSurface",
    "TIN",
    "Triangle"
];

pub fn enum_name_geometry_type(e: GeometryType) -> &'static str {
  let index = e as u8;
  ENUM_NAMES_GEOMETRY_TYPE[index as usize]
}

#[allow(non_camel_case_types)]
#[repr(u8)]
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum ColumnType {
  Byte = 0,
  UByte = 1,
  Bool = 2,
  Short = 3,
  UShort = 4,
  Int = 5,
  UInt = 6,
  Long = 7,
  ULong = 8,
  Float = 9,
  Double = 10,
  String = 11,
  Json = 12,
  DateTime = 13,
  Binary = 14,

}

pub const ENUM_MIN_COLUMN_TYPE: u8 = 0;
pub const ENUM_MAX_COLUMN_TYPE: u8 = 14;

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

impl flatbuffers::EndianScalar for ColumnType {
  #[inline]
  fn to_little_endian(self) -> Self {
    let n = u8::to_le(self as u8);
    let p = &n as *const u8 as *const ColumnType;
    unsafe { *p }
  }
  #[inline]
  fn from_little_endian(self) -> Self {
    let n = u8::from_le(self as u8);
    let p = &n as *const u8 as *const ColumnType;
    unsafe { *p }
  }
}

impl flatbuffers::Push for ColumnType {
    type Output = ColumnType;
    #[inline]
    fn push(&self, dst: &mut [u8], _rest: &[u8]) {
        flatbuffers::emplace_scalar::<ColumnType>(dst, *self);
    }
}

#[allow(non_camel_case_types)]
pub const ENUM_VALUES_COLUMN_TYPE:[ColumnType; 15] = [
  ColumnType::Byte,
  ColumnType::UByte,
  ColumnType::Bool,
  ColumnType::Short,
  ColumnType::UShort,
  ColumnType::Int,
  ColumnType::UInt,
  ColumnType::Long,
  ColumnType::ULong,
  ColumnType::Float,
  ColumnType::Double,
  ColumnType::String,
  ColumnType::Json,
  ColumnType::DateTime,
  ColumnType::Binary
];

#[allow(non_camel_case_types)]
pub const ENUM_NAMES_COLUMN_TYPE:[&'static str; 15] = [
    "Byte",
    "UByte",
    "Bool",
    "Short",
    "UShort",
    "Int",
    "UInt",
    "Long",
    "ULong",
    "Float",
    "Double",
    "String",
    "Json",
    "DateTime",
    "Binary"
];

pub fn enum_name_column_type(e: ColumnType) -> &'static str {
  let index = e as u8;
  ENUM_NAMES_COLUMN_TYPE[index as usize]
}

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

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

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

impl<'a> Column<'a> {
    #[inline]
    pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
        Column {
            _tab: table,
        }
    }
    #[allow(unused_mut)]
    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
        args: &'args ColumnArgs<'args>) -> flatbuffers::WIPOffset<Column<'bldr>> {
      let mut builder = ColumnBuilder::new(_fbb);
      if let Some(x) = args.metadata { builder.add_metadata(x); }
      builder.add_scale(args.scale);
      builder.add_precision(args.precision);
      builder.add_width(args.width);
      if let Some(x) = args.description { builder.add_description(x); }
      if let Some(x) = args.title { builder.add_title(x); }
      if let Some(x) = args.name { builder.add_name(x); }
      builder.add_primary_key(args.primary_key);
      builder.add_unique(args.unique);
      builder.add_nullable(args.nullable);
      builder.add_type_(args.type_);
      builder.finish()
    }

    pub const VT_NAME: flatbuffers::VOffsetT = 4;
    pub const VT_TYPE_: flatbuffers::VOffsetT = 6;
    pub const VT_TITLE: flatbuffers::VOffsetT = 8;
    pub const VT_DESCRIPTION: flatbuffers::VOffsetT = 10;
    pub const VT_WIDTH: flatbuffers::VOffsetT = 12;
    pub const VT_PRECISION: flatbuffers::VOffsetT = 14;
    pub const VT_SCALE: flatbuffers::VOffsetT = 16;
    pub const VT_NULLABLE: flatbuffers::VOffsetT = 18;
    pub const VT_UNIQUE: flatbuffers::VOffsetT = 20;
    pub const VT_PRIMARY_KEY: flatbuffers::VOffsetT = 22;
    pub const VT_METADATA: flatbuffers::VOffsetT = 24;

  #[inline]
  pub fn name(&self) -> &'a str {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Column::VT_NAME, None).unwrap()
  }
  #[inline]
  pub fn type_(&self) -> ColumnType {
    self._tab.get::<ColumnType>(Column::VT_TYPE_, Some(ColumnType::Byte)).unwrap()
  }
  #[inline]
  pub fn title(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Column::VT_TITLE, None)
  }
  #[inline]
  pub fn description(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Column::VT_DESCRIPTION, None)
  }
  #[inline]
  pub fn width(&self) -> i32 {
    self._tab.get::<i32>(Column::VT_WIDTH, Some(-1)).unwrap()
  }
  #[inline]
  pub fn precision(&self) -> i32 {
    self._tab.get::<i32>(Column::VT_PRECISION, Some(-1)).unwrap()
  }
  #[inline]
  pub fn scale(&self) -> i32 {
    self._tab.get::<i32>(Column::VT_SCALE, Some(-1)).unwrap()
  }
  #[inline]
  pub fn nullable(&self) -> bool {
    self._tab.get::<bool>(Column::VT_NULLABLE, Some(true)).unwrap()
  }
  #[inline]
  pub fn unique(&self) -> bool {
    self._tab.get::<bool>(Column::VT_UNIQUE, Some(false)).unwrap()
  }
  #[inline]
  pub fn primary_key(&self) -> bool {
    self._tab.get::<bool>(Column::VT_PRIMARY_KEY, Some(false)).unwrap()
  }
  #[inline]
  pub fn metadata(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Column::VT_METADATA, None)
  }
}

pub struct ColumnArgs<'a> {
    pub name: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub type_: ColumnType,
    pub title: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub description: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub width: i32,
    pub precision: i32,
    pub scale: i32,
    pub nullable: bool,
    pub unique: bool,
    pub primary_key: bool,
    pub metadata: Option<flatbuffers::WIPOffset<&'a  str>>,
}
impl<'a> Default for ColumnArgs<'a> {
    #[inline]
    fn default() -> Self {
        ColumnArgs {
            name: None, // required field
            type_: ColumnType::Byte,
            title: None,
            description: None,
            width: -1,
            precision: -1,
            scale: -1,
            nullable: true,
            unique: false,
            primary_key: false,
            metadata: None,
        }
    }
}
pub struct ColumnBuilder<'a: 'b, 'b> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b> ColumnBuilder<'a, 'b> {
  #[inline]
  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Column::VT_NAME, name);
  }
  #[inline]
  pub fn add_type_(&mut self, type_: ColumnType) {
    self.fbb_.push_slot::<ColumnType>(Column::VT_TYPE_, type_, ColumnType::Byte);
  }
  #[inline]
  pub fn add_title(&mut self, title: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Column::VT_TITLE, title);
  }
  #[inline]
  pub fn add_description(&mut self, description: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Column::VT_DESCRIPTION, description);
  }
  #[inline]
  pub fn add_width(&mut self, width: i32) {
    self.fbb_.push_slot::<i32>(Column::VT_WIDTH, width, -1);
  }
  #[inline]
  pub fn add_precision(&mut self, precision: i32) {
    self.fbb_.push_slot::<i32>(Column::VT_PRECISION, precision, -1);
  }
  #[inline]
  pub fn add_scale(&mut self, scale: i32) {
    self.fbb_.push_slot::<i32>(Column::VT_SCALE, scale, -1);
  }
  #[inline]
  pub fn add_nullable(&mut self, nullable: bool) {
    self.fbb_.push_slot::<bool>(Column::VT_NULLABLE, nullable, true);
  }
  #[inline]
  pub fn add_unique(&mut self, unique: bool) {
    self.fbb_.push_slot::<bool>(Column::VT_UNIQUE, unique, false);
  }
  #[inline]
  pub fn add_primary_key(&mut self, primary_key: bool) {
    self.fbb_.push_slot::<bool>(Column::VT_PRIMARY_KEY, primary_key, false);
  }
  #[inline]
  pub fn add_metadata(&mut self, metadata: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Column::VT_METADATA, metadata);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ColumnBuilder<'a, 'b> {
    let start = _fbb.start_table();
    ColumnBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<Column<'a>> {
    let o = self.fbb_.end_table(self.start_);
    self.fbb_.required(o, Column::VT_NAME,"name");
    flatbuffers::WIPOffset::new(o.value())
  }
}

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

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

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

impl<'a> Crs<'a> {
    #[inline]
    pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
        Crs {
            _tab: table,
        }
    }
    #[allow(unused_mut)]
    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
        args: &'args CrsArgs<'args>) -> flatbuffers::WIPOffset<Crs<'bldr>> {
      let mut builder = CrsBuilder::new(_fbb);
      if let Some(x) = args.code_string { builder.add_code_string(x); }
      if let Some(x) = args.wkt { builder.add_wkt(x); }
      if let Some(x) = args.description { builder.add_description(x); }
      if let Some(x) = args.name { builder.add_name(x); }
      builder.add_code(args.code);
      if let Some(x) = args.org { builder.add_org(x); }
      builder.finish()
    }

    pub const VT_ORG: flatbuffers::VOffsetT = 4;
    pub const VT_CODE: flatbuffers::VOffsetT = 6;
    pub const VT_NAME: flatbuffers::VOffsetT = 8;
    pub const VT_DESCRIPTION: flatbuffers::VOffsetT = 10;
    pub const VT_WKT: flatbuffers::VOffsetT = 12;
    pub const VT_CODE_STRING: flatbuffers::VOffsetT = 14;

  #[inline]
  pub fn org(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Crs::VT_ORG, None)
  }
  #[inline]
  pub fn code(&self) -> i32 {
    self._tab.get::<i32>(Crs::VT_CODE, Some(0)).unwrap()
  }
  #[inline]
  pub fn name(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Crs::VT_NAME, None)
  }
  #[inline]
  pub fn description(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Crs::VT_DESCRIPTION, None)
  }
  #[inline]
  pub fn wkt(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Crs::VT_WKT, None)
  }
  #[inline]
  pub fn code_string(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Crs::VT_CODE_STRING, None)
  }
}

pub struct CrsArgs<'a> {
    pub org: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub code: i32,
    pub name: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub description: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub wkt: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub code_string: Option<flatbuffers::WIPOffset<&'a  str>>,
}
impl<'a> Default for CrsArgs<'a> {
    #[inline]
    fn default() -> Self {
        CrsArgs {
            org: None,
            code: 0,
            name: None,
            description: None,
            wkt: None,
            code_string: None,
        }
    }
}
pub struct CrsBuilder<'a: 'b, 'b> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b> CrsBuilder<'a, 'b> {
  #[inline]
  pub fn add_org(&mut self, org: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Crs::VT_ORG, org);
  }
  #[inline]
  pub fn add_code(&mut self, code: i32) {
    self.fbb_.push_slot::<i32>(Crs::VT_CODE, code, 0);
  }
  #[inline]
  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Crs::VT_NAME, name);
  }
  #[inline]
  pub fn add_description(&mut self, description: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Crs::VT_DESCRIPTION, description);
  }
  #[inline]
  pub fn add_wkt(&mut self, wkt: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Crs::VT_WKT, wkt);
  }
  #[inline]
  pub fn add_code_string(&mut self, code_string: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Crs::VT_CODE_STRING, code_string);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> CrsBuilder<'a, 'b> {
    let start = _fbb.start_table();
    CrsBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<Crs<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

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

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

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

impl<'a> Header<'a> {
    #[inline]
    pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
        Header {
            _tab: table,
        }
    }
    #[allow(unused_mut)]
    pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
        _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
        args: &'args HeaderArgs<'args>) -> flatbuffers::WIPOffset<Header<'bldr>> {
      let mut builder = HeaderBuilder::new(_fbb);
      builder.add_features_count(args.features_count);
      if let Some(x) = args.metadata { builder.add_metadata(x); }
      if let Some(x) = args.description { builder.add_description(x); }
      if let Some(x) = args.title { builder.add_title(x); }
      if let Some(x) = args.crs { builder.add_crs(x); }
      if let Some(x) = args.columns { builder.add_columns(x); }
      if let Some(x) = args.envelope { builder.add_envelope(x); }
      if let Some(x) = args.name { builder.add_name(x); }
      builder.add_index_node_size(args.index_node_size);
      builder.add_hasTM(args.hasTM);
      builder.add_hasT(args.hasT);
      builder.add_hasM(args.hasM);
      builder.add_hasZ(args.hasZ);
      builder.add_geometry_type(args.geometry_type);
      builder.finish()
    }

    pub const VT_NAME: flatbuffers::VOffsetT = 4;
    pub const VT_ENVELOPE: flatbuffers::VOffsetT = 6;
    pub const VT_GEOMETRY_TYPE: flatbuffers::VOffsetT = 8;
    pub const VT_HASZ: flatbuffers::VOffsetT = 10;
    pub const VT_HASM: flatbuffers::VOffsetT = 12;
    pub const VT_HAST: flatbuffers::VOffsetT = 14;
    pub const VT_HASTM: flatbuffers::VOffsetT = 16;
    pub const VT_COLUMNS: flatbuffers::VOffsetT = 18;
    pub const VT_FEATURES_COUNT: flatbuffers::VOffsetT = 20;
    pub const VT_INDEX_NODE_SIZE: flatbuffers::VOffsetT = 22;
    pub const VT_CRS: flatbuffers::VOffsetT = 24;
    pub const VT_TITLE: flatbuffers::VOffsetT = 26;
    pub const VT_DESCRIPTION: flatbuffers::VOffsetT = 28;
    pub const VT_METADATA: flatbuffers::VOffsetT = 30;

  #[inline]
  pub fn name(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Header::VT_NAME, None)
  }
  #[inline]
  pub fn envelope(&self) -> Option<flatbuffers::Vector<'a, f64>> {
    self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, f64>>>(Header::VT_ENVELOPE, None)
  }
  #[inline]
  pub fn geometry_type(&self) -> GeometryType {
    self._tab.get::<GeometryType>(Header::VT_GEOMETRY_TYPE, Some(GeometryType::Unknown)).unwrap()
  }
  #[inline]
  pub fn hasZ(&self) -> bool {
    self._tab.get::<bool>(Header::VT_HASZ, Some(false)).unwrap()
  }
  #[inline]
  pub fn hasM(&self) -> bool {
    self._tab.get::<bool>(Header::VT_HASM, Some(false)).unwrap()
  }
  #[inline]
  pub fn hasT(&self) -> bool {
    self._tab.get::<bool>(Header::VT_HAST, Some(false)).unwrap()
  }
  #[inline]
  pub fn hasTM(&self) -> bool {
    self._tab.get::<bool>(Header::VT_HASTM, Some(false)).unwrap()
  }
  #[inline]
  pub fn columns(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Column<'a>>>> {
    self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<flatbuffers::ForwardsUOffset<Column<'a>>>>>(Header::VT_COLUMNS, None)
  }
  #[inline]
  pub fn features_count(&self) -> u64 {
    self._tab.get::<u64>(Header::VT_FEATURES_COUNT, Some(0)).unwrap()
  }
  #[inline]
  pub fn index_node_size(&self) -> u16 {
    self._tab.get::<u16>(Header::VT_INDEX_NODE_SIZE, Some(16)).unwrap()
  }
  #[inline]
  pub fn crs(&self) -> Option<Crs<'a>> {
    self._tab.get::<flatbuffers::ForwardsUOffset<Crs<'a>>>(Header::VT_CRS, None)
  }
  #[inline]
  pub fn title(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Header::VT_TITLE, None)
  }
  #[inline]
  pub fn description(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Header::VT_DESCRIPTION, None)
  }
  #[inline]
  pub fn metadata(&self) -> Option<&'a str> {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Header::VT_METADATA, None)
  }
}

pub struct HeaderArgs<'a> {
    pub name: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub envelope: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a ,  f64>>>,
    pub geometry_type: GeometryType,
    pub hasZ: bool,
    pub hasM: bool,
    pub hasT: bool,
    pub hasTM: bool,
    pub columns: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a , flatbuffers::ForwardsUOffset<Column<'a >>>>>,
    pub features_count: u64,
    pub index_node_size: u16,
    pub crs: Option<flatbuffers::WIPOffset<Crs<'a >>>,
    pub title: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub description: Option<flatbuffers::WIPOffset<&'a  str>>,
    pub metadata: Option<flatbuffers::WIPOffset<&'a  str>>,
}
impl<'a> Default for HeaderArgs<'a> {
    #[inline]
    fn default() -> Self {
        HeaderArgs {
            name: None,
            envelope: None,
            geometry_type: GeometryType::Unknown,
            hasZ: false,
            hasM: false,
            hasT: false,
            hasTM: false,
            columns: None,
            features_count: 0,
            index_node_size: 16,
            crs: None,
            title: None,
            description: None,
            metadata: None,
        }
    }
}
pub struct HeaderBuilder<'a: 'b, 'b> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b> HeaderBuilder<'a, 'b> {
  #[inline]
  pub fn add_name(&mut self, name: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Header::VT_NAME, name);
  }
  #[inline]
  pub fn add_envelope(&mut self, envelope: flatbuffers::WIPOffset<flatbuffers::Vector<'b , f64>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Header::VT_ENVELOPE, envelope);
  }
  #[inline]
  pub fn add_geometry_type(&mut self, geometry_type: GeometryType) {
    self.fbb_.push_slot::<GeometryType>(Header::VT_GEOMETRY_TYPE, geometry_type, GeometryType::Unknown);
  }
  #[inline]
  pub fn add_hasZ(&mut self, hasZ: bool) {
    self.fbb_.push_slot::<bool>(Header::VT_HASZ, hasZ, false);
  }
  #[inline]
  pub fn add_hasM(&mut self, hasM: bool) {
    self.fbb_.push_slot::<bool>(Header::VT_HASM, hasM, false);
  }
  #[inline]
  pub fn add_hasT(&mut self, hasT: bool) {
    self.fbb_.push_slot::<bool>(Header::VT_HAST, hasT, false);
  }
  #[inline]
  pub fn add_hasTM(&mut self, hasTM: bool) {
    self.fbb_.push_slot::<bool>(Header::VT_HASTM, hasTM, false);
  }
  #[inline]
  pub fn add_columns(&mut self, columns: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<Column<'b >>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Header::VT_COLUMNS, columns);
  }
  #[inline]
  pub fn add_features_count(&mut self, features_count: u64) {
    self.fbb_.push_slot::<u64>(Header::VT_FEATURES_COUNT, features_count, 0);
  }
  #[inline]
  pub fn add_index_node_size(&mut self, index_node_size: u16) {
    self.fbb_.push_slot::<u16>(Header::VT_INDEX_NODE_SIZE, index_node_size, 16);
  }
  #[inline]
  pub fn add_crs(&mut self, crs: flatbuffers::WIPOffset<Crs<'b >>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<Crs>>(Header::VT_CRS, crs);
  }
  #[inline]
  pub fn add_title(&mut self, title: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Header::VT_TITLE, title);
  }
  #[inline]
  pub fn add_description(&mut self, description: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Header::VT_DESCRIPTION, description);
  }
  #[inline]
  pub fn add_metadata(&mut self, metadata: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(Header::VT_METADATA, metadata);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> HeaderBuilder<'a, 'b> {
    let start = _fbb.start_table();
    HeaderBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<Header<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

#[inline]
pub fn get_root_as_header<'a>(buf: &'a [u8]) -> Header<'a> {
  flatbuffers::get_root::<Header<'a>>(buf)
}

#[inline]
pub fn get_size_prefixed_root_as_header<'a>(buf: &'a [u8]) -> Header<'a> {
  flatbuffers::get_size_prefixed_root::<Header<'a>>(buf)
}

#[inline]
pub fn finish_header_buffer<'a, 'b>(
    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
    root: flatbuffers::WIPOffset<Header<'a>>) {
  fbb.finish(root, None);
}

#[inline]
pub fn finish_size_prefixed_header_buffer<'a, 'b>(fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>, root: flatbuffers::WIPOffset<Header<'a>>) {
  fbb.finish_size_prefixed(root, None);
}
} // pub mod FlatGeobuf
