pub struct Error { /* private fields */ }Expand description
Errors returned by the SDK.
Implementations§
Source§impl Error
impl Error
Sourcepub fn message(&self) -> Option<&str>
pub fn message(&self) -> Option<&str>
The message provided when this Error was constructed, or None.
Sourcepub fn with_message<C>(kind: ErrorKind, message: C) -> Self
pub fn with_message<C>(kind: ErrorKind, message: C) -> Self
Create an Error with a message.
Sourcepub fn is_transport_failure(&self) -> bool
pub fn is_transport_failure(&self) -> bool
Returns true if this error indicates the transport is broken — the CLI
process exited, the connection was lost, or an I/O failure occurred.
Callers should discard the client and create a fresh one.
Sourcepub fn rpc_code(&self) -> Option<i32>
pub fn rpc_code(&self) -> Option<i32>
Returns the JSON-RPC error code if this is an ErrorKind::Rpc 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)>
Returns 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<ProtocolErrorKind> for Error
impl From<ProtocolErrorKind> for Error
Source§fn from(kind: ProtocolErrorKind) -> Self
fn from(kind: ProtocolErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<SessionErrorKind> for Error
impl From<SessionErrorKind> for Error
Source§fn from(kind: SessionErrorKind) -> Self
fn from(kind: SessionErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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