#[non_exhaustive]pub struct LimitEvidence { /* private fields */ }limits only.Expand description
Post-run evidence about a group’s resource caps: one LimitVerdict per
LimitKind axis, read from the container the crate itself owns.
Obtained from ProcessGroup::limit_evidence
after a run finishes (and before the group is dropped, which takes the container
— and with it the evidence — away). It exists to answer the one question a plain
exit status cannot: was my child killed by the cap I set, or did it fail on its
own?
§Per axis, deliberately
There is no single whole-group “did anything trip?” answer here, and that is a
design decision rather than an omission: collapsing three honest three-valued
verdicts into one would have to fold NotTripped and
Unknown together, turning “we have no evidence” into
“no”. Ask the axis you capped — memory,
processes, cpu, or
verdict for a LimitKind held in a variable — and each
answer stays honest.
Implementations§
Source§impl LimitEvidence
impl LimitEvidence
Sourcepub fn memory(&self) -> LimitVerdict
pub fn memory(&self) -> LimitVerdict
The verdict for ResourceLimits::max_memory.
Sourcepub fn processes(&self) -> LimitVerdict
pub fn processes(&self) -> LimitVerdict
The verdict for ResourceLimits::max_processes.
Sourcepub fn cpu(&self) -> LimitVerdict
pub fn cpu(&self) -> LimitVerdict
The verdict for ResourceLimits::cpu_quota.
Sourcepub fn verdict(&self, kind: LimitKind) -> LimitVerdict
pub fn verdict(&self, kind: LimitKind) -> LimitVerdict
The verdict for kind — the same values memory,
processes and cpu return, addressed by a
LimitKind held in a variable (for example the kind carried by an
ErrorReason::ResourceLimit, or while
iterating the axes a caller capped).
Trait Implementations§
Source§impl Clone for LimitEvidence
impl Clone for LimitEvidence
Source§fn clone(&self) -> LimitEvidence
fn clone(&self) -> LimitEvidence
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LimitEvidence
Source§impl Debug for LimitEvidence
impl Debug for LimitEvidence
impl Eq for LimitEvidence
Source§impl PartialEq for LimitEvidence
impl PartialEq for LimitEvidence
Source§impl Serialize for LimitEvidence
Available on crate feature report-serde only.(feature report-serde) One verdict identifier per axis, keyed by the
accessor of the same name:
impl Serialize for LimitEvidence
report-serde only.(feature report-serde) One verdict identifier per axis, keyed by the
accessor of the same name:
{"memory": "tripped", "processes": "not_tripped", "cpu": "unknown"}Per axis deliberately, exactly as the type itself is: there is no
whole-report “did anything trip?” key, because producing one would have to
fold Unknown (“no evidence”) together with
NotTripped (“evidence of no”) — the very
collapse this type exists to avoid.