pub struct BackpressureController { /* private fields */ }Expand description
Backpressure control for streams.
Implementations§
Source§impl BackpressureController
impl BackpressureController
Sourcepub fn update(&mut self, buffer_size: usize) -> BackpressureState
pub fn update(&mut self, buffer_size: usize) -> BackpressureState
Update buffer size and return new state.
Sourcepub fn state(&self) -> BackpressureState
pub fn state(&self) -> BackpressureState
Get current state.
Sourcepub fn should_throttle(&self) -> bool
pub fn should_throttle(&self) -> bool
Check if should throttle.
Sourcepub fn should_drop(&self) -> bool
pub fn should_drop(&self) -> bool
Check if should drop messages.
Auto Trait Implementations§
impl Freeze for BackpressureController
impl RefUnwindSafe for BackpressureController
impl Send for BackpressureController
impl Sync for BackpressureController
impl Unpin for BackpressureController
impl UnsafeUnpin 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