// automatically generated by the FlatBuffers compiler, do not modify
// @generated
extern crate alloc;


#[allow(unused_imports, dead_code)]
pub mod nexus {

#[allow(unused_imports, dead_code)]
pub mod wal {


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

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

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

impl<'a> DevicePointer<'a> {
  pub const VT_DEVICE_ID: ::flatbuffers::VOffsetT = 4;
  pub const VT_OFFSET: ::flatbuffers::VOffsetT = 6;
  pub const VT_LEN: ::flatbuffers::VOffsetT = 8;
  pub const VT_CHECKSUM_CRC32C: ::flatbuffers::VOffsetT = 10;
  pub const VT_NONCE_ID: ::flatbuffers::VOffsetT = 12;

  #[inline]
  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
    DevicePointer { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args DevicePointerArgs
  ) -> ::flatbuffers::WIPOffset<DevicePointer<'bldr>> {
    let mut builder = DevicePointerBuilder::new(_fbb);
    builder.add_nonce_id(args.nonce_id);
    builder.add_offset(args.offset);
    builder.add_checksum_crc32c(args.checksum_crc32c);
    builder.add_len(args.len);
    builder.add_device_id(args.device_id);
    builder.finish()
  }


  #[inline]
  pub fn device_id(&self) -> u16 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u16>(DevicePointer::VT_DEVICE_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn offset(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(DevicePointer::VT_OFFSET, Some(0)).unwrap()}
  }
  #[inline]
  pub fn len(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(DevicePointer::VT_LEN, Some(0)).unwrap()}
  }
  #[inline]
  pub fn checksum_crc32c(&self) -> u32 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u32>(DevicePointer::VT_CHECKSUM_CRC32C, Some(0)).unwrap()}
  }
  #[inline]
  pub fn nonce_id(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(DevicePointer::VT_NONCE_ID, Some(0)).unwrap()}
  }
}

impl ::flatbuffers::Verifiable for DevicePointer<'_> {
  #[inline]
  fn run_verifier(
    v: &mut ::flatbuffers::Verifier, pos: usize
  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
    v.visit_table(pos)?
     .visit_field::<u16>("device_id", Self::VT_DEVICE_ID, false)?
     .visit_field::<u64>("offset", Self::VT_OFFSET, false)?
     .visit_field::<u32>("len", Self::VT_LEN, false)?
     .visit_field::<u32>("checksum_crc32c", Self::VT_CHECKSUM_CRC32C, false)?
     .visit_field::<u64>("nonce_id", Self::VT_NONCE_ID, false)?
     .finish();
    Ok(())
  }
}
pub struct DevicePointerArgs {
    pub device_id: u16,
    pub offset: u64,
    pub len: u32,
    pub checksum_crc32c: u32,
    pub nonce_id: u64,
}
impl<'a> Default for DevicePointerArgs {
  #[inline]
  fn default() -> Self {
    DevicePointerArgs {
      device_id: 0,
      offset: 0,
      len: 0,
      checksum_crc32c: 0,
      nonce_id: 0,
    }
  }
}

pub struct DevicePointerBuilder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
  fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
  start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> DevicePointerBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_device_id(&mut self, device_id: u16) {
    self.fbb_.push_slot::<u16>(DevicePointer::VT_DEVICE_ID, device_id, 0);
  }
  #[inline]
  pub fn add_offset(&mut self, offset: u64) {
    self.fbb_.push_slot::<u64>(DevicePointer::VT_OFFSET, offset, 0);
  }
  #[inline]
  pub fn add_len(&mut self, len: u32) {
    self.fbb_.push_slot::<u32>(DevicePointer::VT_LEN, len, 0);
  }
  #[inline]
  pub fn add_checksum_crc32c(&mut self, checksum_crc32c: u32) {
    self.fbb_.push_slot::<u32>(DevicePointer::VT_CHECKSUM_CRC32C, checksum_crc32c, 0);
  }
  #[inline]
  pub fn add_nonce_id(&mut self, nonce_id: u64) {
    self.fbb_.push_slot::<u64>(DevicePointer::VT_NONCE_ID, nonce_id, 0);
  }
  #[inline]
  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> DevicePointerBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    DevicePointerBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> ::flatbuffers::WIPOffset<DevicePointer<'a>> {
    let o = self.fbb_.end_table(self.start_);
    ::flatbuffers::WIPOffset::new(o.value())
  }
}

impl ::core::fmt::Debug for DevicePointer<'_> {
  fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
    let mut ds = f.debug_struct("DevicePointer");
      ds.field("device_id", &self.device_id());
      ds.field("offset", &self.offset());
      ds.field("len", &self.len());
      ds.field("checksum_crc32c", &self.checksum_crc32c());
      ds.field("nonce_id", &self.nonce_id());
      ds.finish()
  }
}
pub enum ObjectRecordV1Offset {}
#[derive(Copy, Clone, PartialEq)]

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

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

impl<'a> ObjectRecordV1<'a> {
  pub const VT_SEQ: ::flatbuffers::VOffsetT = 4;
  pub const VT_OP: ::flatbuffers::VOffsetT = 6;
  pub const VT_BUCKET: ::flatbuffers::VOffsetT = 8;
  pub const VT_KEY: ::flatbuffers::VOffsetT = 10;
  pub const VT_ETAG: ::flatbuffers::VOffsetT = 12;
  pub const VT_TS_UNIX_MS: ::flatbuffers::VOffsetT = 14;
  pub const VT_POINTER: ::flatbuffers::VOffsetT = 16;

  #[inline]
  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
    ObjectRecordV1 { _tab: table }
  }
  #[allow(unused_mut)]
  pub fn create<'bldr: 'args, 'args: 'mut_bldr, 'mut_bldr, A: ::flatbuffers::Allocator + 'bldr>(
    _fbb: &'mut_bldr mut ::flatbuffers::FlatBufferBuilder<'bldr, A>,
    args: &'args ObjectRecordV1Args<'args>
  ) -> ::flatbuffers::WIPOffset<ObjectRecordV1<'bldr>> {
    let mut builder = ObjectRecordV1Builder::new(_fbb);
    builder.add_ts_unix_ms(args.ts_unix_ms);
    builder.add_seq(args.seq);
    if let Some(x) = args.pointer { builder.add_pointer(x); }
    if let Some(x) = args.etag { builder.add_etag(x); }
    if let Some(x) = args.key { builder.add_key(x); }
    if let Some(x) = args.bucket { builder.add_bucket(x); }
    if let Some(x) = args.op { builder.add_op(x); }
    builder.finish()
  }


  #[inline]
  pub fn seq(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(ObjectRecordV1::VT_SEQ, Some(0)).unwrap()}
  }
  #[inline]
  pub fn op(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(ObjectRecordV1::VT_OP, None)}
  }
  #[inline]
  pub fn bucket(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(ObjectRecordV1::VT_BUCKET, None)}
  }
  #[inline]
  pub fn key(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(ObjectRecordV1::VT_KEY, None)}
  }
  #[inline]
  pub fn etag(&self) -> Option<&'a str> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<&str>>(ObjectRecordV1::VT_ETAG, None)}
  }
  #[inline]
  pub fn ts_unix_ms(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(ObjectRecordV1::VT_TS_UNIX_MS, Some(0)).unwrap()}
  }
  #[inline]
  pub fn pointer(&self) -> Option<DevicePointer<'a>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<DevicePointer>>(ObjectRecordV1::VT_POINTER, None)}
  }
}

impl ::flatbuffers::Verifiable for ObjectRecordV1<'_> {
  #[inline]
  fn run_verifier(
    v: &mut ::flatbuffers::Verifier, pos: usize
  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
    v.visit_table(pos)?
     .visit_field::<u64>("seq", Self::VT_SEQ, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("op", Self::VT_OP, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("bucket", Self::VT_BUCKET, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("key", Self::VT_KEY, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("etag", Self::VT_ETAG, false)?
     .visit_field::<u64>("ts_unix_ms", Self::VT_TS_UNIX_MS, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<DevicePointer>>("pointer", Self::VT_POINTER, false)?
     .finish();
    Ok(())
  }
}
pub struct ObjectRecordV1Args<'a> {
    pub seq: u64,
    pub op: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub bucket: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub key: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub etag: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub ts_unix_ms: u64,
    pub pointer: Option<::flatbuffers::WIPOffset<DevicePointer<'a>>>,
}
impl<'a> Default for ObjectRecordV1Args<'a> {
  #[inline]
  fn default() -> Self {
    ObjectRecordV1Args {
      seq: 0,
      op: None,
      bucket: None,
      key: None,
      etag: None,
      ts_unix_ms: 0,
      pointer: None,
    }
  }
}

pub struct ObjectRecordV1Builder<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> {
  fbb_: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
  start_: ::flatbuffers::WIPOffset<::flatbuffers::TableUnfinishedWIPOffset>,
}
impl<'a: 'b, 'b, A: ::flatbuffers::Allocator + 'a> ObjectRecordV1Builder<'a, 'b, A> {
  #[inline]
  pub fn add_seq(&mut self, seq: u64) {
    self.fbb_.push_slot::<u64>(ObjectRecordV1::VT_SEQ, seq, 0);
  }
  #[inline]
  pub fn add_op(&mut self, op: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ObjectRecordV1::VT_OP, op);
  }
  #[inline]
  pub fn add_bucket(&mut self, bucket: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ObjectRecordV1::VT_BUCKET, bucket);
  }
  #[inline]
  pub fn add_key(&mut self, key: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ObjectRecordV1::VT_KEY, key);
  }
  #[inline]
  pub fn add_etag(&mut self, etag: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ObjectRecordV1::VT_ETAG, etag);
  }
  #[inline]
  pub fn add_ts_unix_ms(&mut self, ts_unix_ms: u64) {
    self.fbb_.push_slot::<u64>(ObjectRecordV1::VT_TS_UNIX_MS, ts_unix_ms, 0);
  }
  #[inline]
  pub fn add_pointer(&mut self, pointer: ::flatbuffers::WIPOffset<DevicePointer<'b >>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<DevicePointer>>(ObjectRecordV1::VT_POINTER, pointer);
  }
  #[inline]
  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ObjectRecordV1Builder<'a, 'b, A> {
    let start = _fbb.start_table();
    ObjectRecordV1Builder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> ::flatbuffers::WIPOffset<ObjectRecordV1<'a>> {
    let o = self.fbb_.end_table(self.start_);
    ::flatbuffers::WIPOffset::new(o.value())
  }
}

impl ::core::fmt::Debug for ObjectRecordV1<'_> {
  fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
    let mut ds = f.debug_struct("ObjectRecordV1");
      ds.field("seq", &self.seq());
      ds.field("op", &self.op());
      ds.field("bucket", &self.bucket());
      ds.field("key", &self.key());
      ds.field("etag", &self.etag());
      ds.field("ts_unix_ms", &self.ts_unix_ms());
      ds.field("pointer", &self.pointer());
      ds.finish()
  }
}
#[inline]
/// Verifies that a buffer of bytes contains a `ObjectRecordV1`
/// 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_object_record_v1_unchecked`.
pub fn root_as_object_record_v1(buf: &[u8]) -> Result<ObjectRecordV1<'_>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::root::<ObjectRecordV1>(buf)
}
#[inline]
/// Verifies that a buffer of bytes contains a size prefixed
/// `ObjectRecordV1` 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_object_record_v1_unchecked`.
pub fn size_prefixed_root_as_object_record_v1(buf: &[u8]) -> Result<ObjectRecordV1<'_>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::size_prefixed_root::<ObjectRecordV1>(buf)
}
#[inline]
/// Verifies, with the given options, that a buffer of bytes
/// contains a `ObjectRecordV1` 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_object_record_v1_unchecked`.
pub fn root_as_object_record_v1_with_opts<'b, 'o>(
  opts: &'o ::flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<ObjectRecordV1<'b>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::root_with_opts::<ObjectRecordV1<'b>>(opts, buf)
}
#[inline]
/// Verifies, with the given verifier options, that a buffer of
/// bytes contains a size prefixed `ObjectRecordV1` 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_object_record_v1_unchecked`.
pub fn size_prefixed_root_as_object_record_v1_with_opts<'b, 'o>(
  opts: &'o ::flatbuffers::VerifierOptions,
  buf: &'b [u8],
) -> Result<ObjectRecordV1<'b>, ::flatbuffers::InvalidFlatbuffer> {
  ::flatbuffers::size_prefixed_root_with_opts::<ObjectRecordV1<'b>>(opts, buf)
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a ObjectRecordV1 and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid `ObjectRecordV1`.
pub unsafe fn root_as_object_record_v1_unchecked(buf: &[u8]) -> ObjectRecordV1<'_> {
  unsafe { ::flatbuffers::root_unchecked::<ObjectRecordV1>(buf) }
}
#[inline]
/// Assumes, without verification, that a buffer of bytes contains a size prefixed ObjectRecordV1 and returns it.
/// # Safety
/// Callers must trust the given bytes do indeed contain a valid size prefixed `ObjectRecordV1`.
pub unsafe fn size_prefixed_root_as_object_record_v1_unchecked(buf: &[u8]) -> ObjectRecordV1<'_> {
  unsafe { ::flatbuffers::size_prefixed_root_unchecked::<ObjectRecordV1>(buf) }
}
#[inline]
pub fn finish_object_record_v1_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(
    fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>,
    root: ::flatbuffers::WIPOffset<ObjectRecordV1<'a>>) {
  fbb.finish(root, None);
}

#[inline]
pub fn finish_size_prefixed_object_record_v1_buffer<'a, 'b, A: ::flatbuffers::Allocator + 'a>(fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>, root: ::flatbuffers::WIPOffset<ObjectRecordV1<'a>>) {
  fbb.finish_size_prefixed(root, None);
}
}  // pub mod wal
}  // pub mod nexus

