struct State {
transitions: Vec<Transition>,
}
Expand description
A single state in this trie.
Fields§
§transitions: Vec<Transition>
A sorted sequence of non-overlapping transitions to other states. Each transition corresponds to a single range of bytes.
Implementations§
source§impl State
impl State
sourcefn find(&self, range: Utf8Range) -> usize
fn find(&self, range: Utf8Range) -> usize
Find the position at which the given range should be inserted in this state.
The position returned is always in the inclusive range [0, transitions.len()]. If ‘transitions.len()’ is returned, then the given range overlaps with no other range in this state and is greater than all of them.
For all other possible positions, the given range either overlaps with the transition at that position or is otherwise less than it with no overlap (and is greater than the previous transition). In the former case, careful attention must be paid to inserting this range as a new transition. In the latter case, the range can be inserted as a new transition at the given position without disrupting any other transitions.
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)