pub struct Error<E> { /* private fields */ }
Expand description
Encoding error.
Implementations§
Source§impl<E> Error<E>
impl<E> Error<E>
Sourcepub fn message(msg: &'static str) -> Self
pub fn message(msg: &'static str) -> Self
Construct an error with a generic message.
With feature "alloc"
any type T: Display
is accepted which allows
formatted strings. Otherwise only a &'static str
can be used as a
message.
Sourcepub fn with_message(self, msg: &'static str) -> Self
pub fn with_message(self, msg: &'static str) -> Self
Add a message to this error value.
With feature "alloc"
any type T: Display
is accepted which allows
formatted strings. Otherwise only a &'static str
can be used as a
message.
pub fn is_message(&self) -> bool
pub fn is_write(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for Error<E>where
E: Freeze,
impl<E> RefUnwindSafe for Error<E>where
E: RefUnwindSafe,
impl<E> Send for Error<E>where
E: Send,
impl<E> Sync for Error<E>where
E: Sync,
impl<E> Unpin for Error<E>where
E: Unpin,
impl<E> UnwindSafe for Error<E>where
E: 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
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.