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



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

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

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

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

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

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

    pub const VT_LISTS: flatbuffers::VOffsetT = 4;

  #[inline]
  pub fn lists(&self) -> Option<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>> {
    self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>(ActionListIndex::VT_LISTS, None)
  }
}

impl flatbuffers::Verifiable for ActionListIndex<'_> {
  #[inline]
  fn run_verifier(
    v: &mut flatbuffers::Verifier, pos: usize
  ) -> Result<(), flatbuffers::InvalidFlatbuffer> {
    use self::flatbuffers::Verifiable;
    v.visit_table(pos)?
     .visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<&'_ str>>>>(&"lists", Self::VT_LISTS, false)?
     .finish();
    Ok(())
  }
}
pub struct ActionListIndexArgs<'a> {
    pub lists: Option<flatbuffers::WIPOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<&'a str>>>>,
}
impl<'a> Default for ActionListIndexArgs<'a> {
    #[inline]
    fn default() -> Self {
        ActionListIndexArgs {
            lists: None,
        }
    }
}
pub struct ActionListIndexBuilder<'a: 'b, 'b> {
  fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>,
  start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b> ActionListIndexBuilder<'a, 'b> {
  #[inline]
  pub fn add_lists(&mut self, lists: flatbuffers::WIPOffset<flatbuffers::Vector<'b , flatbuffers::ForwardsUOffset<&'b  str>>>) {
    self.fbb_.push_slot_always::<flatbuffers::WIPOffset<_>>(ActionListIndex::VT_LISTS, lists);
  }
  #[inline]
  pub fn new(_fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>) -> ActionListIndexBuilder<'a, 'b> {
    let start = _fbb.start_table();
    ActionListIndexBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> flatbuffers::WIPOffset<ActionListIndex<'a>> {
    let o = self.fbb_.end_table(self.start_);
    flatbuffers::WIPOffset::new(o.value())
  }
}

impl std::fmt::Debug for ActionListIndex<'_> {
  fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
    let mut ds = f.debug_struct("ActionListIndex");
      ds.field("lists", &self.lists());
      ds.finish()
  }
}
#[inline]
#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
pub fn get_root_as_action_list_index<'a>(buf: &'a [u8]) -> ActionListIndex<'a> {
  unsafe { flatbuffers::root_unchecked::<ActionListIndex<'a>>(buf) }
}

#[inline]
#[deprecated(since="2.0.0", note="Deprecated in favor of `root_as...` methods.")]
pub fn get_size_prefixed_root_as_action_list_index<'a>(buf: &'a [u8]) -> ActionListIndex<'a> {
  unsafe { flatbuffers::size_prefixed_root_unchecked::<ActionListIndex<'a>>(buf) }
}

#[inline]
/// Verifies that a buffer of bytes contains a `ActionListIndex`
/// and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_action_list_index_unchecked`.
pub fn root_as_action_list_index(buf: &[u8]) -> Result<ActionListIndex, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root::<ActionListIndex>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `ActionListIndex` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `size_prefixed_root_as_action_list_index_unchecked`.
pub fn size_prefixed_root_as_action_list_index(buf: &[u8]) -> Result<ActionListIndex, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root::<ActionListIndex>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `ActionListIndex` and returns it.
/// Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_action_list_index_unchecked`.
pub fn root_as_action_list_index_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<ActionListIndex<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::root_with_opts::<ActionListIndex<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `ActionListIndex` and returns
/// it. Note that verification is still experimental and may not
/// catch every error, or be maximally performant. For the
/// previous, unchecked, behavior use
/// `root_as_action_list_index_unchecked`.
pub fn size_prefixed_root_as_action_list_index_with_opts<'b, 'o>(
  opts: &'o flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<ActionListIndex<'b>, flatbuffers::InvalidFlatbuffer> {
  flatbuffers::size_prefixed_root_with_opts::<ActionListIndex<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a ActionListIndex and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `ActionListIndex`.
pub unsafe fn root_as_action_list_index_unchecked(buf: &[u8]) -> ActionListIndex {
  flatbuffers::root_unchecked::<ActionListIndex>(buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed ActionListIndex and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `ActionListIndex`.
pub unsafe fn size_prefixed_root_as_action_list_index_unchecked(buf: &[u8]) -> ActionListIndex {
  flatbuffers::size_prefixed_root_unchecked::<ActionListIndex>(buf)
}
#[inline]
pub fn finish_action_list_index_buffer<'a, 'b>(
    fbb: &'b mut flatbuffers::FlatBufferBuilder<'a>,
    root: flatbuffers::WIPOffset<ActionListIndex<'a>>) {
  fbb.finish(root, None);
}

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