pub struct WordSetBuilder { /* private fields */ }Expand description
Builds a WordSet from words given as sequences of character sets.
Implementations§
Source§impl WordSetBuilder
impl WordSetBuilder
pub fn new() -> Self
Sourcepub fn intern(&mut self, chars: impl IntoIterator<Item = char>) -> SetId
pub fn intern(&mut self, chars: impl IntoIterator<Item = char>) -> SetId
The id of a set of characters; equal sets get the same id.
Sourcepub fn is_empty_set(&self, id: SetId) -> bool
pub fn is_empty_set(&self, id: SetId) -> bool
Whether an interned set has no characters, so that no word containing it can match.
Sourcepub fn insert_sets(&mut self, positions: &[SetId])
pub fn insert_sets(&mut self, positions: &[SetId])
Adds a word given as interned sets, one per position.
Sourcepub fn insert<P, C>(&mut self, positions: P)
pub fn insert<P, C>(&mut self, positions: P)
Adds a word: for each position, the characters that match there.
pub fn build(self) -> WordSet
Trait Implementations§
Source§impl Debug for WordSetBuilder
impl Debug for WordSetBuilder
Auto Trait Implementations§
impl Freeze for WordSetBuilder
impl RefUnwindSafe for WordSetBuilder
impl Send for WordSetBuilder
impl Sync for WordSetBuilder
impl Unpin for WordSetBuilder
impl UnsafeUnpin for WordSetBuilder
impl UnwindSafe for WordSetBuilder
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