Struct parity_rpc::v1::extractors::WsDispatcher
source · [−]pub struct WsDispatcher<M: Middleware<Metadata>> { /* private fields */ }
Expand description
WebSockets middleware dispatching requests to different handles dependning on metadata.
Implementations
sourceimpl<M: Middleware<Metadata>> WsDispatcher<M>
impl<M: Middleware<Metadata>> WsDispatcher<M>
sourcepub fn new(full_handler: MetaIoHandler<Metadata, M>) -> Self
pub fn new(full_handler: MetaIoHandler<Metadata, M>) -> Self
Create new WsDispatcher
with given full handler.
Trait Implementations
sourceimpl<M: Middleware<Metadata>> Middleware<Metadata> for WsDispatcher<M>
impl<M: Middleware<Metadata>> Middleware<Metadata> for WsDispatcher<M>
type Future = Either<FutureRpcResult<M::Future, M::CallFuture>, FutureResponse>
type Future = Either<FutureRpcResult<M::Future, M::CallFuture>, FutureResponse>
A returned request future.
type CallFuture = NoopCallFuture
type CallFuture = NoopCallFuture
A returned call future.
sourcefn on_request<F, X>(
&self,
request: Request,
meta: Metadata,
process: F
) -> Either<Self::Future, X> where
F: FnOnce(Request, Metadata) -> X,
X: Future<Item = Option<Response>, Error = ()> + Send + 'static,
fn on_request<F, X>(
&self,
request: Request,
meta: Metadata,
process: F
) -> Either<Self::Future, X> where
F: FnOnce(Request, Metadata) -> X,
X: Future<Item = Option<Response>, Error = ()> + Send + 'static,
Method invoked on each request. Allows you to either respond directly (without executing RPC call) or do any additional work before and/or after processing the request. Read more
Auto Trait Implementations
impl<M> !RefUnwindSafe for WsDispatcher<M>
impl<M> Send for WsDispatcher<M>
impl<M> Sync for WsDispatcher<M>
impl<M> Unpin for WsDispatcher<M> where
M: Unpin,
impl<M> !UnwindSafe for WsDispatcher<M>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more