Enum yamux::WindowUpdateMode
source · [−]pub enum WindowUpdateMode {
OnReceive,
OnRead,
}
Expand description
Specifies when window update frames are sent.
Variants
OnReceive
Send window updates as soon as a Stream
’s receive window drops to 0.
This ensures that the sender can resume sending more data as soon as possible
but a slow reader on the receiving side may be overwhelmed, i.e. it accumulates
data in its buffer which may reach its limit (see set_max_buffer_size
).
In this mode, window updates merely prevent head of line blocking but do not
effectively exercise back pressure on senders.
OnRead
Send window updates only when data is read on the receiving end.
This ensures that senders do not overwhelm receivers and keeps buffer usage low. However, depending on the protocol, there is a risk of deadlock, namely if both endpoints want to send data larger than the receivers window and they do not read before finishing their writes. Use this mode only if you are sure that this will never happen, i.e. if
- Endpoints A and B never write at the same time, or
- Endpoints A and B write at most n frames concurrently such that the sum of the frame lengths is less or equal to the available credit of A and B respectively.
Trait Implementations
sourceimpl Clone for WindowUpdateMode
impl Clone for WindowUpdateMode
sourcefn clone(&self) -> WindowUpdateMode
fn clone(&self) -> WindowUpdateMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for WindowUpdateMode
impl Debug for WindowUpdateMode
sourceimpl PartialEq<WindowUpdateMode> for WindowUpdateMode
impl PartialEq<WindowUpdateMode> for WindowUpdateMode
impl Copy for WindowUpdateMode
impl Eq for WindowUpdateMode
impl StructuralEq for WindowUpdateMode
impl StructuralPartialEq for WindowUpdateMode
Auto Trait Implementations
impl RefUnwindSafe for WindowUpdateMode
impl Send for WindowUpdateMode
impl Sync for WindowUpdateMode
impl Unpin for WindowUpdateMode
impl UnwindSafe for WindowUpdateMode
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)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more