#[non_exhaustive]pub struct WebSocketConfig {
pub max_message_size: Option<usize>,
pub max_frame_size: Option<usize>,
}Expand description
Configuration applied when establishing a websocket connection.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_message_size: Option<usize>Maximum incoming websocket message size in bytes.
None means no limit.
max_frame_size: Option<usize>Maximum incoming websocket frame size in bytes.
None means no limit.
Implementations§
Source§impl WebSocketConfig
impl WebSocketConfig
Sourcepub const fn with_max_message_size(
self,
max_message_size: Option<usize>,
) -> Self
pub const fn with_max_message_size( self, max_message_size: Option<usize>, ) -> Self
Override the maximum incoming websocket message size in bytes.
None means no limit.
Defaults to 64 MiB.
Sourcepub const fn with_max_frame_size(self, max_frame_size: Option<usize>) -> Self
pub const fn with_max_frame_size(self, max_frame_size: Option<usize>) -> Self
Override the maximum incoming websocket frame size in bytes.
None means no limit.
Defaults to 16 MiB.
Trait Implementations§
Source§impl Clone for WebSocketConfig
impl Clone for WebSocketConfig
Source§fn clone(&self) -> WebSocketConfig
fn clone(&self) -> WebSocketConfig
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 WebSocketConfig
impl Debug for WebSocketConfig
Auto Trait Implementations§
impl Freeze for WebSocketConfig
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