pub enum PolicyMiddlewareError<M: Middleware, P: Policy> {
PolicyError(P::Error),
MiddlewareError(M::Error),
}Expand description
Error thrown when the client interacts with the policy middleware.
Variants§
PolicyError(P::Error)
Thrown when the internal policy errors
MiddlewareError(M::Error)
Thrown when an internal middleware errors
Trait Implementations§
source§impl<M: Debug + Middleware, P: Debug + Policy> Debug for PolicyMiddlewareError<M, P>where
P::Error: Debug,
M::Error: Debug,
impl<M: Debug + Middleware, P: Debug + Policy> Debug for PolicyMiddlewareError<M, P>where P::Error: Debug, M::Error: Debug,
source§impl<M: Middleware, P: Policy> Display for PolicyMiddlewareError<M, P>
impl<M: Middleware, P: Policy> Display for PolicyMiddlewareError<M, P>
source§impl<M: Middleware, P: Policy> Error for PolicyMiddlewareError<M, P>where
Self: Debug + Display,
impl<M: Middleware, P: Policy> Error for PolicyMiddlewareError<M, P>where Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl<M: Middleware, P: Policy> MiddlewareError for PolicyMiddlewareError<M, P>
impl<M: Middleware, P: Policy> MiddlewareError for PolicyMiddlewareError<M, P>
§type Inner = <M as Middleware>::Error
type Inner = <M as Middleware>::Error
The
Inner type is the next lower middleware layer’s error type.source§fn from_err(src: M::Error) -> Self
fn from_err(src: M::Error) -> Self
Convert the next lower middleware layer’s error to this layer’s error
source§fn as_inner(&self) -> Option<&Self::Inner>
fn as_inner(&self) -> Option<&Self::Inner>
Attempt to convert this error to the next lower middleware’s error.
Conversion fails if the error is not from an inner layer (i.e. the
error originates at this middleware layer)
source§fn is_inner(&self) -> bool
fn is_inner(&self) -> bool
Returns
true if the underlying error stems from a lower middleware
layersource§fn as_serde_error(&self) -> Option<&Error>
fn as_serde_error(&self) -> Option<&Error>
Access an underlying
serde_json error (if any) Read moresource§fn is_serde_error(&self) -> bool
fn is_serde_error(&self) -> bool
Returns
true if the underlying error is a serde_json (de)serialization
error. This method can be used to identifysource§fn as_provider_error(&self) -> Option<&ProviderError>
fn as_provider_error(&self) -> Option<&ProviderError>
Attempts to access an underlying
ProviderError, usually by
traversing the entire middleware stack. Access fails if the underlying
error is not a ProviderErrorsource§fn from_provider_err(p: ProviderError) -> Self
fn from_provider_err(p: ProviderError) -> Self
Convert a
ProviderError to this type, by successively wrapping it
in the error types of all lower middlewaresource§fn as_error_response(&self) -> Option<&JsonRpcError>
fn as_error_response(&self) -> Option<&JsonRpcError>
Access an underlying JSON-RPC error (if any) Read more
source§fn is_error_response(&self) -> bool
fn is_error_response(&self) -> bool
Returns
true if the underlying error is a JSON-RPC error responseAuto Trait Implementations§
impl<M, P> RefUnwindSafe for PolicyMiddlewareError<M, P>where <M as Middleware>::Error: RefUnwindSafe, <P as Policy>::Error: RefUnwindSafe,
impl<M, P> Send for PolicyMiddlewareError<M, P>
impl<M, P> Sync for PolicyMiddlewareError<M, P>
impl<M, P> Unpin for PolicyMiddlewareError<M, P>where <M as Middleware>::Error: Unpin, <P as Policy>::Error: Unpin,
impl<M, P> UnwindSafe for PolicyMiddlewareError<M, P>where <M as Middleware>::Error: UnwindSafe, <P as Policy>::Error: UnwindSafe,
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