Struct utf8::Incomplete
source · pub struct Incomplete {
pub buffer: [u8; 4],
pub buffer_len: u8,
}
Fields§
§buffer: [u8; 4]
§buffer_len: u8
Implementations§
source§impl Incomplete
impl Incomplete
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
pub fn new(bytes: &[u8]) -> Self
sourcepub fn try_complete<'input>(
&mut self,
input: &'input [u8],
) -> Option<(Result<&str, &[u8]>, &'input [u8])>
pub fn try_complete<'input>( &mut self, input: &'input [u8], ) -> Option<(Result<&str, &[u8]>, &'input [u8])>
None
: still incomplete, calltry_complete
again with more input. If no more input is available, this is invalid byte sequence.Some((result, remaining_input))
: We’re done with thisIncomplete
. To keep decoding, passremaining_input
todecode()
.
pub(crate) fn take_buffer(&mut self) -> &[u8] ⓘ
Trait Implementations§
source§impl Clone for Incomplete
impl Clone for Incomplete
source§fn clone(&self) -> Incomplete
fn clone(&self) -> Incomplete
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Incomplete
impl Debug for Incomplete
impl Copy for Incomplete
Auto Trait Implementations§
impl Freeze for Incomplete
impl RefUnwindSafe for Incomplete
impl Send for Incomplete
impl Sync for Incomplete
impl Unpin for Incomplete
impl UnwindSafe for Incomplete
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)