pub enum Error {
JsonRpc(Error),
Json(Error),
DecodeHex(FromHexError),
Model(Box<dyn Error + Send + Sync + 'static>),
InvalidCookieFile,
InvalidUrl(String),
HexToArray(HexToArrayError),
Io(Error),
TryFromInt(TryFromIntError),
}Expand description
Errors that can occur when using the Bitcoin RPC client.
Variants§
JsonRpc(Error)
JSON-RPC error from the server.
Json(Error)
JSON serialization/deserialization error.
DecodeHex(FromHexError)
Hex deserialization error.
Model(Box<dyn Error + Send + Sync + 'static>)
Error converting a version-specific RPC type into the model type.
InvalidCookieFile
Invalid or corrupted cookie file.
InvalidUrl(String)
The provided URL is syntactically incorrect.
HexToArray(HexToArrayError)
Hash parsing error.
Io(Error)
I/O error (e.g., reading cookie file, network issues).
TryFromInt(TryFromIntError)
Error when converting an integer type to a smaller type due to overflow.
Implementations§
Source§impl Error
Extension methods for the client error type.
impl Error
Extension methods for the client error type.
Sourcepub fn is_not_found_error(&self) -> bool
pub fn is_not_found_error(&self) -> bool
Returns true if this is a “not found” error returned by bitcoind.
bitcoind returns error code -5 (RPC_INVALID_ADDRESS_OR_KEY)
whenever a requested block hash, transaction ID, address, or similar object
does not exist on the node.
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)>
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<FromHexError> for Error
Available on crate feature bitreq only.
impl From<FromHexError> for Error
Available on crate feature
bitreq only.Source§fn from(e: FromHexError) -> Self
fn from(e: FromHexError) -> Self
Converts to this type from the input type.
Source§impl From<HexToArrayError> for Error
Available on crate feature bitreq only.
impl From<HexToArrayError> for Error
Available on crate feature
bitreq only.Source§fn from(e: HexToArrayError) -> Self
fn from(e: HexToArrayError) -> Self
Converts to this type from the input type.
Source§impl From<TryFromIntError> for Error
Available on crate feature bitreq only.
impl From<TryFromIntError> for Error
Available on crate feature
bitreq only.Source§fn from(e: TryFromIntError) -> Self
fn from(e: TryFromIntError) -> 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