Struct bcder::decode::DecodeError
source · [−]pub struct DecodeError<S> { /* private fields */ }
Expand description
An error happened while decoding data.
This can either be a source error – which the type is generic over – or a content error annotated with the position in the source where it happened.
Implementations
sourceimpl<S> DecodeError<S>
impl<S> DecodeError<S>
sourcepub fn content(error: impl Into<ContentError>, pos: Pos) -> Self
pub fn content(error: impl Into<ContentError>, pos: Pos) -> Self
Creates a decode error from a content error and a position.
sourceimpl DecodeError<Infallible>
impl DecodeError<Infallible>
sourcepub fn convert<S>(self) -> DecodeError<S>
pub fn convert<S>(self) -> DecodeError<S>
Converts a decode error from an infallible source into another error.
Trait Implementations
sourceimpl<S: Debug> Debug for DecodeError<S>
impl<S: Debug> Debug for DecodeError<S>
sourceimpl<S: Display> Display for DecodeError<S>
impl<S: Display> Display for DecodeError<S>
sourceimpl<S: Display + Debug> Error for DecodeError<S>
impl<S: Display + Debug> Error for DecodeError<S>
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>
🔬 This is a nightly-only experimental API. (
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
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
sourceimpl From<DecodeError<Infallible>> for ContentError
impl From<DecodeError<Infallible>> for ContentError
sourcefn from(err: DecodeError<Infallible>) -> Self
fn from(err: DecodeError<Infallible>) -> Self
Converts to this type from the input type.
sourceimpl<S> From<S> for DecodeError<S>
impl<S> From<S> for DecodeError<S>
Auto Trait Implementations
impl<S> !RefUnwindSafe for DecodeError<S>
impl<S> Send for DecodeError<S> where
S: Send,
impl<S> Sync for DecodeError<S> where
S: Sync,
impl<S> Unpin for DecodeError<S> where
S: Unpin,
impl<S> !UnwindSafe for DecodeError<S>
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