// automatically generated by the FlatBuffers compiler, do not modify
extern crate flatbuffers;
use std::mem;
use std::cmp::Ordering;
use self::flatbuffers::{EndianScalar, Follow};
use super::*;
pub enum WoffMetadataUniqueIDOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

impl<'a> WoffMetadataUniqueID<'a> {
  pub const VT_ID: flatbuffers::VOffsetT = 4;

  #[inline]
  pub fn init_from_table(table: flatbuffers::Table<'a>) -> Self {
    WoffMetadataUniqueID { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr>(
    _fbb: &'mut_bldr mut flatbuffers::FlatBufferBuilder<'bldr>,
    args: &'args WoffMetadataUniqueIDArgs<'args>
  ) -> flatbuffers::WIPOffset<WoffMetadataUniqueID<'bldr>> {
    let mut builder = WoffMetadataUniqueIDBuilder::new(_fbb);
    if let Some(x) = args.id { builder.add_id(x); }
    builder.finish()
  }


  #[inline]
  pub fn id(&self) -> &'a str {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(WoffMetadataUniqueID::VT_ID, None).unwrap()
  }
}

impl flatbuffers::Verifiable for WoffMetadataUniqueID<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<flatbuffers::ForwardsUOffset<&str>>("id", Self::VT_ID, true)?
     .finish();
    Ok(())
  }
}
pub struct WoffMetadataUniqueIDArgs<'a> {
    pub id: Option<flatbuffers::WIPOffset<&'a str>>,
}
impl<'a> Default for WoffMetadataUniqueIDArgs<'a> {
  #[inline]
  fn default() -> Self {
    WoffMetadataUniqueIDArgs {
      id: None, // required field
    }
  }
}
pub struct WoffMetadataUniqueIDBuilder<'a: 'b, 'b> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b> WoffMetadataUniqueIDBuilder<'a, 'b> {
  #[inline]
  pub fn add_id(&mut self, id: flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(WoffMetadataUniqueID::VT_ID, id);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> WoffMetadataUniqueIDBuilder<'a, 'b> {
    let start = _fbb.start_table();
    WoffMetadataUniqueIDBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<WoffMetadataUniqueID<'a>> {
    let o = self.fbb_.end_table(self.start_);
    self.fbb_.required(o, WoffMetadataUniqueID::VT_ID,"id");
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl std::fmt::Debug for WoffMetadataUniqueID<'_> {
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    let mut ds = f.debug_struct("WoffMetadataUniqueID");
      ds.field("id", &self.id());
      ds.finish()
  }
}
