Struct sc_rpc_server::RpcMiddleware [−][src]
pub struct RpcMiddleware { /* fields omitted */ }Middleware for RPC calls
Implementations
impl RpcMiddleware[src]
impl RpcMiddleware[src]pub fn new(metrics: RpcMetrics, transport_label: &str) -> Self[src]
Create an instance of middleware.
metrics: Will be used to report statistics.transport_label: The label that is used when reporting the statistics.
Trait Implementations
impl<M: Metadata> Middleware<M> for RpcMiddleware[src]
impl<M: Metadata> Middleware<M> for RpcMiddleware[src]type Future = FutureResponse
A returned request future.
type CallFuture = FutureOutput
A returned call future.
fn on_request<F, X>(
&self,
request: Request,
meta: M,
next: F
) -> Either<FutureResponse, X> where
F: Fn(Request, M) -> X + Send + Sync,
X: Future<Item = Option<Response>, Error = ()> + Send + 'static, [src]
&self,
request: Request,
meta: M,
next: F
) -> Either<FutureResponse, X> where
F: Fn(Request, M) -> X + Send + Sync,
X: Future<Item = Option<Response>, Error = ()> + Send + 'static,
pub fn on_call<F, X>(
&self,
call: Call,
meta: M,
next: F
) -> Either<Self::CallFuture, X> where
F: Fn(Call, M) -> X + Send + Sync,
X: Future<Item = Option<Output>, Error = ()> + Send + 'static, [src]
&self,
call: Call,
meta: M,
next: F
) -> Either<Self::CallFuture, X> where
F: Fn(Call, M) -> X + Send + Sync,
X: Future<Item = Option<Output>, Error = ()> + Send + 'static,
Auto Trait Implementations
impl !RefUnwindSafe for RpcMiddleware
impl Send for RpcMiddleware
impl Sync for RpcMiddleware
impl Unpin for RpcMiddleware
impl !UnwindSafe for RpcMiddleware
Blanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> WithSubscriber for T[src]
impl<T> WithSubscriber for T[src]pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
S: Into<Dispatch>,