pub enum Error {
Core(CoreError),
Convert(ConversionError),
Decode(CodecError),
Gstd(UsageError),
ErrorReply(ErrorReplyPayload, ErrorReplyReason),
UnsupportedReply(Vec<u8>),
Timeout(u32, u32),
}
Expand description
Common error type returned by API functions from other modules.
Variants§
Core(CoreError)
Error type from gcore
.
NOTE: this error could only be returned from syscalls.
Convert(ConversionError)
Conversion error.
NOTE: this error returns from incorrect bytes conversion.
Decode(CodecError)
scale-codec
decoding error.
NOTE: this error returns from APIs that return specific Decode
types.
Gstd(UsageError)
Gstd API usage error.
Note: this error returns from gstd
APIs in case of invalid arguments.
ErrorReply(ErrorReplyPayload, ErrorReplyReason)
Received error reply while awaited response from another actor.
NOTE: this error could only be returned from async messaging.
UnsupportedReply(Vec<u8>)
Received reply that couldn’t be identified as successful or not due to unsupported reply code.
NOTE: this error could only be returned from async messaging.
Timeout(u32, u32)
Timeout reached while expecting for reply.
NOTE: this error could only be returned from async messaging.
Implementations§
source§impl Error
impl Error
sourcepub fn timed_out(&self) -> bool
pub fn timed_out(&self) -> bool
Check whether an error is Error::Timeout
.
sourcepub fn error_reply_str(&self) -> Option<&str>
pub fn error_reply_str(&self) -> Option<&str>
Check whether an error is Error::ErrorReply
and return its str
representation.
Trait Implementations§
source§impl From<ConversionError> for Error
impl From<ConversionError> for Error
source§fn from(err: ConversionError) -> Self
fn from(err: ConversionError) -> Self
impl Eq for Error
impl StructuralPartialEq for Error
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)