pub enum Error {
Io {
source: Error,
context: String,
},
Decode(String),
Encode(String),
Conversion {
input: String,
desired_type: &'static str,
},
Utf8 {
source: Utf8Error,
context: String,
},
}Expand description
An error that can occur while processing DBN data.
Variants§
Io
An I/O error while reading or writing DBN or another encoding.
Decode(String)
An error while decoding from DBN.
Encode(String)
An error with text encoding.
Conversion
Fields
An conversion error between types or encodings.
Utf8
Fields
An error with conversion of bytes to UTF-8.
Implementations§
source§impl Error
impl Error
sourcepub fn io(error: Error, context: impl ToString) -> Self
pub fn io(error: Error, context: impl ToString) -> Self
Creates a new I/O dbn::Error.
sourcepub fn decode(msg: impl ToString) -> Self
pub fn decode(msg: impl ToString) -> Self
Creates a new decode dbn::Error.
sourcepub fn encode(msg: impl ToString) -> Self
pub fn encode(msg: impl ToString) -> Self
Creates a new encode dbn::Error.
sourcepub fn conversion<T>(input: impl ToString) -> Self
pub fn conversion<T>(input: impl ToString) -> Self
Creates a new conversion dbn::Error where desired_type is T.
sourcepub fn utf8(error: Utf8Error, context: impl ToString) -> Self
pub fn utf8(error: Utf8Error, context: impl ToString) -> Self
Creates a new UTF-8 dbn::Error.
Trait Implementations§
source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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