selium-atlas-protocol 0.2.3

Selium module for indexing and discovering resources with URIs
Documentation
// automatically generated by the FlatBuffers compiler, do not modify
// @generated
extern crate alloc;
use super::*;
pub enum RemoveResponseOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

impl<'a> RemoveResponse<'a> {
  pub const VT_ID: ::flatbuffers::VOffsetT = 4;
  pub const VT_FOUND: ::flatbuffers::VOffsetT = 6;

  #[inline]
  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
    RemoveResponse { _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 RemoveResponseArgs
  ) -> ::flatbuffers::WIPOffset<RemoveResponse<'bldr>> {
    let mut builder = RemoveResponseBuilder::new(_fbb);
    builder.add_id(args.id);
    builder.add_found(args.found);
    builder.finish()
  }


  #[inline]
  pub fn id(&self) -> u64 {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<u64>(RemoveResponse::VT_ID, Some(0)).unwrap()}
  }
  #[inline]
  pub fn found(&self) -> bool {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<bool>(RemoveResponse::VT_FOUND, Some(false)).unwrap()}
  }
}

impl ::flatbuffers::Verifiable for RemoveResponse<'_> {
  #[inline]
  fn run_verifier(
    v: &mut ::flatbuffers::Verifier, pos: usize
  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
    v.visit_table(pos)?
     .visit_field::<u64>("id", Self::VT_ID, false)?
     .visit_field::<bool>("found", Self::VT_FOUND, false)?
     .finish();
    Ok(())
  }
}
pub struct RemoveResponseArgs {
    pub id: u64,
    pub found: bool,
}
impl<'a> Default for RemoveResponseArgs {
  #[inline]
  fn default() -> Self {
    RemoveResponseArgs {
      id: 0,
      found: false,
    }
  }
}

pub struct RemoveResponseBuilder<'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> RemoveResponseBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_id(&mut self, id: u64) {
    self.fbb_.push_slot::<u64>(RemoveResponse::VT_ID, id, 0);
  }
  #[inline]
  pub fn add_found(&mut self, found: bool) {
    self.fbb_.push_slot::<bool>(RemoveResponse::VT_FOUND, found, false);
  }
  #[inline]
  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> RemoveResponseBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    RemoveResponseBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> ::flatbuffers::WIPOffset<RemoveResponse<'a>> {
    let o = self.fbb_.end_table(self.start_);
    ::flatbuffers::WIPOffset::new(o.value())
  }
}

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