Struct holochain_websocket::WebsocketConfig
source · pub struct WebsocketConfig {
pub scheme: &'static str,
pub default_request_timeout_s: usize,
pub tcp_keepalive_s: usize,
pub max_send_queue: usize,
pub max_message_size: usize,
pub max_frame_size: usize,
pub max_pending_connections: usize,
}
Expand description
A builder-style config struct for setting up websockets.
Fields§
§scheme: &'static str
Scheme to use for urls - e.g. “ws” or “wss”. [default = “ws”]
default_request_timeout_s: usize
Seconds after which the lib will stop tracking individual request ids. [default = 30]
tcp_keepalive_s: usize
We will treat the socket as disconnected if we receive no messages in this timeframe, using the tcp keepalive mechanism. [default = 10]
max_send_queue: usize
How many items are allowed in the outgoing queue. [default = 10]
max_message_size: usize
Maximum total message size of a websocket message. [default = 64M]
max_frame_size: usize
Maximum websocket frame size. [default = 16M]
max_pending_connections: usize
Maximum number of pending new incoming connections. [default = 255]
Implementations§
source§impl WebsocketConfig
impl WebsocketConfig
sourcepub fn default_request_timeout_s(self, s: usize) -> Self
pub fn default_request_timeout_s(self, s: usize) -> Self
Builder-style setter.
sourcepub fn tcp_keepalive_s(self, s: usize) -> Self
pub fn tcp_keepalive_s(self, s: usize) -> Self
Builder-style setter.
sourcepub fn max_send_queue(self, max: usize) -> Self
pub fn max_send_queue(self, max: usize) -> Self
Builder-style setter.
sourcepub fn max_message_size(self, max: usize) -> Self
pub fn max_message_size(self, max: usize) -> Self
Builder-style setter.
sourcepub fn max_frame_size(self, max: usize) -> Self
pub fn max_frame_size(self, max: usize) -> Self
Builder-style setter.
Trait Implementations§
source§impl Debug for WebsocketConfig
impl Debug for WebsocketConfig
Auto Trait Implementations§
impl RefUnwindSafe for WebsocketConfig
impl Send for WebsocketConfig
impl Sync for WebsocketConfig
impl Unpin for WebsocketConfig
impl UnwindSafe for WebsocketConfig
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