pub struct RlimitConfig {
pub max_memory: Option<u64>,
pub max_cpu_seconds: Option<u64>,
pub max_processes: Option<u64>,
pub max_file_size: Option<u64>,
pub max_open_files: Option<u64>,
}Expand description
Resource limits via setrlimit (unprivileged fallback)
Fields§
§max_memory: Option<u64>Maximum address space size in bytes (RLIMIT_AS)
max_cpu_seconds: Option<u64>Maximum CPU time in seconds (RLIMIT_CPU)
max_processes: Option<u64>Maximum number of processes (RLIMIT_NPROC)
max_file_size: Option<u64>Maximum file size in bytes (RLIMIT_FSIZE)
max_open_files: Option<u64>Maximum number of open files (RLIMIT_NOFILE)
Implementations§
Source§impl RlimitConfig
impl RlimitConfig
Sourcepub fn apply(&self) -> Result<(), SandboxError>
pub fn apply(&self) -> Result<(), SandboxError>
Apply resource limits to the current process. This should be called in the child process after fork/clone.
Trait Implementations§
Source§impl Clone for RlimitConfig
impl Clone for RlimitConfig
Source§fn clone(&self) -> RlimitConfig
fn clone(&self) -> RlimitConfig
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 RlimitConfig
impl Debug for RlimitConfig
Source§impl Default for RlimitConfig
impl Default for RlimitConfig
Source§fn default() -> RlimitConfig
fn default() -> RlimitConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RlimitConfig
impl RefUnwindSafe for RlimitConfig
impl Send for RlimitConfig
impl Sync for RlimitConfig
impl Unpin for RlimitConfig
impl UnsafeUnpin for RlimitConfig
impl UnwindSafe for RlimitConfig
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