pub struct BackpressureController { /* private fields */ }Expand description
Backpressure controller for flow control
Implementations§
Source§impl BackpressureController
impl BackpressureController
Sourcepub fn with_window_size(window_size: usize) -> Self
pub fn with_window_size(window_size: usize) -> Self
Creates a new BackpressureController with custom window size
Sourcepub fn available_window(&self) -> usize
pub fn available_window(&self) -> usize
Returns the number of bytes that can be sent
Sourcepub fn on_chunk_sent(&mut self, size: usize)
pub fn on_chunk_sent(&mut self, size: usize)
Records that a chunk has been sent
Sourcepub fn on_chunk_acked(&mut self, size: usize)
pub fn on_chunk_acked(&mut self, size: usize)
Records that a chunk has been acknowledged
Sourcepub fn window_size(&self) -> usize
pub fn window_size(&self) -> usize
Returns the current window size
Sourcepub fn bytes_in_flight(&self) -> usize
pub fn bytes_in_flight(&self) -> usize
Returns the current bytes in flight
Trait Implementations§
Source§impl Clone for BackpressureController
impl Clone for BackpressureController
Source§fn clone(&self) -> BackpressureController
fn clone(&self) -> BackpressureController
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackpressureController
impl Debug for BackpressureController
Source§impl Default for BackpressureController
impl Default for BackpressureController
Source§impl PartialEq for BackpressureController
impl PartialEq for BackpressureController
impl StructuralPartialEq for BackpressureController
Auto Trait Implementations§
impl Freeze for BackpressureController
impl RefUnwindSafe for BackpressureController
impl Send for BackpressureController
impl Sync for BackpressureController
impl Unpin for BackpressureController
impl UnwindSafe for BackpressureController
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