pub trait RuntimePrimitives {
Show 18 methods
// Required methods
fn describe(&self) -> RuntimeDescriptor;
fn is_eos(&self, token: u32) -> bool;
fn mem_counters(&self) -> MemCounters;
fn seq_create(&mut self) -> Result<Seq, PrimError>;
fn seq_free(&mut self, seq: Seq);
fn seq_len(&self, seq: Seq) -> u64;
fn seq_copy(
&mut self,
src: Seq,
dst: Seq,
len: u64,
) -> Result<(), PrimError>;
fn seq_truncate(&mut self, seq: Seq, new_len: u64) -> Result<(), PrimError>;
fn seq_boundary(&self, seq: Seq, cap: u64) -> u64;
fn seq_export(
&mut self,
seq: Seq,
len: u64,
encoding: u8,
) -> Result<Vec<u8>, PrimError>;
fn seq_import(&mut self, seq: Seq, payload: &[u8]) -> Result<u64, PrimError>;
fn step(&mut self, feeds: &[Feed<'_>]) -> Result<Vec<Vec<f32>>, PrimError>;
// Provided methods
fn cells_released(&self, seqs: &[Seq]) -> u64 { ... }
fn step_sampled(
&mut self,
_feeds: &[Feed<'_>],
_specs: &[SampleSpec],
) -> Result<Option<Vec<u32>>, PrimError> { ... }
fn step_rows(
&mut self,
_feeds: &[Feed<'_>],
) -> Result<Option<Vec<Vec<Vec<f32>>>>, PrimError> { ... }
fn sync_steps(&mut self, _on: bool) { ... }
fn shed(&mut self, _bytes_target: u64) -> u64 { ... }
fn vocabulary(&self) -> Option<Vocabulary> { ... }
}Required Methods§
fn describe(&self) -> RuntimeDescriptor
fn is_eos(&self, token: u32) -> bool
fn mem_counters(&self) -> MemCounters
fn seq_create(&mut self) -> Result<Seq, PrimError>
fn seq_free(&mut self, seq: Seq)
fn seq_len(&self, seq: Seq) -> u64
fn seq_copy(&mut self, src: Seq, dst: Seq, len: u64) -> Result<(), PrimError>
fn seq_truncate(&mut self, seq: Seq, new_len: u64) -> Result<(), PrimError>
fn seq_boundary(&self, seq: Seq, cap: u64) -> u64
fn seq_export( &mut self, seq: Seq, len: u64, encoding: u8, ) -> Result<Vec<u8>, PrimError>
fn seq_import(&mut self, seq: Seq, payload: &[u8]) -> Result<u64, PrimError>
fn step(&mut self, feeds: &[Feed<'_>]) -> Result<Vec<Vec<f32>>, PrimError>
Provided Methods§
fn cells_released(&self, seqs: &[Seq]) -> u64
fn step_sampled( &mut self, _feeds: &[Feed<'_>], _specs: &[SampleSpec], ) -> Result<Option<Vec<u32>>, PrimError>
Sourcefn step_rows(
&mut self,
_feeds: &[Feed<'_>],
) -> Result<Option<Vec<Vec<Vec<f32>>>>, PrimError>
fn step_rows( &mut self, _feeds: &[Feed<'_>], ) -> Result<Option<Vec<Vec<Vec<f32>>>>, PrimError>
step, answering for each feed that wants rows a row after every
one of its tokens (in order), not only its last. Ok(None): not
served, and nothing moved.
Sourcefn sync_steps(&mut self, _on: bool)
fn sync_steps(&mut self, _on: bool)
Whether a step that reads no row is done when it returns, rather than queued.
fn shed(&mut self, _bytes_target: u64) -> u64
fn vocabulary(&self) -> Option<Vocabulary>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".