Enum libp2p::yamux::WindowUpdateMode[][src]

pub enum WindowUpdateMode {
    OnReceive,
    OnRead,
}

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

Trait Implementations

impl Clone for WindowUpdateMode[src]

impl Copy for WindowUpdateMode[src]

impl Debug for WindowUpdateMode[src]

impl Eq for WindowUpdateMode[src]

impl PartialEq<WindowUpdateMode> for WindowUpdateMode[src]

impl StructuralEq for WindowUpdateMode[src]

impl StructuralPartialEq for WindowUpdateMode[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]