pub struct MapRequestHandler {
pub method_handlers: HashMap<String, Box<RpcMethodHandler>>,
}
Fields§
§method_handlers: HashMap<String, Box<RpcMethodHandler>>
Implementations§
Source§impl MapRequestHandler
impl MapRequestHandler
pub fn new() -> MapRequestHandler
pub fn add_notification<PARAMS: Deserialize + 'static>( &mut self, method_name: &'static str, method_fn: Box<dyn Fn(PARAMS)>, )
pub fn add_request<PARAMS: Deserialize + 'static, RET: Serialize + 'static, RET_ERROR: Serialize + 'static>( &mut self, method_name: &'static str, method_fn: Box<dyn Fn(PARAMS) -> MethodResult<RET, RET_ERROR>>, )
pub fn add_rpc_handler( &mut self, method_name: &'static str, method_handler: Box<RpcMethodHandler>, )
Trait Implementations§
Source§impl RequestHandler for MapRequestHandler
impl RequestHandler for MapRequestHandler
fn handle_request( &mut self, request_method: &str, request_params: RequestParams, completable: ResponseCompletable, )
Auto Trait Implementations§
impl Freeze for MapRequestHandler
impl !RefUnwindSafe for MapRequestHandler
impl !Send for MapRequestHandler
impl !Sync for MapRequestHandler
impl Unpin for MapRequestHandler
impl !UnwindSafe for MapRequestHandler
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