Struct witty_jsonrpc::server::SingleTransportServer
source · pub struct SingleTransportServer<H>where
H: Handler,{ /* private fields */ }Expand description
A simple JSON-RPC server that only uses one transport.
Implementations§
source§impl<H> SingleTransportServer<H>where
H: Handler,
impl<H> SingleTransportServer<H>where H: Handler,
sourcepub fn from_transport<T>(transport: T) -> Selfwhere
T: Transport<H> + 'static,
pub fn from_transport<T>(transport: T) -> Selfwhere T: Transport<H> + 'static,
Create a simple server around an already existing instance of a transport.
Trait Implementations§
source§impl<H> Server<H> for SingleTransportServer<H>where
H: Handler,
impl<H> Server<H> for SingleTransportServer<H>where H: Handler,
§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)
)where
F: SubscribeRpcMethod<H::Metadata>,
G: UnsubscribeRpcMethod<H::Metadata>,
fn add_subscription<F, G>( &mut self, notification: &str, subscribe: (&str, F), unsubscribe: (&str, G) )where F: SubscribeRpcMethod<H::Metadata>, G: UnsubscribeRpcMethod<H::Metadata>,
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> !RefUnwindSafe for SingleTransportServer<H>
impl<H> !Send for SingleTransportServer<H>
impl<H> !Sync for SingleTransportServer<H>
impl<H> Unpin for SingleTransportServer<H>
impl<H> !UnwindSafe for SingleTransportServer<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