pub struct ConcurrencyController { /* private fields */ }Implementations§
Source§impl ConcurrencyController
impl ConcurrencyController
pub fn new(exec_options: &Options) -> Self
Sourcepub async fn acquire(
&self,
bytes_fn: Option<impl FnOnce() -> usize>,
) -> Result<ConcurrencyControllerPermit, AcquireError>
pub async fn acquire( &self, bytes_fn: Option<impl FnOnce() -> usize>, ) -> Result<ConcurrencyControllerPermit, AcquireError>
If bytes_fn is None, it means the number of bytes is not known yet.
The controller will reserve a minimum number of bytes.
The caller should call acquire_bytes_with_reservation with the actual number of bytes later.
pub async fn acquire_bytes_with_reservation( &self, bytes_fn: impl FnOnce() -> usize, ) -> Result<Option<OwnedSemaphorePermit>, AcquireError>
Auto Trait Implementations§
impl Freeze for ConcurrencyController
impl !RefUnwindSafe for ConcurrencyController
impl Send for ConcurrencyController
impl Sync for ConcurrencyController
impl Unpin for ConcurrencyController
impl !UnwindSafe for ConcurrencyController
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