pub enum MaybeEmptyUtf8Error {
Empty(EmptySlice),
Utf8(NonEmptyUtf8Error),
}Expand description
Represents errors returned when the received bytes are either empty or not valid UTF-8.
This is returned from from_utf8 and from_utf8_mut methods on NonEmptyStr.
Variants§
Empty(EmptySlice)
The received bytes are empty.
Utf8(NonEmptyUtf8Error)
The received bytes are non-empty, but not valid UTF-8.
Trait Implementations§
Source§impl Debug for MaybeEmptyUtf8Error
impl Debug for MaybeEmptyUtf8Error
Source§impl Display for MaybeEmptyUtf8Error
impl Display for MaybeEmptyUtf8Error
Source§impl Error for MaybeEmptyUtf8Error
impl Error for MaybeEmptyUtf8Error
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<EmptySlice> for MaybeEmptyUtf8Error
impl From<EmptySlice> for MaybeEmptyUtf8Error
Source§fn from(source: EmptySlice) -> Self
fn from(source: EmptySlice) -> Self
Converts to this type from the input type.
Source§impl From<NonEmptyUtf8Error> for MaybeEmptyUtf8Error
impl From<NonEmptyUtf8Error> for MaybeEmptyUtf8Error
Source§fn from(source: NonEmptyUtf8Error) -> Self
fn from(source: NonEmptyUtf8Error) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MaybeEmptyUtf8Error
impl RefUnwindSafe for MaybeEmptyUtf8Error
impl Send for MaybeEmptyUtf8Error
impl Sync for MaybeEmptyUtf8Error
impl Unpin for MaybeEmptyUtf8Error
impl UnwindSafe for MaybeEmptyUtf8Error
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