pub struct CharsetDecodeError { /* private fields */ }Expand description
Error reported by a charset decoder.
The error always carries the charset, error kind, and input unit index at
which the failure was detected. Errors that decode a raw numeric value, such
as invalid UTF-32 units, carry that value through Self::kind and
Self::value.
Implementations§
Source§impl CharsetDecodeError
impl CharsetDecodeError
Sourcepub const fn new(
charset: Charset,
kind: CharsetDecodeErrorKind,
index: usize,
) -> Self
pub const fn new( charset: Charset, kind: CharsetDecodeErrorKind, index: usize, ) -> Self
Sourcepub const fn kind(self) -> CharsetDecodeErrorKind
pub const fn kind(self) -> CharsetDecodeErrorKind
Sourcepub const fn index(self) -> usize
pub const fn index(self) -> usize
Returns the input unit index associated with this error.
§Returns
Returns the index at which the error was detected.
Sourcepub const fn required(self) -> Option<usize>
pub const fn required(self) -> Option<usize>
Returns required input units for this decoding error, if reported.
§Returns
Returns Some(required) for CharsetDecodeErrorKind::IncompleteSequence,
otherwise None.
Sourcepub const fn available(self) -> Option<usize>
pub const fn available(self) -> Option<usize>
Returns available input units for this decoding error, if reported.
§Returns
Returns Some(available) for CharsetDecodeErrorKind::IncompleteSequence,
otherwise None.
Trait Implementations§
Source§impl Clone for CharsetDecodeError
impl Clone for CharsetDecodeError
Source§fn clone(&self) -> CharsetDecodeError
fn clone(&self) -> CharsetDecodeError
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 CharsetDecodeError
impl Debug for CharsetDecodeError
Source§impl Display for CharsetDecodeError
impl Display for CharsetDecodeError
Source§impl Error for CharsetDecodeError
impl Error for CharsetDecodeError
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 From<CharsetDecodeError> for CharsetConvertError
impl From<CharsetDecodeError> for CharsetConvertError
Source§fn from(source: CharsetDecodeError) -> Self
fn from(source: CharsetDecodeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CharsetDecodeError
impl PartialEq for CharsetDecodeError
Source§fn eq(&self, other: &CharsetDecodeError) -> bool
fn eq(&self, other: &CharsetDecodeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CharsetDecodeError
impl Eq for CharsetDecodeError
impl StructuralPartialEq for CharsetDecodeError
Auto Trait Implementations§
impl Freeze for CharsetDecodeError
impl RefUnwindSafe for CharsetDecodeError
impl Send for CharsetDecodeError
impl Sync for CharsetDecodeError
impl Unpin for CharsetDecodeError
impl UnsafeUnpin for CharsetDecodeError
impl UnwindSafe for CharsetDecodeError
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