pub struct Limiter<K: Key, P: Priority, T: TaskResult> { /* private fields */ }
Implementations§
Source§impl<K: Key, P: Priority, T: TaskResult> Limiter<K, P, T>
impl<K: Key, P: Priority, T: TaskResult> Limiter<K, P, T>
pub async fn get_default_block_duration(&self) -> Option<Duration>
pub async fn get_block_duration_by_key(&self, key: &K) -> Option<Duration>
pub async fn set_default_block_until_at_least(&self, instant: Instant)
pub async fn set_block_by_key_until_at_least(&self, instant: Instant, key: K)
pub async fn set_default_block_until(&self, instant: Option<Instant>)
pub async fn set_block_by_key_until(&self, instant: Option<Instant>, key: K)
pub async fn set_default_interval_at_least(&self, interval: Duration)
pub async fn set_interval_by_key_at_least(&self, interval: Duration, key: K)
pub async fn set_default_interval(&self, interval: Option<Duration>)
pub async fn set_interval_by_key(&self, interval: Option<Duration>, key: K)
pub async fn set_concurrent_tasks(&self, concurrent_tasks: usize)
pub async fn queue<J: Future<Output = T> + Send + 'static>( &self, job: J, priority: P, ) -> BoxFuture<T>
pub async fn queue_by_key<J: Future<Output = T> + Send + 'static>( &self, job: J, priority: P, key: K, ) -> BoxFuture<T>
Trait Implementations§
Auto Trait Implementations§
impl<K, P, T> !Freeze for Limiter<K, P, T>
impl<K, P, T> !RefUnwindSafe for Limiter<K, P, T>
impl<K, P, T> Send for Limiter<K, P, T>
impl<K, P, T> Sync for Limiter<K, P, T>
impl<K, P, T> Unpin for Limiter<K, P, T>
impl<K, P, T> !UnwindSafe for Limiter<K, P, T>
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