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 ProcessStartRequestOffset {}
#[derive(Copy, Clone, PartialEq)]

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

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

impl<'a> ProcessStartRequest<'a> {
  pub const VT_MODULE_ID: ::flatbuffers::VOffsetT = 4;
  pub const VT_ENTRYPOINT: ::flatbuffers::VOffsetT = 6;
  pub const VT_LOG_URI: ::flatbuffers::VOffsetT = 8;
  pub const VT_CAPABILITIES: ::flatbuffers::VOffsetT = 10;
  pub const VT_SIGNATURE: ::flatbuffers::VOffsetT = 12;
  pub const VT_ARGS: ::flatbuffers::VOffsetT = 14;

  #[inline]
  pub unsafe fn init_from_table(table: ::flatbuffers::Table<'a>) -> Self {
    ProcessStartRequest { _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 ProcessStartRequestArgs<'args>
  ) -> ::flatbuffers::WIPOffset<ProcessStartRequest<'bldr>> {
    let mut builder = ProcessStartRequestBuilder::new(_fbb);
    if let Some(x) = args.args { builder.add_args(x); }
    if let Some(x) = args.signature { builder.add_signature(x); }
    if let Some(x) = args.capabilities { builder.add_capabilities(x); }
    if let Some(x) = args.log_uri { builder.add_log_uri(x); }
    if let Some(x) = args.entrypoint { builder.add_entrypoint(x); }
    if let Some(x) = args.module_id { builder.add_module_id(x); }
    builder.finish()
  }


  #[inline]
  pub fn module_id(&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>>(ProcessStartRequest::VT_MODULE_ID, None)}
  }
  #[inline]
  pub fn entrypoint(&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>>(ProcessStartRequest::VT_ENTRYPOINT, None)}
  }
  #[inline]
  pub fn log_uri(&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>>(ProcessStartRequest::VT_LOG_URI, None)}
  }
  #[inline]
  pub fn capabilities(&self) -> Option<::flatbuffers::Vector<'a, Capability>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, Capability>>>(ProcessStartRequest::VT_CAPABILITIES, None)}
  }
  #[inline]
  pub fn signature(&self) -> Option<AbiSignature<'a>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<AbiSignature>>(ProcessStartRequest::VT_SIGNATURE, None)}
  }
  #[inline]
  pub fn args(&self) -> Option<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<EntrypointArg<'a>>>> {
    // Safety:
    // Created from valid Table for this object
    // which contains a valid value in this slot
    unsafe { self._tab.get::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<EntrypointArg>>>>(ProcessStartRequest::VT_ARGS, None)}
  }
}

impl ::flatbuffers::Verifiable for ProcessStartRequest<'_> {
  #[inline]
  fn run_verifier(
    v: &mut ::flatbuffers::Verifier, pos: usize
  ) -> Result<(), ::flatbuffers::InvalidFlatbuffer> {
    v.visit_table(pos)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("module_id", Self::VT_MODULE_ID, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("entrypoint", Self::VT_ENTRYPOINT, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<&str>>("log_uri", Self::VT_LOG_URI, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, Capability>>>("capabilities", Self::VT_CAPABILITIES, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<AbiSignature>>("signature", Self::VT_SIGNATURE, false)?
     .visit_field::<::flatbuffers::ForwardsUOffset<::flatbuffers::Vector<'_, ::flatbuffers::ForwardsUOffset<EntrypointArg>>>>("args", Self::VT_ARGS, false)?
     .finish();
    Ok(())
  }
}
pub struct ProcessStartRequestArgs<'a> {
    pub module_id: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub entrypoint: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub log_uri: Option<::flatbuffers::WIPOffset<&'a str>>,
    pub capabilities: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, Capability>>>,
    pub signature: Option<::flatbuffers::WIPOffset<AbiSignature<'a>>>,
    pub args: Option<::flatbuffers::WIPOffset<::flatbuffers::Vector<'a, ::flatbuffers::ForwardsUOffset<EntrypointArg<'a>>>>>,
}
impl<'a> Default for ProcessStartRequestArgs<'a> {
  #[inline]
  fn default() -> Self {
    ProcessStartRequestArgs {
      module_id: None,
      entrypoint: None,
      log_uri: None,
      capabilities: None,
      signature: None,
      args: None,
    }
  }
}

pub struct ProcessStartRequestBuilder<'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> ProcessStartRequestBuilder<'a, 'b, A> {
  #[inline]
  pub fn add_module_id(&mut self, module_id: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ProcessStartRequest::VT_MODULE_ID, module_id);
  }
  #[inline]
  pub fn add_entrypoint(&mut self, entrypoint: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ProcessStartRequest::VT_ENTRYPOINT, entrypoint);
  }
  #[inline]
  pub fn add_log_uri(&mut self, log_uri: ::flatbuffers::WIPOffset<&'b  str>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ProcessStartRequest::VT_LOG_URI, log_uri);
  }
  #[inline]
  pub fn add_capabilities(&mut self, capabilities: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , Capability>>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ProcessStartRequest::VT_CAPABILITIES, capabilities);
  }
  #[inline]
  pub fn add_signature(&mut self, signature: ::flatbuffers::WIPOffset<AbiSignature<'b >>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<AbiSignature>>(ProcessStartRequest::VT_SIGNATURE, signature);
  }
  #[inline]
  pub fn add_args(&mut self, args: ::flatbuffers::WIPOffset<::flatbuffers::Vector<'b , ::flatbuffers::ForwardsUOffset<EntrypointArg<'b >>>>) {
    self.fbb_.push_slot_always::<::flatbuffers::WIPOffset<_>>(ProcessStartRequest::VT_ARGS, args);
  }
  #[inline]
  pub fn new(_fbb: &'b mut ::flatbuffers::FlatBufferBuilder<'a, A>) -> ProcessStartRequestBuilder<'a, 'b, A> {
    let start = _fbb.start_table();
    ProcessStartRequestBuilder {
      fbb_: _fbb,
      start_: start,
    }
  }
  #[inline]
  pub fn finish(self) -> ::flatbuffers::WIPOffset<ProcessStartRequest<'a>> {
    let o = self.fbb_.end_table(self.start_);
    ::flatbuffers::WIPOffset::new(o.value())
  }
}

impl ::core::fmt::Debug for ProcessStartRequest<'_> {
  fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
    let mut ds = f.debug_struct("ProcessStartRequest");
      ds.field("module_id", &self.module_id());
      ds.field("entrypoint", &self.entrypoint());
      ds.field("log_uri", &self.log_uri());
      ds.field("capabilities", &self.capabilities());
      ds.field("signature", &self.signature());
      ds.field("args", &self.args());
      ds.finish()
  }
}