pub struct StreamCallbacks {
pub notification: Option<Box<dyn Fn(Value) + Send + Sync>>,
pub request: Option<Box<dyn Fn(Value) -> Result<Value, String> + Send + Sync>>,
pub connection_lost: Option<Box<dyn Fn() + Send + Sync>>,
pub error: Option<Box<dyn Fn(String) + Send + Sync>>,
pub heartbeat: Option<Box<dyn Fn() + Send + Sync>>,
}Expand description
Callbacks for different types of server events
Fields§
§notification: Option<Box<dyn Fn(Value) + Send + Sync>>Notification callback
request: Option<Box<dyn Fn(Value) -> Result<Value, String> + Send + Sync>>Request callback (server asking client)
connection_lost: Option<Box<dyn Fn() + Send + Sync>>Connection lost callback
error: Option<Box<dyn Fn(String) + Send + Sync>>Error callback
heartbeat: Option<Box<dyn Fn() + Send + Sync>>Heartbeat callback
Trait Implementations§
Source§impl Debug for StreamCallbacks
impl Debug for StreamCallbacks
Source§impl Default for StreamCallbacks
impl Default for StreamCallbacks
Source§fn default() -> StreamCallbacks
fn default() -> StreamCallbacks
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for StreamCallbacks
impl !UnwindSafe for StreamCallbacks
impl Freeze for StreamCallbacks
impl Send for StreamCallbacks
impl Sync for StreamCallbacks
impl Unpin for StreamCallbacks
impl UnsafeUnpin for StreamCallbacks
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