pub struct SubscriptionError(/* private fields */);Expand description
Error returned when a subscription fails where the error is returned as special error notification with the following format:
{"jsonrpc":"2.0", "method":"subscription_error", "params": {"subscription": "sub_id", "error": <error message from this type>}}It’s recommended to use SubscriptionError::from_json to create a new instance of this error
if the underlying error is a JSON value. That will ensure that the error is serialized
correctly.
SubscriptionError::from will serialize the error as a string, which is not
recommended and should only by used in the value of a String type.
It’s mainly provided for convenience and to allow for easy conversion any type that implements
StdError.
Implementations§
Trait Implementations§
Source§impl Clone for SubscriptionError
impl Clone for SubscriptionError
Source§impl Debug for SubscriptionError
impl Debug for SubscriptionError
Source§impl<T: ToString> From<T> for SubscriptionError
impl<T: ToString> From<T> for SubscriptionError
Auto Trait Implementations§
impl Freeze for SubscriptionError
impl RefUnwindSafe for SubscriptionError
impl Send for SubscriptionError
impl Sync for SubscriptionError
impl Unpin for SubscriptionError
impl UnsafeUnpin for SubscriptionError
impl UnwindSafe for SubscriptionError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes