pub struct WordDictionaryBuilder { /* private fields */ }Expand description
Builder for constructing a WordDictionary with flexible configuration.
§Example
use base_d::WordDictionary;
let dict = WordDictionary::builder()
.words(vec!["alpha", "bravo", "charlie", "delta"])
.delimiter("-")
.case_sensitive(false)
.build()
.unwrap();Implementations§
Source§impl WordDictionaryBuilder
impl WordDictionaryBuilder
Sourcepub fn words_from_str(self, s: &str) -> Self
pub fn words_from_str(self, s: &str) -> Self
Sets the word list from a newline-separated string.
Empty lines are ignored. Leading/trailing whitespace is trimmed.
Sourcepub fn delimiter<S: Into<String>>(self, delimiter: S) -> Self
pub fn delimiter<S: Into<String>>(self, delimiter: S) -> Self
Sets the delimiter used between words in encoded output.
Default is a single space “ “.
Sourcepub fn case_sensitive(self, case_sensitive: bool) -> Self
pub fn case_sensitive(self, case_sensitive: bool) -> Self
Sets whether word matching is case-sensitive.
Default is false (case-insensitive).
Trait Implementations§
Source§impl Debug for WordDictionaryBuilder
impl Debug for WordDictionaryBuilder
Source§impl Default for WordDictionaryBuilder
impl Default for WordDictionaryBuilder
Source§fn default() -> WordDictionaryBuilder
fn default() -> WordDictionaryBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WordDictionaryBuilder
impl RefUnwindSafe for WordDictionaryBuilder
impl Send for WordDictionaryBuilder
impl Sync for WordDictionaryBuilder
impl Unpin for WordDictionaryBuilder
impl UnwindSafe for WordDictionaryBuilder
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