pub struct ArcRecvController<TX>(/* private fields */);Expand description
Shared receiver’s flow controller for managing the incoming stream data flow.
Flow control on the receiving end, primarily used to regulate the data flow sent by the sender. Since the receive buffer is limited, if the application layer cannot read the data in time, the receive buffer will not expand, and the sender must be suspended.
The sender must never send new stream data exceeding
the flow control limit of the receiver advertised,
otherwise it will be considered a FlowControl error.
Additionally, the flow control on the receiving end also needs to
promptly send a MaxDataFrame to the sender after the application layer reads the data,
to expand the receive window since more receive buffer space is freed up,
and to inform the sender that more data can be sent.
Implementations§
Source§impl<TX> ArcRecvController<TX>
impl<TX> ArcRecvController<TX>
Source§impl<TX> ArcRecvController<TX>where
TX: SendFrame<MaxDataFrame>,
impl<TX> ArcRecvController<TX>where
TX: SendFrame<MaxDataFrame>,
Sourcepub fn on_new_rcvd(&self, amount: usize) -> Result<usize, Overflow>
pub fn on_new_rcvd(&self, amount: usize) -> Result<usize, Overflow>
Updates the total received data size and checks if the flow control limit is exceeded when new stream data is received.
As mentioned in ArcSendControler, if the flow control limit is exceeded,
an Overflow error will be returned.
Trait Implementations§
Source§impl<TX: Clone> Clone for ArcRecvController<TX>
impl<TX: Clone> Clone for ArcRecvController<TX>
Source§fn clone(&self) -> ArcRecvController<TX>
fn clone(&self) -> ArcRecvController<TX>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<TX: Debug> Debug for ArcRecvController<TX>
impl<TX: Debug> Debug for ArcRecvController<TX>
Source§impl<TX: Default> Default for ArcRecvController<TX>
impl<TX: Default> Default for ArcRecvController<TX>
Source§fn default() -> ArcRecvController<TX>
fn default() -> ArcRecvController<TX>
Source§impl<TX> ReceiveFrame<DataBlockedFrame> for ArcRecvController<TX>
impl<TX> ReceiveFrame<DataBlockedFrame> for ArcRecvController<TX>
ArcRecvController need to receive DataBlockedFrame from peer.
However, the receiver may also not be able to immediately expand the receive window and must wait for the application layer to read the data to free up more space in the receive buffer.