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 {
inner: Error,
index: usize,
},
LockFailed {
type_name: &'static str,
},
InvalidSystemTime {
inner: SystemTimeError,
time: Box<SystemTime>,
},
Serde(EncodeError),
}
Expand description
Errors that can be encountered by encoding a type
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.
UnexpectedEnd
The writer ran out of storage.
RefCellAlreadyBorrowed
Fields
§
inner: BorrowError
The inner borrow error
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
The targeted writer encountered an std::io::Error
LockFailed
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: Box<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§
source§impl Debug for EncodeError
impl Debug for EncodeError
source§impl Display for EncodeError
impl Display for EncodeError
source§impl Error for EncodeError
Available on crate feature serde
only.
impl Error for EncodeError
Available on crate feature
serde
only.source§impl Error for EncodeError
impl Error for EncodeError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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 Into<EncodeError> for EncodeError
Available on crate feature serde
only.
impl Into<EncodeError> for EncodeError
Available on crate feature
serde
only.source§fn into(self) -> EncodeError
fn into(self) -> EncodeError
Converts this type into the (usually inferred) input type.