Skip to main content

LimitEvidence

Struct LimitEvidence 

Source
#[non_exhaustive]
pub struct LimitEvidence { /* private fields */ }
Available on crate feature 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

Source

pub fn memory(&self) -> LimitVerdict

The verdict for ResourceLimits::max_memory.

Source

pub fn processes(&self) -> LimitVerdict

Source

pub fn cpu(&self) -> LimitVerdict

The verdict for ResourceLimits::cpu_quota.

Source

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

Source§

fn clone(&self) -> LimitEvidence

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LimitEvidence

Source§

impl Debug for LimitEvidence

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for LimitEvidence

Source§

impl PartialEq for LimitEvidence

Source§

fn eq(&self, other: &LimitEvidence) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
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:

{"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.

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for LimitEvidence

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more