Struct chewing::dictionary::TrieBuf

source ·
pub struct TrieBuf { /* private fields */ }

Implementations§

Trait Implementations§

source§

impl Debug for TrieBuf

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Dictionary for TrieBuf

source§

fn lookup_first_n_phrases( &self, syllables: &dyn SyllableSlice, first: usize ) -> Vec<Phrase>

Returns first N phrases matched by the syllables. Read more
source§

fn entries(&self) -> Entries<'_>

Returns an iterator to all phrases in the dictionary.
source§

fn about(&self) -> DictionaryInfo

Returns information about the dictionary instance.
source§

fn path(&self) -> Option<&Path>

Returns the dictionary file path if it’s backed by a file.
source§

fn as_dict_mut(&mut self) -> Option<&mut dyn DictionaryMut>

source§

fn lookup_first_phrase(&self, syllables: &dyn SyllableSlice) -> Option<Phrase>

Returns the first phrase matched by the syllables. Read more
source§

fn lookup_all_phrases(&self, syllables: &dyn SyllableSlice) -> Vec<Phrase>

Returns all phrases matched by the syllables. Read more
source§

impl DictionaryMut for TrieBuf

source§

fn reopen(&mut self) -> Result<(), UpdateDictionaryError>

Reopens the dictionary if it was changed by a different process Read more
source§

fn flush(&mut self) -> Result<(), UpdateDictionaryError>

Flushes all the changes back to the filesystem Read more
source§

fn add_phrase( &mut self, syllables: &dyn SyllableSlice, phrase: Phrase ) -> Result<(), UpdateDictionaryError>

An method for updating dictionaries. Read more
source§

fn update_phrase( &mut self, syllables: &dyn SyllableSlice, phrase: Phrase, user_freq: u32, time: u64 ) -> Result<(), UpdateDictionaryError>

TODO: doc
source§

fn remove_phrase( &mut self, syllables: &dyn SyllableSlice, phrase_str: &str ) -> Result<(), UpdateDictionaryError>

TODO: doc
source§

impl Drop for TrieBuf

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<P: Into<Phrase>, const N: usize> From<[(Vec<Syllable>, Vec<P>); N]> for TrieBuf

source§

fn from(value: [(Vec<Syllable>, Vec<P>); N]) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.