[−]Struct rpc::MetaIoHandler
Request handler
By default compatible only with jsonrpc v2
Methods
impl<T> MetaIoHandler<T, Noop> where
T: Metadata,
[−]
impl<T> MetaIoHandler<T, Noop> where
T: Metadata,
pub fn with_compatibility(
compatibility: Compatibility
) -> MetaIoHandler<T, Noop>
[−]
pub fn with_compatibility(
compatibility: Compatibility
) -> MetaIoHandler<T, Noop>
Creates new MetaIoHandler
compatible with specified protocol version.
impl<T, S> MetaIoHandler<T, S> where
S: Middleware<T>,
T: Metadata,
[−]
impl<T, S> MetaIoHandler<T, S> where
S: Middleware<T>,
T: Metadata,
pub fn new(compatibility: Compatibility, middleware: S) -> MetaIoHandler<T, S>
[−]
pub fn new(compatibility: Compatibility, middleware: S) -> MetaIoHandler<T, S>
Creates new MetaIoHandler
pub fn with_middleware(middleware: S) -> MetaIoHandler<T, S>
[−]
pub fn with_middleware(middleware: S) -> MetaIoHandler<T, S>
Creates new MetaIoHandler
with specified middleware.
pub fn add_alias(&mut self, alias: &str, other: &str)
[−]
pub fn add_alias(&mut self, alias: &str, other: &str)
Adds an alias to a method.
pub fn add_method<F>(&mut self, name: &str, method: F) where
F: RpcMethodSimple,
[−]
pub fn add_method<F>(&mut self, name: &str, method: F) where
F: RpcMethodSimple,
Adds new supported asynchronous method
pub fn add_notification<F>(&mut self, name: &str, notification: F) where
F: RpcNotificationSimple,
[−]
pub fn add_notification<F>(&mut self, name: &str, notification: F) where
F: RpcNotificationSimple,
Adds new supported notification
pub fn add_method_with_meta<F>(&mut self, name: &str, method: F) where
F: RpcMethod<T>,
[−]
pub fn add_method_with_meta<F>(&mut self, name: &str, method: F) where
F: RpcMethod<T>,
Adds new supported asynchronous method with metadata support.
pub fn add_notification_with_meta<F>(&mut self, name: &str, notification: F) where
F: RpcNotification<T>,
[−]
pub fn add_notification_with_meta<F>(&mut self, name: &str, notification: F) where
F: RpcNotification<T>,
Adds new supported notification with metadata support.
pub fn extend_with<F>(&mut self, methods: F) where
F: Into<HashMap<String, RemoteProcedure<T>, RandomState>>,
[−]
pub fn extend_with<F>(&mut self, methods: F) where
F: Into<HashMap<String, RemoteProcedure<T>, RandomState>>,
Extend this MetaIoHandler
with methods defined elsewhere.
pub fn handle_request_sync(&self, request: &str, meta: T) -> Option<String>
[−]
pub fn handle_request_sync(&self, request: &str, meta: T) -> Option<String>
Handle given request synchronously - will block until response is available.
If you have any asynchronous methods in your RPC it is much wiser to use
handle_request
instead and deal with asynchronous requests in a non-blocking fashion.
pub fn handle_request(
&self,
request: &str,
meta: T
) -> Map<Either<FutureResult<Option<Response>, ()>, <S as Middleware<T>>::Future>, fn(Option<Response>) -> Option<String>>
[−]
pub fn handle_request(
&self,
request: &str,
meta: T
) -> Map<Either<FutureResult<Option<Response>, ()>, <S as Middleware<T>>::Future>, fn(Option<Response>) -> Option<String>>
Handle given request asynchronously.
pub fn handle_rpc_request(
&self,
request: Request,
meta: T
) -> <S as Middleware<T>>::Future
[−]
pub fn handle_rpc_request(
&self,
request: Request,
meta: T
) -> <S as Middleware<T>>::Future
Handle deserialized RPC request.
pub fn handle_call(
&self,
call: Call,
meta: T
) -> Either<Box<Future<Item = Option<Output>, Error = ()> + 'static + Send>, FutureResult<Option<Output>, ()>>
[−]
pub fn handle_call(
&self,
call: Call,
meta: T
) -> Either<Box<Future<Item = Option<Output>, Error = ()> + 'static + Send>, FutureResult<Option<Output>, ()>>
Handle single call asynchronously.
Trait Implementations
impl<T, S> Debug for MetaIoHandler<T, S> where
S: Middleware<T> + Debug,
T: Metadata + Debug,
[+]
impl<T, S> Debug for MetaIoHandler<T, S> where
S: Middleware<T> + Debug,
T: Metadata + Debug,
impl From<IoHandler<()>> for MetaIoHandler<(), Noop>
[+]
impl From<IoHandler<()>> for MetaIoHandler<(), Noop>
impl<T> Default for MetaIoHandler<T, Noop> where
T: Metadata,
[+]
impl<T> Default for MetaIoHandler<T, Noop> where
T: Metadata,
impl<T, S> Into<MetaIoHandler<T, S>> for PubSubHandler<T, S> where
S: Middleware<T>,
T: PubSubMetadata,
[+]
impl<T, S> Into<MetaIoHandler<T, S>> for PubSubHandler<T, S> where
S: Middleware<T>,
T: PubSubMetadata,
Auto Trait Implementations
impl<T, S> Send for MetaIoHandler<T, S>
impl<T, S> Send for MetaIoHandler<T, S>
impl<T, S> Sync for MetaIoHandler<T, S>
impl<T, S> Sync for MetaIoHandler<T, S>
Blanket Implementations
impl<T> From for T
[src]
[−]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
[−]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
[−]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
[−]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
[−]
impl<T> Borrow for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T
[src]
[−]
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
[−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
[−]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
[−]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T
[src]
[−]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
[−]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
[−]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> Erased for T
impl<T> Erased for T