Struct jsonrpsee_http_server::RpcModule [−][src]
pub struct RpcModule { /* fields omitted */ }
Expand description
Sets of JSON-RPC methods can be organized into a “module” that are in turn registered on server or, alternatively, merged with other modules to construct a cohesive API.
Implementations
impl RpcModule
[src]
impl RpcModule
[src]pub fn with_context<Context>(self, ctx: Context) -> RpcContextModule<Context>
[src]
pub fn with_context<Context>(self, ctx: Context) -> RpcContextModule<Context>
[src]Add context for this module, turning it into an RpcContextModule
.
pub fn register_method<R, F>(
&mut self,
method_name: &'static str,
callback: F
) -> Result<(), Error> where
F: RpcMethod<R, CallError>,
R: Serialize,
[src]
pub fn register_method<R, F>(
&mut self,
method_name: &'static str,
callback: F
) -> Result<(), Error> where
F: RpcMethod<R, CallError>,
R: Serialize,
[src]Register a new RPC method, which responds with a given callback.
pub fn register_subscription(
&mut self,
subscribe_method_name: &'static str,
unsubscribe_method_name: &'static str
) -> Result<SubscriptionSink, Error>
[src]
pub fn register_subscription(
&mut self,
subscribe_method_name: &'static str,
unsubscribe_method_name: &'static str
) -> Result<SubscriptionSink, Error>
[src]Register a new RPC subscription, with subscribe and unsubscribe methods.
pub fn into_methods(
self
) -> HashMap<&'static str, Box<dyn Fn(Id<'_>, RpcParams<'_>, &UnboundedSender<String>, usize) + 'static + Sync + Send, Global>, BuildHasherDefault<FxHasher>>
[src]
pub fn into_methods(
self
) -> HashMap<&'static str, Box<dyn Fn(Id<'_>, RpcParams<'_>, &UnboundedSender<String>, usize) + 'static + Sync + Send, Global>, BuildHasherDefault<FxHasher>>
[src]Convert a module into methods.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RpcModule
impl Send for RpcModule
impl Sync for RpcModule
impl Unpin for RpcModule
impl !UnwindSafe for RpcModule
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,