Struct WindowUpdateMode
pub struct WindowUpdateMode(/* private fields */);
yamux
only.Expand description
The window update mode determines when window updates are sent to the remote, giving it new credit to send more data.
Implementations§
§impl WindowUpdateMode
impl WindowUpdateMode
pub fn on_receive() -> WindowUpdateMode
👎Deprecated: Use WindowUpdateMode::on_read
instead.
pub fn on_receive() -> WindowUpdateMode
WindowUpdateMode::on_read
instead.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() -> WindowUpdateMode
pub fn on_read() -> WindowUpdateMode
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§
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more