Skip to main content

WordInfos

Struct WordInfos 

Source
pub struct WordInfos<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> WordInfos<'a>

Source

pub const ENTRIES_INITIAL_OFFSET: usize = layout::ENTRY_INITIAL_OFFSET

Source

pub const WORD_ID_ALIGNMENT_BITS: usize = layout::WORD_ID_ALIGNMENT_BITS

Source

pub const WORD_INFO_OFFSET_ALIGNMENT: usize = layout::WORD_INFO_OFFSET_ALIGNMENT

Source

pub fn from_bytes(bytes: &'a [u8]) -> WordInfos<'a>

Source

pub fn entry_id_to_offset(entry_id: EntryId) -> usize

Source

pub fn entry_ids_in_order(&self, num_total_entries: u32) -> Option<Vec<EntryId>>

Source

pub fn validate_entry_boundaries( &self, num_total_entries: u32, ) -> SudachiResult<()>

Validate that all WordInfo entries can be scanned from their binary boundaries.

Returns WordInfoError through SudachiError when an entry id cannot be derived or an entry size cannot be read.

Source

pub fn get_word_info( &self, entry_id: EntryId, subset: InfoSubset, ) -> SudachiResult<WordInfoRefData>

Auto Trait Implementations§

§

impl<'a> Freeze for WordInfos<'a>

§

impl<'a> RefUnwindSafe for WordInfos<'a>

§

impl<'a> Send for WordInfos<'a>

§

impl<'a> Sync for WordInfos<'a>

§

impl<'a> Unpin for WordInfos<'a>

§

impl<'a> UnsafeUnpin for WordInfos<'a>

§

impl<'a> UnwindSafe for WordInfos<'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<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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