pub struct DictionaryLoader<'a> {
pub header: Header,
pub grammar: Option<Grammar<'a>>,
pub lexicon: Lexicon<'a>,
}
Expand description
A single system or user dictionary
Fields§
§header: Header
§grammar: Option<Grammar<'a>>
§lexicon: Lexicon<'a>
Implementations§
source§impl<'a> DictionaryLoader<'a>
impl<'a> DictionaryLoader<'a>
sourcepub unsafe fn read_any_dictionary(
dictionary_bytes: &[u8],
) -> SudachiResult<DictionaryLoader<'_>>
pub unsafe fn read_any_dictionary( dictionary_bytes: &[u8], ) -> SudachiResult<DictionaryLoader<'_>>
Creates a binary dictionary from bytes
§Safety
This function is marked unsafe because it does not perform header validation
sourcepub fn read_system_dictionary(
dictionary_bytes: &[u8],
) -> SudachiResult<DictionaryLoader<'_>>
pub fn read_system_dictionary( dictionary_bytes: &[u8], ) -> SudachiResult<DictionaryLoader<'_>>
Creates a system binary dictionary from bytes
Returns Err if header version is not match
sourcepub fn read_user_dictionary(
dictionary_bytes: &[u8],
) -> SudachiResult<DictionaryLoader<'_>>
pub fn read_user_dictionary( dictionary_bytes: &[u8], ) -> SudachiResult<DictionaryLoader<'_>>
Creates a user binary dictionary from bytes
Returns Err if header version is not match
pub fn to_loaded(self) -> Option<LoadedDictionary<'a>>
Auto Trait Implementations§
impl<'a> Freeze for DictionaryLoader<'a>
impl<'a> RefUnwindSafe for DictionaryLoader<'a>
impl<'a> Send for DictionaryLoader<'a>
impl<'a> Sync for DictionaryLoader<'a>
impl<'a> Unpin for DictionaryLoader<'a>
impl<'a> UnwindSafe for DictionaryLoader<'a>
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more