pub struct TrieNode { /* private fields */ }Expand description
A node in the context trie
Implementations§
Source§impl TrieNode
impl TrieNode
Sourcepub fn new(parent: Option<NodeId>, state_from_parent: Option<StateId>) -> Self
pub fn new(parent: Option<NodeId>, state_from_parent: Option<StateId>) -> Self
Create a new empty trie node
Sourcepub fn set_context_data(&mut self, data: ContextNode)
pub fn set_context_data(&mut self, data: ContextNode)
Set context data for this node
Sourcepub fn context_data(&self) -> Option<&ContextNode>
pub fn context_data(&self) -> Option<&ContextNode>
Get context data if present
Sourcepub fn context_data_mut(&mut self) -> Option<&mut ContextNode>
pub fn context_data_mut(&mut self) -> Option<&mut ContextNode>
Get mutable context data if present
Sourcepub fn state_from_parent(&self) -> Option<StateId>
pub fn state_from_parent(&self) -> Option<StateId>
Get the state that led to this node from parent
Sourcepub fn has_context_data(&self) -> bool
pub fn has_context_data(&self) -> bool
Check if this node has context data
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get memory usage estimate for this node
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TrieNode
impl RefUnwindSafe for TrieNode
impl Send for TrieNode
impl Sync for TrieNode
impl Unpin for TrieNode
impl UnwindSafe for TrieNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more