#[non_exhaustive]pub enum Charset {
Utf8,
Supported(String),
Unknown(String),
}Expand description
What decoding a body needs, given its declared charset.
Non-exhaustive: the set of recognized encodings is encoding_rs’, not ours,
and this should be able to grow without breaking callers again.
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
UTF-8 (or nothing declared): decoded as UTF-8, lossily.
Supported(String)
A label we can decode exactly. Carries the encoding’s canonical name.
Unknown(String)
A label no known encoding matches. Decoded as UTF-8, which will mangle it, and reported so the caller can see why.
Trait Implementations§
impl Eq for Charset
impl StructuralPartialEq for Charset
Auto Trait Implementations§
impl Freeze for Charset
impl RefUnwindSafe for Charset
impl Send for Charset
impl Sync for Charset
impl Unpin for Charset
impl UnsafeUnpin for Charset
impl UnwindSafe for Charset
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