pub enum CharsetDecodeErrorKind {
MalformedSequence {
value: Option<u32>,
},
IncompleteSequence {
required: usize,
available: usize,
},
InvalidCodePoint {
value: u32,
},
}Expand description
Classifies failures detected while decoding encoded units into Unicode text.
Variants§
MalformedSequence
The input units do not form a well-formed encoded sequence.
IncompleteSequence
The closed input ended before a complete character was available.
Fields
InvalidCodePoint
The decoded numeric value is not a valid Unicode scalar value.
Implementations§
Source§impl CharsetDecodeErrorKind
impl CharsetDecodeErrorKind
Sourcepub const fn required(self) -> Option<usize>
pub const fn required(self) -> Option<usize>
Returns the number of required input units for this kind, if available.
§Returns
Some(required)forSelf::IncompleteSequence;Nonefor all other variants.
Sourcepub const fn available(self) -> Option<usize>
pub const fn available(self) -> Option<usize>
Returns the number of currently available input units for this kind, if available.
§Returns
Some(available)forSelf::IncompleteSequence;Nonefor all other variants.
Sourcepub const fn value(self) -> Option<u32>
pub const fn value(self) -> Option<u32>
Returns the raw malformed value associated with this decoding error, if any.
§Returns
Some(value)forSelf::MalformedSequencewhen a specific malformed unit value is available.Some(value)forSelf::InvalidCodePoint.Nonefor other variants.
Trait Implementations§
Source§impl Clone for CharsetDecodeErrorKind
impl Clone for CharsetDecodeErrorKind
Source§fn clone(&self) -> CharsetDecodeErrorKind
fn clone(&self) -> CharsetDecodeErrorKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CharsetDecodeErrorKind
impl Debug for CharsetDecodeErrorKind
Source§impl Display for CharsetDecodeErrorKind
impl Display for CharsetDecodeErrorKind
Source§impl Error for CharsetDecodeErrorKind
impl Error for CharsetDecodeErrorKind
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for CharsetDecodeErrorKind
impl PartialEq for CharsetDecodeErrorKind
Source§fn eq(&self, other: &CharsetDecodeErrorKind) -> bool
fn eq(&self, other: &CharsetDecodeErrorKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CharsetDecodeErrorKind
impl Eq for CharsetDecodeErrorKind
impl StructuralPartialEq for CharsetDecodeErrorKind
Auto Trait Implementations§
impl Freeze for CharsetDecodeErrorKind
impl RefUnwindSafe for CharsetDecodeErrorKind
impl Send for CharsetDecodeErrorKind
impl Sync for CharsetDecodeErrorKind
impl Unpin for CharsetDecodeErrorKind
impl UnsafeUnpin for CharsetDecodeErrorKind
impl UnwindSafe for CharsetDecodeErrorKind
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