pub struct MultipleTransportsServer<H>where
H: Handler,{ /* private fields */ }Expand description
A JSON-RPC server that supports using multiple transports at once.
All the transports share the same underlying IO handler.
Implementations§
Source§impl<H> MultipleTransportsServer<H>where
H: Handler,
impl<H> MultipleTransportsServer<H>where
H: Handler,
Sourcepub fn add_transport<T>(&mut self, transport: T)where
T: Transport<H> + 'static,
pub fn add_transport<T>(&mut self, transport: T)where
T: Transport<H> + 'static,
Add a transport to the server.
Sourcepub fn handle_request_sync(
&self,
request: &str,
meta: H::Metadata,
) -> Option<String>
pub fn handle_request_sync( &self, request: &str, meta: H::Metadata, ) -> Option<String>
Programmatically trigger the handling of a JSON-RPC message inside the IO handler that the server wraps.
Sourcepub fn with_runtime(self, runtime: Handle) -> Self
pub fn with_runtime(self, runtime: Handle) -> Self
Attach a tokio runtime to the server.
Trait Implementations§
Source§impl<H> Default for MultipleTransportsServer<H>
impl<H> Default for MultipleTransportsServer<H>
Source§fn default() -> MultipleTransportsServer<H>
fn default() -> MultipleTransportsServer<H>
Returns the “default value” for a type. Read more
Source§impl<H> Server<H> for MultipleTransportsServer<H>
impl<H> Server<H> for MultipleTransportsServer<H>
Source§type Error = ServerError
type Error = ServerError
The type to use as the error type within the
Results used by an implementation of this
trait.Source§fn add_method<F>(&mut self, name: &str, method: F)where
F: RpcMethodSimple,
fn add_method<F>(&mut self, name: &str, method: F)where
F: RpcMethodSimple,
Add a JSON-RPC method to the server.
Source§fn add_subscription<F, G>(
&mut self,
notification: &str,
subscribe: (&str, F),
unsubscribe: (&str, G),
)
fn add_subscription<F, G>( &mut self, notification: &str, subscribe: (&str, F), unsubscribe: (&str, G), )
Add a JSON-RPC subscription so the server.
Source§fn describe_api(&self) -> Vec<String>
fn describe_api(&self) -> Vec<String>
Get a list of all the supported JSON-RPC methods.
Auto Trait Implementations§
impl<H> Freeze for MultipleTransportsServer<H>
impl<H> !RefUnwindSafe for MultipleTransportsServer<H>
impl<H> !Send for MultipleTransportsServer<H>
impl<H> !Sync for MultipleTransportsServer<H>
impl<H> Unpin for MultipleTransportsServer<H>
impl<H> !UnwindSafe for MultipleTransportsServer<H>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more