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 receive
- read after close = true
Implementations
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more