pub struct BulkFlowController { /* private fields */ }Expand description
Clone this handle, rather than constructing a controller per transfer.
Implementations§
Source§impl BulkFlowController
impl BulkFlowController
pub fn new(rates: BulkRates) -> Result<Self, BulkFlowError>
pub fn configure(&self, rates: BulkRates) -> Result<(), BulkFlowError>
pub async fn acquire( &self, direction: BulkDirection, peer: &str, bytes: u64, ) -> Result<(), BulkFlowError>
Sourcepub async fn acquire_scoped(
&self,
direction: BulkDirection,
peer: &str,
scope: &str,
bytes_per_second: Option<u64>,
bytes: u64,
) -> Result<(), BulkFlowError>
pub async fn acquire_scoped( &self, direction: BulkDirection, peer: &str, scope: &str, bytes_per_second: Option<u64>, bytes: u64, ) -> Result<(), BulkFlowError>
Admit a body slice against both aggregate and immutable scoped rates in one decision. Reuse a stable scope across attempts; controls bypass it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BulkFlowController
impl RefUnwindSafe for BulkFlowController
impl Send for BulkFlowController
impl Sync for BulkFlowController
impl Unpin for BulkFlowController
impl UnsafeUnpin for BulkFlowController
impl UnwindSafe for BulkFlowController
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