Skip to main content

BoxDict

Struct BoxDict 

Source
pub struct BoxDict<'a>(/* private fields */);
Expand description

This is a runtime generated, owned Dict with string slices out of some backing store. These slices may come from a Vec<String>, or else from slices out of a single String.

Implementations§

Source§

impl<'a> BoxDict<'a>

Source

pub fn from_lines(s: &'a str) -> Self

Construct a dictionary from a single string slice, taking each non-empty line, with leading and trailing whitespace trimmed, as a single word.

Source

pub fn from_sep(s: &'a str, sep: &str) -> Self

Construct a dictionary from a single string slice, with fields separated by a separator. Individual words are not trimmed.

Trait Implementations§

Source§

impl<'a> Deref for BoxDict<'a>

Source§

type Target = dyn Dict + 'a

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Dict for BoxDict<'_>

Source§

fn words(&self) -> &[&str]

Return the full word list.
Source§

fn hash(&self) -> &[u8; 32]

Return the unique BLAKE2b256 hash of this word list.
Source§

impl<'a> FromIterator<&'a str> for BoxDict<'a>

Source§

fn from_iter<T: IntoIterator<Item = &'a str>>(iter: T) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for BoxDict<'a>

§

impl<'a> RefUnwindSafe for BoxDict<'a>

§

impl<'a> Send for BoxDict<'a>

§

impl<'a> Sync for BoxDict<'a>

§

impl<'a> Unpin for BoxDict<'a>

§

impl<'a> UnsafeUnpin for BoxDict<'a>

§

impl<'a> UnwindSafe for BoxDict<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.