pub struct CallError {
pub code: ErrorCode,
pub message: String,
}Expand description
The failure of one call.
A method of an extension returns it, and the host gets the code and the message. A call of a host service returns it when the host refuses or fails the call.
Fields§
§code: ErrorCodeThe reason for the failure.
message: StringA message in English for the user.
Implementations§
Source§impl CallError
impl CallError
Sourcepub fn new(code: ErrorCode, message: impl Into<String>) -> Self
pub fn new(code: ErrorCode, message: impl Into<String>) -> Self
Makes an error with a code and a message.
Sourcepub fn failed(message: impl Into<String>) -> Self
pub fn failed(message: impl Into<String>) -> Self
Makes an error with the code ErrorCode::Failed.
Sourcepub fn cancelled() -> Self
pub fn cancelled() -> Self
Makes the error that a method returns when it stops because
crate::Call::is_cancelled is true.
Trait Implementations§
impl Eq for CallError
Source§impl Error for CallError
impl Error for CallError
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()
impl StructuralPartialEq for CallError
Auto Trait Implementations§
impl Forget for CallError
impl Freeze for CallError
impl Move for CallError
impl RefUnwindSafe for CallError
impl Send for CallError
impl Sync for CallError
impl Unpin for CallError
impl UnsafeUnpin for CallError
impl UnwindSafe for CallError
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