pub struct Config { /* private fields */ }Available on crate feature
ws only.Expand description
Configuration for compio-ws.
§API Interface
_with_config functions in this crate accept impl Into<Config>, so
following are all valid:
ConfigWebSocketConfig(use custom WebSocket config with default remaining settings)None(use default value)
Implementations§
Source§impl Config
impl Config
Sourcepub fn websocket_config(&self) -> Option<&WebSocketConfig>
pub fn websocket_config(&self) -> Option<&WebSocketConfig>
Get the WebSocket configuration.
Sourcepub fn buffer_size_base(&self) -> usize
pub fn buffer_size_base(&self) -> usize
Get the base buffer size.
Sourcepub fn buffer_size_limit(&self) -> usize
pub fn buffer_size_limit(&self) -> usize
Get the maximum buffer size.
Sourcepub fn with_buffer_size_base(self, size: usize) -> Config
pub fn with_buffer_size_base(self, size: usize) -> Config
Set custom base buffer size.
Default to 128 KiB.
Sourcepub fn with_buffer_size_limit(self, size: usize) -> Config
pub fn with_buffer_size_limit(self, size: usize) -> Config
Set custom maximum buffer size.
Default to 64 MiB.
Sourcepub fn with_buffer_sizes(self, base: usize, limit: usize) -> Config
pub fn with_buffer_sizes(self, base: usize, limit: usize) -> Config
Set custom buffer sizes.
Default to 128 KiB for base and 64 MiB for limit.
Sourcepub fn disable_nagle(self, disable: bool) -> Config
pub fn disable_nagle(self, disable: bool) -> Config
Disable Nagle’s algorithm, i.e. set_nodelay(true).
Default to false. If you don’t know what the Nagle’s algorithm is,
better leave it to false.
Trait Implementations§
Source§impl From<WebSocketConfig> for Config
impl From<WebSocketConfig> for Config
Source§fn from(config: WebSocketConfig) -> Config
fn from(config: WebSocketConfig) -> Config
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more