Struct ic_websocket_cdk::WsInitParams
source · pub struct WsInitParams {
pub handlers: WsHandlers,
pub gateway_principal: String,
pub max_number_of_returned_messages: usize,
pub send_ack_interval_ms: u64,
pub keep_alive_timeout_ms: u64,
}Expand description
Parameters for the IC WebSocket CDK initialization. For default parameters and simpler initialization, use WsInitParams::new.
Fields§
§handlers: WsHandlersThe callback handlers for the WebSocket.
gateway_principal: StringThe principal of the WS Gateway that will be polling the canister.
max_number_of_returned_messages: usizeThe maximum number of messages to be returned in a polling iteration.
Defaults to 10.
send_ack_interval_ms: u64The interval at which to send an acknowledgement message to the client,
so that the client knows that all the messages it sent have been received by the canister (in milliseconds).
Defaults to 60_000 (60 seconds).
keep_alive_timeout_ms: u64The delay to wait for the client to send a keep alive after receiving an acknowledgement (in milliseconds).
Defaults to 10_000 (10 seconds).
Implementations§
source§impl WsInitParams
impl WsInitParams
sourcepub fn new(handlers: WsHandlers, gateway_principal: String) -> Self
pub fn new(handlers: WsHandlers, gateway_principal: String) -> Self
Creates a new instance of WsInitParams, with default interval values.
Trait Implementations§
source§impl Clone for WsInitParams
impl Clone for WsInitParams
source§fn clone(&self) -> WsInitParams
fn clone(&self) -> WsInitParams
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 moreAuto Trait Implementations§
impl RefUnwindSafe for WsInitParams
impl Send for WsInitParams
impl Sync for WsInitParams
impl Unpin for WsInitParams
impl UnwindSafe for WsInitParams
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