pub struct BulkSendState { /* private fields */ }Expand description
Sender-side absolute-offset and credit state for one flow.
Implementations§
Source§impl BulkSendState
impl BulkSendState
Sourcepub fn new(
kind: BulkKind,
flow: BulkFlow,
max_record_payload: u32,
credit_limit: u64,
) -> Result<Self, BulkStateError>
pub fn new( kind: BulkKind, flow: BulkFlow, max_record_payload: u32, credit_limit: u64, ) -> Result<Self, BulkStateError>
Create one sender flow from negotiated limits.
Sourcepub fn next_offset(&self) -> u64
pub fn next_offset(&self) -> u64
Return the next byte offset this sender will assign.
Sourcepub fn credit_limit(&self) -> u64
pub fn credit_limit(&self) -> u64
Return the currently admitted exclusive limit.
Sourcepub fn max_record_payload(&self) -> u32
pub fn max_record_payload(&self) -> u32
Return the maximum payload negotiated for this flow.
Sourcepub fn available_credit(&self) -> u64
pub fn available_credit(&self) -> u64
Return bytes the sender may currently admit without another credit update.
Sourcepub fn admit(&mut self, payload_len: usize) -> Result<u64, BulkStateError>
pub fn admit(&mut self, payload_len: usize) -> Result<u64, BulkStateError>
Admit a payload and advance the ordered sender cursor.
Sourcepub fn apply_credit(
&mut self,
credit: BulkCredit,
) -> Result<bool, BulkStateError>
pub fn apply_credit( &mut self, credit: BulkCredit, ) -> Result<bool, BulkStateError>
Apply one idempotent absolute credit update.
Sourcepub fn finish(&mut self) -> Result<BulkFinish, BulkStateError>
pub fn finish(&mut self) -> Result<BulkFinish, BulkStateError>
Finish this sender at its exact current offset.
Trait Implementations§
Source§impl Clone for BulkSendState
impl Clone for BulkSendState
Source§fn clone(&self) -> BulkSendState
fn clone(&self) -> BulkSendState
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 BulkSendState
impl RefUnwindSafe for BulkSendState
impl Send for BulkSendState
impl Sync for BulkSendState
impl Unpin for BulkSendState
impl UnsafeUnpin for BulkSendState
impl UnwindSafe for BulkSendState
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