pub struct StringPointer {
pub length: u32,
pub offset: u32,
}Fields§
§length: u32length of the string (in utf16 codepoint)
offset: u32offset in the CompactedStrings (in utf16 codepoint)
Implementations§
Source§impl StringPointer
impl StringPointer
Sourcepub const BASE_LENGTH_BITS: u32 = 5
pub const BASE_LENGTH_BITS: u32 = 5
bit count of the base part
Sourcepub const BASE_LENGTH_OFFSET: u32
pub const BASE_LENGTH_OFFSET: u32
offset to the base part
Sourcepub const MAX_VARIABLE_LENGTH_BITS: u32 = 12
pub const MAX_VARIABLE_LENGTH_BITS: u32 = 12
max bit count of the additional length part (in value) note that its top 1 bit is not stored in byte representation.
Sourcepub const MAX_SIMPLE_LENGTH: u32
pub const MAX_SIMPLE_LENGTH: u32
max string length that can be stored using base part only
Sourcepub const MAX_LENGTH: u32
pub const MAX_LENGTH: u32
max string length that can be stored
pub fn unchecked(length: u32, offset: u32) -> Self
pub fn checked(length: u32, offset: u32) -> SudachiResult<Self>
pub fn encode(&self) -> u32
pub fn decode(encoded: u32) -> Self
Trait Implementations§
Source§impl Clone for StringPointer
impl Clone for StringPointer
Source§fn clone(&self) -> StringPointer
fn clone(&self) -> StringPointer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StringPointer
Source§impl Debug for StringPointer
impl Debug for StringPointer
Source§impl Default for StringPointer
impl Default for StringPointer
Source§fn default() -> StringPointer
fn default() -> StringPointer
Returns the “default value” for a type. Read more
impl Eq for StringPointer
Source§impl Hash for StringPointer
impl Hash for StringPointer
Source§impl Ord for StringPointer
impl Ord for StringPointer
Source§fn cmp(&self, other: &StringPointer) -> Ordering
fn cmp(&self, other: &StringPointer) -> Ordering
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 PartialEq for StringPointer
impl PartialEq for StringPointer
Source§fn eq(&self, other: &StringPointer) -> bool
fn eq(&self, other: &StringPointer) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for StringPointer
impl PartialOrd for StringPointer
impl StructuralPartialEq for StringPointer
Auto Trait Implementations§
impl Freeze for StringPointer
impl RefUnwindSafe for StringPointer
impl Send for StringPointer
impl Sync for StringPointer
impl Unpin for StringPointer
impl UnsafeUnpin for StringPointer
impl UnwindSafe for StringPointer
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