Struct lampo_jsonrpc::JSONRPCv2
source · pub struct JSONRPCv2<T: Send + Sync + 'static> { /* private fields */ }
Implementations§
source§impl<T: Send + Sync + 'static> JSONRPCv2<T>
impl<T: Send + Sync + 'static> JSONRPCv2<T>
pub fn new(ctx: Arc<dyn Context<Ctx = T>>, path: &str) -> Result<Self, Error>
pub fn add_rpc<F>(&self, name: &str, callback: F) -> Result<(), ()>
pub fn add_connection(&mut self, key: &SocketAddr, stream: UnixStream)
pub fn send_resp(&self, key: String, resp: Response<Value>)
pub fn pop_resp(&self, key: String) -> Option<Response<Value>>
pub fn listen(self) -> Result<()>
pub fn handler(&self) -> Arc<Handler<T>>
pub fn spawn(self) -> JoinHandle<Result<()>>
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for JSONRPCv2<T>
impl<T> Send for JSONRPCv2<T>
impl<T> Sync for JSONRPCv2<T>
impl<T> Unpin for JSONRPCv2<T>
impl<T> !UnwindSafe for JSONRPCv2<T>
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