Struct jsonrpc_macros::IoDelegate
[−]
[src]
pub struct IoDelegate<T, M = ()> where
T: Send + Sync + 'static,
M: Metadata, { /* fields omitted */ }
A set of RPC methods and notifications tied to single delegate
struct.
Methods
impl<T, M> IoDelegate<T, M> where
T: Send + Sync + 'static,
M: Metadata,
[src]
T: Send + Sync + 'static,
M: Metadata,
fn new(delegate: Arc<T>) -> Self
Creates new IoDelegate
fn add_method<F>(&mut self, name: &str, method: F) where
F: Fn(&T, Params) -> Result<Value, Error>,
F: Send + Sync + 'static,
F: Fn(&T, Params) -> Result<Value, Error>,
F: Send + Sync + 'static,
fn add_async_method<F>(&mut self, name: &str, method: F) where
F: Fn(&T, Params) -> BoxFuture<Value, Error>,
F: Send + Sync + 'static,
F: Fn(&T, Params) -> BoxFuture<Value, Error>,
F: Send + Sync + 'static,
fn add_method_with_meta<F>(&mut self, name: &str, method: F) where
F: Fn(&T, Params, M) -> BoxFuture<Value, Error>,
F: Send + Sync + 'static,
F: Fn(&T, Params, M) -> BoxFuture<Value, Error>,
F: Send + Sync + 'static,
fn add_notification<F>(&mut self, name: &str, notification: F) where
F: Fn(&T, Params),
F: Send + Sync + 'static,
F: Fn(&T, Params),
F: Send + Sync + 'static,
Trait Implementations
impl<T, M> Into<HashMap<String, RemoteProcedure<M>>> for IoDelegate<T, M> where
T: Send + Sync + 'static,
M: Metadata,
[src]
T: Send + Sync + 'static,
M: Metadata,
fn into(self) -> HashMap<String, RemoteProcedure<M>>
Performs the conversion.