pub struct RpcError { /* private fields */ }
Expand description
An error type returned by failing RPC methods.
Implementations§
Source§impl RpcError
impl RpcError
Sourcepub fn new(message: String, code: RpcErrorKind) -> Self
pub fn new(message: String, code: RpcErrorKind) -> Self
Construct a new RpcError
with the provided message and error code.
Sourcepub fn set_datum<D>(
&mut self,
keyword: String,
datum: D,
) -> Result<(), InvalidRpcIdentifier>
pub fn set_datum<D>( &mut self, keyword: String, datum: D, ) -> Result<(), InvalidRpcIdentifier>
Replace the data
field named keyword
, if any, with the object datum
.
Note that to conform with the spec, keyword must be a C identifier prefixed with a
namespace, as in rpc:missing_features
Sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Return true if this is an internal error.
Trait Implementations§
Source§impl From<InvokeError> for RpcError
impl From<InvokeError> for RpcError
Source§fn from(err: InvokeError) -> Self
fn from(err: InvokeError) -> Self
Converts to this type from the input type.
Source§impl From<LookupError> for RpcError
impl From<LookupError> for RpcError
Source§fn from(err: LookupError) -> Self
fn from(err: LookupError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RpcError
impl !RefUnwindSafe for RpcError
impl Send for RpcError
impl !Sync for RpcError
impl Unpin for RpcError
impl !UnwindSafe for RpcError
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.