pub struct ExchangeError {
pub kind: String,
pub message: String,
}Expand description
A runtime exchange error. kind is the class name from the TS hierarchy
(e.g. “AuthenticationError”, “InsufficientFunds”). message is the
human-readable description.
Fields§
§kind: StringError class name, e.g. “NetworkError”, “AuthenticationError”
message: StringHuman-readable message
Implementations§
Source§impl ExchangeError
impl ExchangeError
Sourcepub fn new(kind: impl Into<String>, message: impl Into<String>) -> ExchangeError
pub fn new(kind: impl Into<String>, message: impl Into<String>) -> ExchangeError
Create a new error with the given kind and message.
Trait Implementations§
Source§impl Clone for ExchangeError
impl Clone for ExchangeError
Source§fn clone(&self) -> ExchangeError
fn clone(&self) -> ExchangeError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExchangeError
impl Debug for ExchangeError
Source§impl Display for ExchangeError
impl Display for ExchangeError
Source§impl Error for ExchangeError
impl Error for ExchangeError
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<Error> for ExchangeError
impl From<Error> for ExchangeError
Source§fn from(e: Error) -> ExchangeError
fn from(e: Error) -> ExchangeError
Converts to this type from the input type.
Source§impl From<Error> for ExchangeError
impl From<Error> for ExchangeError
Source§fn from(e: Error) -> ExchangeError
fn from(e: Error) -> ExchangeError
Converts to this type from the input type.
Source§impl From<ExchangeError> for Value
From<ExchangeError> makes error.clone() flow into &[Value]
slices without an explicit conversion — surfaces the typed error
as a [Kind] message-shaped string Value, matching how
runtime::panic_msg_to_error round-trips it back into a typed
ExchangeError for the caller.
impl From<ExchangeError> for Value
From<ExchangeError> makes error.clone() flow into &[Value]
slices without an explicit conversion — surfaces the typed error
as a [Kind] message-shaped string Value, matching how
runtime::panic_msg_to_error round-trips it back into a typed
ExchangeError for the caller.
Source§fn from(e: ExchangeError) -> Value
fn from(e: ExchangeError) -> Value
Converts to this type from the input type.
Source§impl From<ParseError> for ExchangeError
impl From<ParseError> for ExchangeError
Source§fn from(e: ParseError) -> ExchangeError
fn from(e: ParseError) -> ExchangeError
Converts to this type from the input type.
Source§impl From<ParseFloatError> for ExchangeError
impl From<ParseFloatError> for ExchangeError
Source§fn from(e: ParseFloatError) -> ExchangeError
fn from(e: ParseFloatError) -> ExchangeError
Converts to this type from the input type.
Source§impl From<ParseIntError> for ExchangeError
impl From<ParseIntError> for ExchangeError
Source§fn from(e: ParseIntError) -> ExchangeError
fn from(e: ParseIntError) -> ExchangeError
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for ExchangeError
impl Freeze for ExchangeError
impl Move for ExchangeError
impl RefUnwindSafe for ExchangeError
impl Send for ExchangeError
impl Sync for ExchangeError
impl Unpin for ExchangeError
impl UnsafeUnpin for ExchangeError
impl UnwindSafe for ExchangeError
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