pub struct Server { /* private fields */ }
Expand description
JSONRPC server context structure.
Implementations§
Source§impl Server
impl Server
pub fn new<S>(tag: S) -> Self
Sourcepub fn handle<P, R, F>(&mut self, method: &'static str, f: F) -> &mut Self
pub fn handle<P, R, F>(&mut self, method: &'static str, f: F) -> &mut Self
Register jsonrpc server sync handler
Sourcepub fn async_handle<P, R, F, FR>(
&mut self,
method: &'static str,
f: F,
) -> &mut Self
pub fn async_handle<P, R, F, FR>( &mut self, method: &'static str, f: F, ) -> &mut Self
Register jsonrpc server async handler
The register async handler be required to implement Clone
trait.
pub fn accept<C: TransportChannel>(&mut self, channel: C)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnwindSafe for Server
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