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