pub struct WordRef { /* private fields */ }Expand description
Word reference
Reference which points to a entry in the system or user dictionary. Similar to the WordId but the dict id part is a flag which indicates if it is a system or user word.
Top 4 bit is 0000 - points to the word in the system dictionary. Top 4 bit is 0001 - points to the word in the user dictionary which this wordref is used in.
Implementations§
Source§impl WordRef
impl WordRef
pub const INVALID: WordRef
Sourcepub fn checked(is_system: bool, entry: u32) -> SudachiResult<WordRef>
pub fn checked(is_system: bool, entry: u32) -> SudachiResult<WordRef>
Create a new WordRef with correctness checking
Sourcepub fn resolve(&self, dict: DictId) -> WordId
pub fn resolve(&self, dict: DictId) -> WordId
Resolve the WordRef with its DictId in the dictionary
Sourcepub fn resolve_raw(raw: u32, dict: DictId) -> u32
pub fn resolve_raw(raw: u32, dict: DictId) -> u32
resolve raw
Trait Implementations§
impl Copy for WordRef
impl Eq for WordRef
Source§impl Ord for WordRef
impl Ord for WordRef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for WordRef
impl PartialOrd for WordRef
impl StructuralPartialEq for WordRef
Auto Trait Implementations§
impl Freeze for WordRef
impl RefUnwindSafe for WordRef
impl Send for WordRef
impl Sync for WordRef
impl Unpin for WordRef
impl UnsafeUnpin for WordRef
impl UnwindSafe for WordRef
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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