pub struct FromUtf8Error<B> { /* private fields */ }Expand description
An owned byte container that failed UTF-8 validation.
The original bytes are retained so callers can inspect or recover the exact input without copying or changing its storage strategy.
Implementations§
Source§impl<B> FromUtf8Error<B>
impl<B> FromUtf8Error<B>
Sourcepub const fn utf8_error(&self) -> Utf8Error
pub const fn utf8_error(&self) -> Utf8Error
Returns the UTF-8 validation error.
Sourcepub fn into_bytes(self) -> B
pub fn into_bytes(self) -> B
Recovers the original bytes.
Trait Implementations§
Source§impl<B: Debug> Debug for FromUtf8Error<B>
impl<B: Debug> Debug for FromUtf8Error<B>
Source§impl<B> Display for FromUtf8Error<B>
impl<B> Display for FromUtf8Error<B>
Source§impl<B: Debug> Error for FromUtf8Error<B>
impl<B: Debug> Error for FromUtf8Error<B>
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()
Auto Trait Implementations§
impl<B> Freeze for FromUtf8Error<B>where
B: Freeze,
impl<B> RefUnwindSafe for FromUtf8Error<B>where
B: RefUnwindSafe,
impl<B> Send for FromUtf8Error<B>where
B: Send,
impl<B> Sync for FromUtf8Error<B>where
B: Sync,
impl<B> Unpin for FromUtf8Error<B>where
B: Unpin,
impl<B> UnsafeUnpin for FromUtf8Error<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for FromUtf8Error<B>where
B: UnwindSafe,
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
Source§impl<T> ToUtf8Bytes for T
impl<T> ToUtf8Bytes for T
Source§fn to_utf8bytes(&self) -> Utf8Bytes<Shared>
fn to_utf8bytes(&self) -> Utf8Bytes<Shared>
Available on crate features
alloc or std only.Source§fn to_compact_utf8bytes(&self) -> Utf8Bytes<Compact>
fn to_compact_utf8bytes(&self) -> Utf8Bytes<Compact>
Available on crate features
alloc or std only.