#[non_exhaustive]pub enum TextDecodeError {
InvalidUtf8 {
valid_up_to: usize,
error_len: Option<usize>,
},
}Expand description
Error returned when bytes cannot be decoded as UTF-8 text.
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.
InvalidUtf8
The byte sequence is not valid UTF-8.
Trait Implementations§
Source§impl Clone for TextDecodeError
impl Clone for TextDecodeError
Source§fn clone(&self) -> TextDecodeError
fn clone(&self) -> TextDecodeError
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 moreimpl Copy for TextDecodeError
Source§impl Debug for TextDecodeError
impl Debug for TextDecodeError
Source§impl Display for TextDecodeError
impl Display for TextDecodeError
impl Eq for TextDecodeError
Source§impl Error for TextDecodeError
impl Error for TextDecodeError
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<FromUtf8Error> for TextDecodeError
impl From<FromUtf8Error> for TextDecodeError
Source§fn from(error: FromUtf8Error) -> Self
fn from(error: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<Utf8Error> for TextDecodeError
impl From<Utf8Error> for TextDecodeError
Source§impl PartialEq for TextDecodeError
impl PartialEq for TextDecodeError
Source§fn eq(&self, other: &TextDecodeError) -> bool
fn eq(&self, other: &TextDecodeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TextDecodeError
Auto Trait Implementations§
impl Freeze for TextDecodeError
impl RefUnwindSafe for TextDecodeError
impl Send for TextDecodeError
impl Sync for TextDecodeError
impl Unpin for TextDecodeError
impl UnsafeUnpin for TextDecodeError
impl UnwindSafe for TextDecodeError
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