pub struct HostResourceLimits {
pub max_processes: u64,
pub max_open_files: u64,
pub max_file_size_bytes: u64,
pub cpu_seconds: u64,
pub memory_bytes: u64,
pub cgroup_memory_bytes: u64,
pub cgroup_pids_max: u64,
pub cgroup_cpu_percent: 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_*.
Fields§
§max_processes: u64RLIMIT_NPROC headroom above the runtime’s own uid baseline. Per-uid, not
per-process-tree, and counted in the unit that uid’s kernel enforces against
([uid_task_count]). See the module docs for why the cgroup pids.max below exists
alongside it rather than duplicating it, and [apply_hard_rlimits] for why it is applied
as headroom.
max_open_files: u64RLIMIT_NOFILE hard ceiling.
max_file_size_bytes: u64RLIMIT_FSIZE hard ceiling, in bytes.
cpu_seconds: u64RLIMIT_CPU hard ceiling, in CPU-seconds.
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: u32cgroup v2 cpu.max quota as a percentage of one core. Linux only.
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).
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 Freeze 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 more