Struct tantivy_fst::raw::Node
source · pub struct Node<'f> { /* private fields */ }
Expand description
Node represents a single state in a finite state transducer.
Nodes are very cheap to construct. Notably, they satisfy the Copy
trait.
Implementations§
source§impl<'f> Node<'f>
impl<'f> Node<'f>
sourcepub fn transitions<'n>(&'n self) -> Transitions<'f, 'n> ⓘ
pub fn transitions<'n>(&'n self) -> Transitions<'f, 'n> ⓘ
Returns an iterator over all transitions in this node in lexicographic order.
sourcepub fn transition(&self, i: usize) -> Transition
pub fn transition(&self, i: usize) -> Transition
Returns the transition at index i
.
sourcepub fn transition_addr(&self, i: usize) -> CompiledAddr
pub fn transition_addr(&self, i: usize) -> CompiledAddr
Returns the transition address of the i
th transition.
sourcepub fn find_input(&self, b: u8) -> Option<usize>
pub fn find_input(&self, b: u8) -> Option<usize>
Finds the i
th transition corresponding to the given input byte.
If no transition for this byte exists, then None
is returned.
sourcepub fn final_output(&self) -> Output
pub fn final_output(&self) -> Output
If this node is final and has a terminal output value, then it is returned. Otherwise, a zero output is returned.
sourcepub fn is_final(&self) -> bool
pub fn is_final(&self) -> bool
Returns true if and only if this node corresponds to a final or “match” state in the finite state transducer.
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of transitions in this node.
The maximum number of transitions is 256.
sourcepub fn addr(&self) -> CompiledAddr
pub fn addr(&self) -> CompiledAddr
Return the address of this node.