Struct ic_websocket_cdk::types::WsHandlers
source · 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 copy 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
source§fn eq(&self, other: &WsHandlers) -> bool
fn eq(&self, other: &WsHandlers) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for WsHandlers
Auto Trait Implementations§
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