pub struct WsHandlers {
pub on_open: Option<fn(OnOpenCallbackArgs)>,
pub on_message: Option<fn(OnMessageCallbackArgs)>,
pub on_close: Option<fn(OnCloseCallbackArgs)>,
}Expand description
Handlers initialized by the canister and triggered by the CDK.
Note: if the callbacks that you define here trap for some reason,
the CDK will disconnect the client with principal args.client_principal.
However, the client won’t be notified
until at least the next time it will try to send a message to the canister.
Fields§
§on_open: Option<fn(OnOpenCallbackArgs)>§on_message: Option<fn(OnMessageCallbackArgs)>§on_close: Option<fn(OnCloseCallbackArgs)>Trait Implementations§
Source§impl Clone for WsHandlers
impl Clone for WsHandlers
Source§fn clone(&self) -> WsHandlers
fn clone(&self) -> WsHandlers
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 WsHandlers
impl Debug for WsHandlers
Source§impl Default for WsHandlers
impl Default for WsHandlers
Source§fn default() -> WsHandlers
fn default() -> WsHandlers
Returns the “default value” for a type. Read more
Source§impl PartialEq for WsHandlers
impl PartialEq for WsHandlers
impl StructuralPartialEq for WsHandlers
Auto Trait Implementations§
impl Freeze for WsHandlers
impl RefUnwindSafe for WsHandlers
impl Send for WsHandlers
impl Sync for WsHandlers
impl Unpin for WsHandlers
impl UnwindSafe for WsHandlers
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