Enum bincode::error::EncodeError
source · [−]#[non_exhaustive]
pub enum EncodeError {
UnexpectedEnd,
RefCellAlreadyBorrowed {
inner: BorrowError,
type_name: &'static str,
},
Other(&'static str),
OtherString(String),
InvalidPathCharacters,
Io {
error: Error,
index: usize,
},
LockFailed {
type_name: &'static str,
},
InvalidSystemTime {
inner: SystemTimeError,
time: SystemTime,
},
Serde(EncodeError),
}
Expand description
Errors that can be encountered by encoding a type
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
UnexpectedEnd
The writer ran out of storage.
RefCellAlreadyBorrowed
Fields
inner: BorrowError
The inner borrow error
type_name: &'static str
the type name of the RefCell being encoded that is currently borrowed.
The RefCell
Other(&'static str)
An uncommon error occurred, see the inner text for more information
OtherString(String)
An uncommon error occurred, see the inner text for more information
InvalidPathCharacters
A std::path::Path
was being encoded but did not contain a valid &str
representation
Io
Fields
error: Error
The encountered error
index: usize
The amount of bytes that were written before the error occurred
The targeted writer encountered an std::io::Error
LockFailed
Fields
type_name: &'static str
The type name of the mutex for debugging purposes
The encoder tried to encode a Mutex
or RwLock
, but the locking failed
InvalidSystemTime
Fields
inner: SystemTimeError
The error that was thrown by the SystemTime
time: SystemTime
The SystemTime that caused the error
The encoder tried to encode a SystemTime
, but it was before SystemTime::UNIX_EPOCH
Serde(EncodeError)
A serde-specific error that occurred while decoding.
Trait Implementations
sourceimpl Debug for EncodeError
impl Debug for EncodeError
sourceimpl Display for EncodeError
impl Display for EncodeError
sourceimpl Error for EncodeError
impl Error for EncodeError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl Error for EncodeError
This is supported on crate feature serde
only.
impl Error for EncodeError
serde
only.sourceimpl Into<EncodeError> for EncodeError
This is supported on crate feature serde
only.
impl Into<EncodeError> for EncodeError
serde
only.sourcefn into(self) -> EncodeError
fn into(self) -> EncodeError
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for EncodeError
impl Send for EncodeError
impl Sync for EncodeError
impl Unpin for EncodeError
impl UnwindSafe for EncodeError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more