pub struct ResourceQuota {
pub max_cpu_time_ns: u64,
pub max_memory_bytes: u64,
pub max_open_files: u32,
pub max_child_threads: u32,
pub max_network_connections: u32,
pub max_disk_iops: u64,
pub max_network_bw: u64,
pub hard_limits: bool,
}
Expand description
Resource quota limits for a thread or system.
Fields§
§max_cpu_time_ns: u64
Maximum CPU time (nanoseconds), 0 = unlimited
max_memory_bytes: u64
Maximum memory usage (bytes), 0 = unlimited
max_open_files: u32
Maximum number of open file descriptors, 0 = unlimited
max_child_threads: u32
Maximum number of child threads, 0 = unlimited
max_network_connections: u32
Maximum network connections, 0 = unlimited
max_disk_iops: u64
Maximum disk I/O operations per second, 0 = unlimited
max_network_bw: u64
Maximum network bandwidth (bytes/second), 0 = unlimited
hard_limits: bool
Hard limits (terminate on violation) vs soft limits (warn on violation)
Implementations§
Source§impl ResourceQuota
impl ResourceQuota
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Create a conservative quota for embedded systems.
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a permissive quota for development/testing.
Trait Implementations§
Source§impl Clone for ResourceQuota
impl Clone for ResourceQuota
Source§fn clone(&self) -> ResourceQuota
fn clone(&self) -> ResourceQuota
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 ResourceQuota
impl Debug for ResourceQuota
Auto Trait Implementations§
impl Freeze for ResourceQuota
impl RefUnwindSafe for ResourceQuota
impl Send for ResourceQuota
impl Sync for ResourceQuota
impl Unpin for ResourceQuota
impl UnwindSafe for ResourceQuota
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