#[non_exhaustive]pub enum TextEncoding {
Utf8,
Utf8Bom,
Utf16Le,
Utf16Be,
Latin1,
}Expand description
The probable encoding of a FileClass::SourceText file.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Utf8
Valid UTF-8 (which includes pure ASCII), no BOM.
Utf8Bom
Valid UTF-8 after a leading EF BB BF byte-order mark.
Utf16Le
UTF-16 little-endian, identified by its FF FE BOM. (BOM-less UTF-16
is indistinguishable from binary here and classifies as Binary.)
Utf16Be
UTF-16 big-endian, identified by its FE FF BOM.
Latin1
Not valid UTF-8, but text-like: some legacy 8-bit encoding. Decoding as Latin-1 (ISO-8859-1) is lossless, though the true encoding may be Windows-1252, another ISO-8859 part, or a multi-byte legacy encoding.
Trait Implementations§
Source§impl Clone for TextEncoding
impl Clone for TextEncoding
impl Copy for TextEncoding
Source§impl Debug for TextEncoding
impl Debug for TextEncoding
impl Eq for TextEncoding
Source§impl Hash for TextEncoding
impl Hash for TextEncoding
Source§impl PartialEq for TextEncoding
impl PartialEq for TextEncoding
impl StructuralPartialEq for TextEncoding
Auto Trait Implementations§
impl Forget for TextEncoding
impl Freeze for TextEncoding
impl Move for TextEncoding
impl RefUnwindSafe for TextEncoding
impl Send for TextEncoding
impl Sync for TextEncoding
impl Unpin for TextEncoding
impl UnsafeUnpin for TextEncoding
impl UnwindSafe for TextEncoding
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