Enum encoding_rs::DecoderLifeCycle
source · pub(crate) enum DecoderLifeCycle {
AtStart,
AtUtf8Start,
AtUtf16BeStart,
AtUtf16LeStart,
SeenUtf8First,
SeenUtf8Second,
SeenUtf16BeFirst,
SeenUtf16LeFirst,
ConvertingWithPendingBB,
Converting,
Finished,
}
Expand description
Tracks the life cycle of a decoder from BOM sniffing to conversion to end.
Variants§
AtStart
The decoder has seen no input yet.
AtUtf8Start
The decoder has seen no input yet but expects UTF-8.
AtUtf16BeStart
The decoder has seen no input yet but expects UTF-16BE.
AtUtf16LeStart
The decoder has seen no input yet but expects UTF-16LE.
SeenUtf8First
The decoder has seen EF.
SeenUtf8Second
The decoder has seen EF, BB.
SeenUtf16BeFirst
The decoder has seen FE.
SeenUtf16LeFirst
The decoder has seen FF.
ConvertingWithPendingBB
Saw EF, BB but not BF, there was a buffer boundary after BB and the underlying decoder reported EF as an error, so we need to remember to push BB before the next buffer.
Converting
No longer looking for a BOM and EOF not yet seen.
Finished
EOF has been seen.
Trait Implementations§
source§impl Clone for DecoderLifeCycle
impl Clone for DecoderLifeCycle
source§fn clone(&self) -> DecoderLifeCycle
fn clone(&self) -> DecoderLifeCycle
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 DecoderLifeCycle
impl Debug for DecoderLifeCycle
source§impl PartialEq for DecoderLifeCycle
impl PartialEq for DecoderLifeCycle
source§fn eq(&self, other: &DecoderLifeCycle) -> bool
fn eq(&self, other: &DecoderLifeCycle) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for DecoderLifeCycle
impl StructuralPartialEq for DecoderLifeCycle
Auto Trait Implementations§
impl Freeze for DecoderLifeCycle
impl RefUnwindSafe for DecoderLifeCycle
impl Send for DecoderLifeCycle
impl Sync for DecoderLifeCycle
impl Unpin for DecoderLifeCycle
impl UnwindSafe for DecoderLifeCycle
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