pub struct BulkReceiveState { /* private fields */ }Expand description
Receiver-side exact-offset and replenishment state for one flow.
Implementations§
Source§impl BulkReceiveState
impl BulkReceiveState
Sourcepub fn new(
kind: BulkKind,
flow: BulkFlow,
max_record_payload: u32,
credit_limit: u64,
window: u64,
) -> Result<Self, BulkStateError>
pub fn new( kind: BulkKind, flow: BulkFlow, max_record_payload: u32, credit_limit: u64, window: u64, ) -> Result<Self, BulkStateError>
Create one receiver flow and its initial absolute grant.
Sourcepub fn next_expected_offset(&self) -> u64
pub fn next_expected_offset(&self) -> u64
Return the next exact record offset.
Sourcepub fn credit_limit(&self) -> u64
pub fn credit_limit(&self) -> u64
Return the current absolute receive credit limit.
Sourcepub fn accept_record(
&mut self,
record: &BulkRecord,
) -> Result<u64, BulkStateError>
pub fn accept_record( &mut self, record: &BulkRecord, ) -> Result<u64, BulkStateError>
Validate and admit a record before its destination consumes the payload.
Sourcepub fn consume(
&mut self,
consumed_offset: u64,
) -> Result<Option<BulkCredit>, BulkStateError>
pub fn consume( &mut self, consumed_offset: u64, ) -> Result<Option<BulkCredit>, BulkStateError>
Mark admitted bytes consumed and return a replenishment when half the window remains.
Sourcepub fn accept_finish(
&mut self,
finish: BulkFinish,
) -> Result<(), BulkStateError>
pub fn accept_finish( &mut self, finish: BulkFinish, ) -> Result<(), BulkStateError>
Accept an exact finish after all earlier records.
Trait Implementations§
Source§impl Clone for BulkReceiveState
impl Clone for BulkReceiveState
Source§fn clone(&self) -> BulkReceiveState
fn clone(&self) -> BulkReceiveState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BulkReceiveState
impl RefUnwindSafe for BulkReceiveState
impl Send for BulkReceiveState
impl Sync for BulkReceiveState
impl Unpin for BulkReceiveState
impl UnsafeUnpin for BulkReceiveState
impl UnwindSafe for BulkReceiveState
Blanket Implementations§
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
Mutably borrows from an owned value. Read more