pub struct State { /* private fields */ }
Expand description
State of an automaton
Implementations§
Source§impl State
impl State
Sourcepub fn num_successors(&self) -> usize
pub fn num_successors(&self) -> usize
Number of transitions, not including the default
Sourcepub fn has_default_successor(&self) -> bool
pub fn has_default_successor(&self) -> bool
Check whether a state has a default successor
Sourcepub fn default_successor(&self) -> Option<usize>
pub fn default_successor(&self) -> Option<usize>
Get the default successor
Sourcepub fn valid_class_id(&self, cid: ClassId) -> bool
pub fn valid_class_id(&self, cid: ClassId) -> bool
Check whether a class id is valid for this state
- a class id Interval(i) is valid if i < number of transitions
- class id Complement is valid if there’s a default successor defined
Sourcepub fn char_maps_to_default(&self, c: u32) -> bool
pub fn char_maps_to_default(&self, c: u32) -> bool
Check whether character c maps to the default successor
Sourcepub fn char_classes(&self) -> ClassIdIterator<'_> ⓘ
pub fn char_classes(&self) -> ClassIdIterator<'_> ⓘ
Iterate through all valid class ids for this state
Sourcepub fn class_of_char(&self, x: u32) -> ClassId
pub fn class_of_char(&self, x: u32) -> ClassId
Return the class id for a character
Sourcepub fn char_picks(&self) -> PickIterator<'_> ⓘ
pub fn char_picks(&self) -> PickIterator<'_> ⓘ
Pick a character in each class of this state’s character partition
Sourcepub fn char_ranges(&self) -> impl Iterator<Item = &CharSet>
pub fn char_ranges(&self) -> impl Iterator<Item = &CharSet>
Iterate through the character ranges defined for this state.
Same as char_classes, except that the complementary class is not included.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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