pub struct Limits { /* private fields */ }
Expand description
Configuration for limitations on reading of Message
s from a
WebSocketStream
to prevent high memory usage caused by malicious actors.
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn max_payload_len(self, size: Option<usize>) -> Self
pub fn max_payload_len(self, size: Option<usize>) -> Self
Sets the maximum allowed payload length. None
equals no limit.
The default is 64 MiB.
Sourcepub fn set_max_payload_len(&mut self, size: Option<usize>)
pub fn set_max_payload_len(&mut self, size: Option<usize>)
See max_payload_len
.
Trait Implementations§
impl Copy for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnwindSafe for Limits
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