pub struct ResourceLimits {
pub max_concurrent_tasks: usize,
pub max_recursion_depth: usize,
pub task_warning_threshold: usize,
pub log_warnings: bool,
pub reject_when_full: bool,
}Expand description
Configuration for resource limits
Fields§
§max_concurrent_tasks: usizeMaximum number of concurrent async tasks (default: 1000)
max_recursion_depth: usizeMaximum recursion depth for commands (default: 100)
task_warning_threshold: usizeWarning threshold for concurrent tasks (default: 80% of max)
log_warnings: boolWhether to log resource warnings (default: true)
reject_when_full: boolWhether to reject new tasks when at limit (default: true)
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
Sourcepub fn with_max_tasks(self, max: usize) -> Self
pub fn with_max_tasks(self, max: usize) -> Self
Create limits with a specific max concurrent tasks
Sourcepub fn with_max_recursion(self, depth: usize) -> Self
pub fn with_max_recursion(self, depth: usize) -> Self
Set the recursion depth limit
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§fn clone(&self) -> ResourceLimits
fn clone(&self) -> ResourceLimits
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 ResourceLimits
impl Debug for ResourceLimits
Auto Trait Implementations§
impl Freeze for ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Inspectable for T
impl<T> Inspectable for T
Source§fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
Conditionally inspect this value
Source§fn inspect_with<F>(self, label: &str, f: F) -> Self
fn inspect_with<F>(self, label: &str, f: F) -> Self
Inspect with a custom formatter