pub struct PartialUtf8 {
pub value: u32,
pub n_remain: i32,
}Expand description
Bits of a UTF-8 sequence decoded so far, carried between token pieces.
llama_partial_utf8. n_remain is the number of continuation bytes
still expected: 0 means “nothing pending”, -1 means “the byte
stream was not valid UTF-8”.
Fields§
§value: u32Bit value so far, unshifted.
n_remain: i32Continuation bytes still expected; -1 marks an invalid sequence.
Implementations§
Trait Implementations§
Source§impl Clone for PartialUtf8
impl Clone for PartialUtf8
Source§fn clone(&self) -> PartialUtf8
fn clone(&self) -> PartialUtf8
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 PartialUtf8
Source§impl Debug for PartialUtf8
impl Debug for PartialUtf8
Source§impl Default for PartialUtf8
impl Default for PartialUtf8
Source§fn default() -> PartialUtf8
fn default() -> PartialUtf8
Returns the “default value” for a type. Read more
impl Eq for PartialUtf8
Source§impl PartialEq for PartialUtf8
impl PartialEq for PartialUtf8
impl StructuralPartialEq for PartialUtf8
Auto Trait Implementations§
impl Freeze for PartialUtf8
impl RefUnwindSafe for PartialUtf8
impl Send for PartialUtf8
impl Sync for PartialUtf8
impl Unpin for PartialUtf8
impl UnsafeUnpin for PartialUtf8
impl UnwindSafe for PartialUtf8
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,
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