pub struct Config { /* private fields */ }
Expand description
Yamux configuration.
The default configuration values are as follows:
- receive window = 256 KiB
- max. buffer size (per stream) = 1 MiB
- max. number of streams = 8192
- window update mode = on read
- read after close = true
- split send size = 16 KiB
Implementations§
source§impl Config
impl Config
sourcepub fn set_receive_window(&mut self, n: u32) -> &mut Self
pub fn set_receive_window(&mut self, n: u32) -> &mut Self
Set the receive window per stream (must be >= 256 KiB).
§Panics
If the given receive window is < 256 KiB.
sourcepub fn set_max_buffer_size(&mut self, n: usize) -> &mut Self
pub fn set_max_buffer_size(&mut self, n: usize) -> &mut Self
Set the max. buffer size per stream.
sourcepub fn set_max_num_streams(&mut self, n: usize) -> &mut Self
pub fn set_max_num_streams(&mut self, n: usize) -> &mut Self
Set the max. number of streams.
sourcepub fn set_window_update_mode(&mut self, m: WindowUpdateMode) -> &mut Self
pub fn set_window_update_mode(&mut self, m: WindowUpdateMode) -> &mut Self
Set the window update mode to use.
sourcepub fn set_read_after_close(&mut self, b: bool) -> &mut Self
pub fn set_read_after_close(&mut self, b: bool) -> &mut Self
Allow or disallow streams to read from buffered data after the connection has been closed.
sourcepub fn set_split_send_size(&mut self, n: usize) -> &mut Self
pub fn set_split_send_size(&mut self, n: usize) -> &mut Self
Set the max. payload size used when sending data frames. Payloads larger than the configured max. will be split.
Trait Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)