#[non_exhaustive]pub enum Error {
Io {
source: Error,
context: String,
},
Decode(String),
Encode(String),
Conversion {
input: String,
desired_type: &'static str,
},
Utf8 {
source: Utf8Error,
context: String,
},
BadArgument {
param_name: String,
desc: String,
},
}
Expand description
An error that can occur while processing DBN data.
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.
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
An conversion error between types or encodings.
Fields
Utf8
An error with conversion of bytes to UTF-8.
Fields
BadArgument
An invalid argument was passed to a function.
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 Freeze for Error
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