pub struct HostResourceLimits {
pub max_processes: u64,
pub max_open_files: u64,
pub max_file_size_bytes: u64,
pub cpu_seconds: Option<u64>,
pub memory_bytes: u64,
pub cgroup_memory_bytes: u64,
pub cgroup_pids_max: u64,
pub cgroup_cpu_percent: Option<u32>,
pub cgroup_io_bytes_per_sec: u64,
pub workdir_max_bytes: u64,
}Expand description
Fully-resolved host-process limits for one session: the manifest’s capabilities.resources
block with every omitted field replaced by its DEFAULT_*, except the two CPU fields, which
stay None when omitted.
Fields§
§max_processes: u64RLIMIT_NPROC headroom above the uid’s count at each spawn, applied only to a spawn
with no cgroup scope ([NprocBound::Headroom]) and counted in the unit that uid’s kernel
enforces against ([uid_task_count]). A spawn that joins a scope is bounded by
cgroup_pids_max instead and ignores this field.
max_open_files: u64RLIMIT_NOFILE hard ceiling.
max_file_size_bytes: u64RLIMIT_FSIZE hard ceiling, in bytes.
cpu_seconds: Option<u64>CPU time, in CPU-seconds, at which RLIMIT_CPU sends a spawned subprocess SIGXCPU, with
SIGKILL one second later ([cpu_rlimit_slots]). None sets no RLIMIT_CPU: a
subprocess keeps the one this process inherited.
memory_bytes: u64RLIMIT_AS on Linux, RLIMIT_DATA on macOS (which has no RLIMIT_AS), in bytes.
cgroup_memory_bytes: u64cgroup v2 memory.max, in bytes. Linux only.
cgroup_pids_max: u64cgroup v2 pids.max. Linux only.
cgroup_cpu_percent: Option<u32>cgroup v2 cpu.max quota as a percentage of one core. Linux only. None writes no
cpu.max, so the scope keeps the kernel’s max.
cgroup_io_bytes_per_sec: u64cgroup v2 io.max rbps+wbps on the workdir’s backing device. Linux only, best-effort.
workdir_max_bytes: u64Ceiling on total workdir size, in bytes. Every platform.
Implementations§
Source§impl HostResourceLimits
impl HostResourceLimits
Sourcepub fn resolve(declared: Option<&ResourceCapabilities>) -> Self
pub fn resolve(declared: Option<&ResourceCapabilities>) -> Self
Resolve a manifest capabilities.resources block, substituting the default for each
field the manifest left out (and for the whole block when it is absent). The CPU fields
have no default and stay None when left out.
Trait Implementations§
Source§impl Clone for HostResourceLimits
impl Clone for HostResourceLimits
impl Copy for HostResourceLimits
Source§impl Debug for HostResourceLimits
impl Debug for HostResourceLimits
Source§impl Default for HostResourceLimits
impl Default for HostResourceLimits
impl Eq for HostResourceLimits
Source§impl PartialEq for HostResourceLimits
impl PartialEq for HostResourceLimits
impl StructuralPartialEq for HostResourceLimits
Auto Trait Implementations§
impl Forget for HostResourceLimits
impl Freeze for HostResourceLimits
impl Move for HostResourceLimits
impl RefUnwindSafe for HostResourceLimits
impl Send for HostResourceLimits
impl Sync for HostResourceLimits
impl Unpin for HostResourceLimits
impl UnsafeUnpin for HostResourceLimits
impl UnwindSafe for HostResourceLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
NoneValue::null_value produces.