Struct libp2prs_yamux::WindowUpdateMode[][src]

pub struct WindowUpdateMode(_);

The window update mode determines when window updates are sent to the remote, giving it new credit to send more data.

Implementations

impl WindowUpdateMode[src]

pub fn on_receive() -> Self[src]

The window update mode whereby the remote is given new credit via a window update whenever the current receive window is exhausted when data is received, i.e. this mode cannot exert back-pressure from application code that is slow to read from a substream.

Note: The receive buffer may overflow with this strategy if the receiver is too slow in reading the data from the buffer. The maximum receive buffer size must be tuned appropriately for the desired throughput and level of tolerance for (temporarily) slow receivers.

pub fn on_read() -> Self[src]

The window update mode whereby the remote is given new credit only when the current receive window is exhausted when data is read from the substream’s receive buffer, i.e. application code that is slow to read from a substream exerts back-pressure on the remote.

Note: If the receive window of a substream on both peers is exhausted and both peers are blocked on sending data before reading from the stream, a deadlock occurs. To avoid this situation, reading from a substream should never be blocked on writing to the same substream.

Note: With this strategy, there is usually no point in the receive buffer being larger than the window size.

Auto Trait Implementations

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

type Output = T

Should always be Self

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>,