pub enum DetectedEncoding {
Utf8,
Utf8Bom,
Utf16Le,
Utf16Be,
Utf32Le,
Utf32Be,
Gb18030,
Unknown,
}Expand description
Encodings this tool can classify a byte stream as.
Variants§
Utf8
No BOM + strict UTF-8 valid. Pure ASCII also lands here (fast path).
Utf8Bom
Starts with EF BB BF.
Utf16Le
Starts with FF FE.
Utf16Be
Starts with FE FF.
Utf32Le
Starts with FF FE 00 00 (UTF-32LE BOM; the 4-byte prefix wins over
the 2-byte UTF-16LE check — WHATWG-style longest-BOM precedence).
Utf32Be
Starts with 00 00 FE FF (UTF-32BE BOM).
Gb18030
UTF-8 strict decode failed, GB18030 strict decode succeeded. Covers GB2312 / GBK / GB18030.
Unknown
All detectors failed. Reported & skipped — never guessed.
Implementations§
Trait Implementations§
Source§impl Clone for DetectedEncoding
impl Clone for DetectedEncoding
impl Copy for DetectedEncoding
Source§impl Debug for DetectedEncoding
impl Debug for DetectedEncoding
impl Eq for DetectedEncoding
Source§impl Hash for DetectedEncoding
impl Hash for DetectedEncoding
Source§impl PartialEq for DetectedEncoding
impl PartialEq for DetectedEncoding
impl StructuralPartialEq for DetectedEncoding
Auto Trait Implementations§
impl Freeze for DetectedEncoding
impl RefUnwindSafe for DetectedEncoding
impl Send for DetectedEncoding
impl Sync for DetectedEncoding
impl Unpin for DetectedEncoding
impl UnsafeUnpin for DetectedEncoding
impl UnwindSafe for DetectedEncoding
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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