qbase::flow

Struct ArcRecvController

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

Source

pub fn new(initial_max_data: u64, max_data_tx: TX) -> Self

Creates a new ArcRecvController with local initial_max_data transport parameter.

Source

pub fn terminate(&self)

Terminate the receiver’s flow control if QUIC connection error occurs.

Source§

impl<TX> ArcRecvController<TX>

Source

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>

Source§

fn clone(&self) -> ArcRecvController<TX>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TX: Debug> Debug for ArcRecvController<TX>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<TX: Default> Default for ArcRecvController<TX>

Source§

fn default() -> ArcRecvController<TX>

Returns the “default value” for a type. Read more
Source§

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.

Source§

type Output = ()

Source§

fn recv_frame( &self, _frame: &DataBlockedFrame, ) -> Result<Self::Output, QuicError>

Receive the frames from the peer

Auto Trait Implementations§

§

impl<TX> Freeze for ArcRecvController<TX>

§

impl<TX> RefUnwindSafe for ArcRecvController<TX>
where TX: RefUnwindSafe,

§

impl<TX> Send for ArcRecvController<TX>
where TX: Sync + Send,

§

impl<TX> Sync for ArcRecvController<TX>
where TX: Sync + Send,

§

impl<TX> Unpin for ArcRecvController<TX>

§

impl<TX> UnwindSafe for ArcRecvController<TX>
where TX: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V