pub struct WorkerTimeLimits { /* private fields */ }Expand description
Thread-safe per-worker time limits manager
Implementations§
Source§impl WorkerTimeLimits
impl WorkerTimeLimits
Sourcepub fn with_default(config: TimeLimitConfig) -> Self
pub fn with_default(config: TimeLimitConfig) -> Self
Create with a default time limit
Sourcepub fn set_task_limit(
&self,
task_name: impl Into<String>,
config: TimeLimitConfig,
)
pub fn set_task_limit( &self, task_name: impl Into<String>, config: TimeLimitConfig, )
Set time limit for a specific task type
Sourcepub fn remove_task_limit(&self, task_name: &str)
pub fn remove_task_limit(&self, task_name: &str)
Remove time limit for a specific task type
Sourcepub fn create_tracker(
&self,
task_id: &str,
task_name: &str,
) -> Option<TimeLimit>
pub fn create_tracker( &self, task_id: &str, task_name: &str, ) -> Option<TimeLimit>
Create a time limit tracker for a task
Sourcepub fn has_limit(&self, task_name: &str) -> bool
pub fn has_limit(&self, task_name: &str) -> bool
Check if a task type has time limits configured
Sourcepub fn set_default(&self, config: TimeLimitConfig)
pub fn set_default(&self, config: TimeLimitConfig)
Set the default time limit configuration
Trait Implementations§
Source§impl Clone for WorkerTimeLimits
impl Clone for WorkerTimeLimits
Source§fn clone(&self) -> WorkerTimeLimits
fn clone(&self) -> WorkerTimeLimits
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 WorkerTimeLimits
impl Debug for WorkerTimeLimits
Source§impl Default for WorkerTimeLimits
impl Default for WorkerTimeLimits
Source§fn default() -> WorkerTimeLimits
fn default() -> WorkerTimeLimits
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WorkerTimeLimits
impl RefUnwindSafe for WorkerTimeLimits
impl Send for WorkerTimeLimits
impl Sync for WorkerTimeLimits
impl Unpin for WorkerTimeLimits
impl UnwindSafe for WorkerTimeLimits
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