pub struct SimpleTrieArray { /* private fields */ }
Expand description
Simple implementation of TrieArray
with Vec<usize>
.
Trait Implementations§
Source§impl Debug for SimpleTrieArray
impl Debug for SimpleTrieArray
Source§impl Default for SimpleTrieArray
impl Default for SimpleTrieArray
Source§fn default() -> SimpleTrieArray
fn default() -> SimpleTrieArray
Returns the “default value” for a type. Read more
Source§impl TrieArray for SimpleTrieArray
impl TrieArray for SimpleTrieArray
Source§fn build(token_ids: Vec<usize>, pointers: Vec<usize>) -> Box<Self>
fn build(token_ids: Vec<usize>, pointers: Vec<usize>) -> Box<Self>
Builds a
TrieArray
from sequences of token ids and pointers.Source§fn serialize_into<W>(&self, writer: W) -> Result<usize>where
W: Write,
fn serialize_into<W>(&self, writer: W) -> Result<usize>where
W: Write,
Serializes the data structure into the writer.
Source§fn deserialize_from<R>(reader: R) -> Result<Box<Self>>where
R: Read,
fn deserialize_from<R>(reader: R) -> Result<Box<Self>>where
R: Read,
Deserializes the data structure from the reader.
Source§fn size_in_bytes(&self) -> usize
fn size_in_bytes(&self) -> usize
Gets the number of bytes to serialize the data structure.
Source§fn memory_statistics(&self) -> Value
fn memory_statistics(&self) -> Value
Gets breakdowns of memory usages for components.
Source§fn find_token(&self, pos: usize, id: usize) -> Option<usize>
fn find_token(&self, pos: usize, id: usize) -> Option<usize>
Finds the position
i
such that token_id(i) = id
and i in range(pos)
.Source§fn num_tokens(&self) -> usize
fn num_tokens(&self) -> usize
Gets the number of tokens stored.
Source§fn num_pointers(&self) -> usize
fn num_pointers(&self) -> usize
Gets the number of pointers stored.
Auto Trait Implementations§
impl Freeze for SimpleTrieArray
impl RefUnwindSafe for SimpleTrieArray
impl Send for SimpleTrieArray
impl Sync for SimpleTrieArray
impl Unpin for SimpleTrieArray
impl UnwindSafe for SimpleTrieArray
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more