Enum litep2p::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§
source§impl Clone for WindowUpdateMode
impl Clone for WindowUpdateMode
source§fn clone(&self) -> WindowUpdateMode
fn clone(&self) -> WindowUpdateMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WindowUpdateMode
impl Debug for WindowUpdateMode
source§impl PartialEq for WindowUpdateMode
impl PartialEq for WindowUpdateMode
source§fn eq(&self, other: &WindowUpdateMode) -> bool
fn eq(&self, other: &WindowUpdateMode) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for WindowUpdateMode
impl Eq for WindowUpdateMode
impl StructuralPartialEq for WindowUpdateMode
Auto Trait Implementations§
impl Freeze for WindowUpdateMode
impl RefUnwindSafe for WindowUpdateMode
impl Send for WindowUpdateMode
impl Sync for WindowUpdateMode
impl Unpin for WindowUpdateMode
impl UnwindSafe for WindowUpdateMode
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.