selium-remote-client-protocol 0.3.3

Selium module for supporting remote clients
Documentation
// automatically generated by the FlatBuffers compiler, do not modify
// @generated
extern crate alloc;
use super::*;
pub enum AbiParamOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

impl<'a> AbiParam<'a> {
  pub const VT_KIND: ::flatbuffers::VOffsetT = 4;
  pub const VT_SCALAR_TYPE: ::flatbuffers::VOffsetT = 6;

  #[inline]
  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
    AbiParam { _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 AbiParamArgs
  ) -> ::flatbuffers::WIPOffset<AbiParam<'bldr>> {
    let mut builder = AbiParamBuilder::new(_fbb);
    builder.add_scalar_type(args.scalar_type);
    builder.add_kind(args.kind);
    builder.finish()
  }


  #[inline]
  pub fn kind(&self) -> AbiParamKind {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<AbiParamKind>(AbiParam::VT_KIND, Some(AbiParamKind::Scalar)).unwrap()}
  }
  #[inline]
  pub fn scalar_type(&self) -> AbiScalarType {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<AbiScalarType>(AbiParam::VT_SCALAR_TYPE, Some(AbiScalarType::I8)).unwrap()}
  }
}

impl ::flatbuffers::Verifiable for AbiParam<'_> {
  #[inline]
  fn run_verifier(
    v: &mut ::flatbuffers::Verifier, pos: usize
  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
    v.visit_table(pos)?
     .visit_field::<AbiParamKind>("kind", Self::VT_KIND, false)?
     .visit_field::<AbiScalarType>("scalar_type", Self::VT_SCALAR_TYPE, false)?
     .finish();
    Ok(())
  }
}
pub struct AbiParamArgs {
    pub kind: AbiParamKind,
    pub scalar_type: AbiScalarType,
}
impl<'a> Default for AbiParamArgs {
  #[inline]
  fn default() -> Self {
    AbiParamArgs {
      kind: AbiParamKind::Scalar,
      scalar_type: AbiScalarType::I8,
    }
  }
}

pub struct AbiParamBuilder<'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> AbiParamBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_kind(&mut self, kind: AbiParamKind) {
    self.fbb_.push_slot::<AbiParamKind>(AbiParam::VT_KIND, kind, AbiParamKind::Scalar);
  }
  #[inline]
  pub fn add_scalar_type(&mut self, scalar_type: AbiScalarType) {
    self.fbb_.push_slot::<AbiScalarType>(AbiParam::VT_SCALAR_TYPE, scalar_type, AbiScalarType::I8);
  }
  #[inline]
  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> AbiParamBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    AbiParamBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> ::flatbuffers::WIPOffset<AbiParam<'a>> {
    let o = self.fbb_.end_table(self.start_);
    ::flatbuffers::WIPOffset::new(o.value())
  }
}

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