Struct scale_decode::error::Error
source · pub struct Error { /* private fields */ }
Expand description
An error produced while attempting to decode some type.
Implementations§
source§impl Error
impl Error
sourcepub fn custom(error: impl CustomError) -> Error
pub fn custom(error: impl CustomError) -> Error
Construct a new, custom error.
sourcepub fn custom_str(error: &'static str) -> Error
pub fn custom_str(error: &'static str) -> Error
Construct a custom error from a static string.
sourcepub fn custom_string(error: String) -> Error
pub fn custom_string(error: String) -> Error
Construct a custom error from an owned string.
sourcepub fn at_field(self, field: impl Into<Cow<'static, str>>) -> Self
pub fn at_field(self, field: impl Into<Cow<'static, str>>) -> Self
Note which field the error occurred in.
sourcepub fn at_variant(self, variant: impl Into<Cow<'static, str>>) -> Self
pub fn at_variant(self, variant: impl Into<Cow<'static, str>>) -> Self
Note which variant the error occurred in.
Trait Implementations§
source§impl Error for Error
impl Error for Error
1.30.0 · 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 From<DecodeError> for Error
impl From<DecodeError> for Error
source§fn from(err: DecodeError) -> Error
fn from(err: DecodeError) -> Error
Converts to this type from the input type.
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