pub enum Error {
Show 26 variants Call(CallError), Transport(Error), Internal(SendError), InvalidResponse(Mismatch<String>), RestartNeeded(String), ParseError(Error), InvalidSubscriptionId, InvalidRequestId, UnregisteredNotification(String), DuplicateRequestId, MethodAlreadyRegistered(String), MethodNotFound(String), SubscriptionNameConflict(String), RequestTimeout, MaxSlotsExceeded, AlreadyStopped, EmptyAllowList(&'static str), HttpHeaderRejected(&'static str, String), ResourceAtCapacity(&'static str), ResourceNameAlreadyTaken(&'static str), ResourceNameNotFoundForMethod(&'static str, &'static str), UninitializedMethod(Box<str>), MaxResourcesReached, Custom(String), HttpNotImplemented, EmptyBatchRequest,
}
Expand description

Error type.

Variants§

§

Call(CallError)

Error that occurs when a call failed.

§

Transport(Error)

Networking error or error on the low-level protocol layer.

§

Internal(SendError)

Frontend/backend channel error.

§

InvalidResponse(Mismatch<String>)

Invalid response,

§

RestartNeeded(String)

The background task has been terminated.

§

ParseError(Error)

Failed to parse the data.

§

InvalidSubscriptionId

Invalid subscription ID.

§

InvalidRequestId

Invalid request ID.

§

UnregisteredNotification(String)

Client received a notification with an unregistered method

§

DuplicateRequestId

A request with the same request ID has already been registered.

§

MethodAlreadyRegistered(String)

Method was already registered.

§

MethodNotFound(String)

Method with that name has not yet been registered.

§

SubscriptionNameConflict(String)

Subscribe and unsubscribe method names are the same.

§

RequestTimeout

Request timeout

§

MaxSlotsExceeded

Configured max number of request slots exceeded.

§

AlreadyStopped

Attempted to stop server that is already stopped.

§

EmptyAllowList(&'static str)

List passed into access control based on HTTP header verification.

§

HttpHeaderRejected(&'static str, String)

Access control verification of HTTP headers failed.

§

ResourceAtCapacity(&'static str)

Failed to execute a method because a resource was already at capacity

§

ResourceNameAlreadyTaken(&'static str)

Failed to register a resource due to a name conflict

§

ResourceNameNotFoundForMethod(&'static str, &'static str)

Failed to initialize resources for a method at startup

§

UninitializedMethod(Box<str>)

Trying to claim resources for a method execution, but the method resources have not been initialized

§

MaxResourcesReached

Failed to register a resource due to a maximum number of resources already registered

§

Custom(String)

Custom error.

§

HttpNotImplemented

Not implemented for HTTP clients.

§

EmptyBatchRequest

Empty batch request.

Implementations§

source§

impl Error

source

pub fn to_call_error<E>(err: E) -> Selfwhere E: Error + Send + Sync + 'static,

Create Error::CallError from a generic error. Useful if you don’t care about specific JSON-RPC error code and just wants to return your custom error type.

Trait Implementations§

source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<CallError> for Error

source§

fn from(source: CallError) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(conn_err: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(hyper_err: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(io_err: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(handshake_err: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for ErrorObjectOwned

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<SendError> for Error

source§

fn from(source: SendError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> MaybeSend for Twhere T: Send,