pub struct NotificationHandler;Expand description
Notification handler for WebSocket messages
Implementations§
Source§impl NotificationHandler
impl NotificationHandler
Sourcepub fn parse_notification(
&self,
data: &str,
) -> Result<JsonRpcNotification, Error>
pub fn parse_notification( &self, data: &str, ) -> Result<JsonRpcNotification, Error>
Parse a JSON-RPC notification
Sourcepub fn is_subscription_notification(
&self,
notification: &JsonRpcNotification,
) -> bool
pub fn is_subscription_notification( &self, notification: &JsonRpcNotification, ) -> bool
Check if this is a subscription notification
Sourcepub fn extract_channel(
&self,
notification: &JsonRpcNotification,
) -> Option<String>
pub fn extract_channel( &self, notification: &JsonRpcNotification, ) -> Option<String>
Extract channel from subscription notification
Sourcepub fn extract_data(&self, notification: &JsonRpcNotification) -> Option<Value>
pub fn extract_data(&self, notification: &JsonRpcNotification) -> Option<Value>
Extract data from subscription notification
Trait Implementations§
Source§impl Clone for NotificationHandler
impl Clone for NotificationHandler
Source§fn clone(&self) -> NotificationHandler
fn clone(&self) -> NotificationHandler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NotificationHandler
impl Debug for NotificationHandler
Auto Trait Implementations§
impl Freeze for NotificationHandler
impl RefUnwindSafe for NotificationHandler
impl Send for NotificationHandler
impl Sync for NotificationHandler
impl Unpin for NotificationHandler
impl UnwindSafe for NotificationHandler
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