pub struct ProtocolHandler { /* private fields */ }Expand description
The main protocol handler that dispatches incoming JSON-RPC messages.
Implementations§
Source§impl ProtocolHandler
impl ProtocolHandler
Sourcepub fn new(session: Arc<Mutex<SessionManager>>) -> Self
pub fn new(session: Arc<Mutex<SessionManager>>) -> Self
Create a new protocol handler with the given session manager.
Sourcepub fn with_mode(session: Arc<Mutex<SessionManager>>, mode: MemoryMode) -> Self
pub fn with_mode(session: Arc<Mutex<SessionManager>>, mode: MemoryMode) -> Self
Create a new protocol handler with a specific memory mode.
Sourcepub fn shutdown_requested(&self) -> bool
pub fn shutdown_requested(&self) -> bool
Returns true once a shutdown request has been handled.
Sourcepub async fn handle_message(&self, msg: JsonRpcMessage) -> Option<Value>
pub async fn handle_message(&self, msg: JsonRpcMessage) -> Option<Value>
Handle an incoming JSON-RPC message and optionally return a response.
Auto Trait Implementations§
impl !Freeze for ProtocolHandler
impl !RefUnwindSafe for ProtocolHandler
impl Send for ProtocolHandler
impl Sync for ProtocolHandler
impl Unpin for ProtocolHandler
impl UnsafeUnpin for ProtocolHandler
impl !UnwindSafe for ProtocolHandler
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