SnapshotEntry

Enum SnapshotEntry 

Source
#[non_exhaustive]
pub enum SnapshotEntry<'a> { Hash(&'a FailureDumpEntry), Percpu(&'a FailureDumpPercpuEntry), PercpuHash(&'a FailureDumpPercpuHashEntry), Value(&'a RenderedValue), Missing(SnapshotError), }
Expand description

One entry’s view — either a HASH (key, value) pair, a per-CPU array entry, a per-CPU hash entry, a single rendered value, or a missing-entry marker.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Hash(&'a FailureDumpEntry)

HASH map entry — (key, value) pair.

§

Percpu(&'a FailureDumpPercpuEntry)

PERCPU_ARRAY entry — outer u32 key, inner per-CPU vec.

§

PercpuHash(&'a FailureDumpPercpuHashEntry)

PERCPU_HASH entry — rendered key, inner per-CPU vec.

§

Value(&'a RenderedValue)

Single rendered value (ARRAY map’s value field, or a per-CPU slot resolved via super::SnapshotMap::cpu).

§

Missing(SnapshotError)

No entry matched.

Implementations§

Source§

impl<'a> SnapshotEntry<'a>

Source

pub fn is_present(&self) -> bool

True when the lookup succeeded.

Source

pub fn get(&self, path: &str) -> SnapshotField<'a>

Walk into the entry’s value side along a dotted path. Each path component names a RenderedValue::Struct member; pointer dereferences are followed transparently. Returns SnapshotField::Missing with an actionable error when the path cannot be resolved.

Source

pub fn key(&self, path: &str) -> SnapshotField<'a>

Look up the entry’s KEY side along a dotted path. Mirror of Self::get but operates on the key’s rendered structure. Supports the three key-bearing variants: Hash and PercpuHash walk their rendered key; Percpu returns its u32 key as SnapshotField::PercpuKey for an empty path (and TypeMismatch for a non-empty path).

Source

pub fn cpu_sum_u64(&self, path: &str) -> SnapshotResult<u64>

Sum the per-CPU values at path as u64. Returns Err(NoMatch) when every slot is None: a None slot is UNREADABLE (host-read failure), not a real zero, so an all-None sum of 0 would silently drop the unreadable data. A readable map whose slots are all 0 still sums to Ok(0). A slot whose rendered value cannot decode to u64 propagates an Err immediately and stops the aggregation.

Source

pub fn cpu_max_u64(&self, path: &str) -> SnapshotResult<u64>

Maximum of per-CPU values at path as u64. Returns Err(NoMatch) when every slot is None (no slot contributed). A slot whose rendered value cannot decode to u64 propagates an Err immediately.

Source

pub fn cpu_min_u64(&self, path: &str) -> SnapshotResult<u64>

Minimum of per-CPU values at path as u64. Returns Err(NoMatch) when every slot is None. A slot whose rendered value cannot decode to u64 propagates an Err immediately.

Source

pub fn cpu_sum_i64(&self, path: &str) -> SnapshotResult<i64>

Sum the per-CPU values at path as i64. Returns Err(NoMatch) when every slot is None, matching Self::cpu_sum_u64: a None slot is UNREADABLE, not a real zero, so an all-None sum of 0 would be a silent drop. A readable all-zero map still sums to Ok(0). The sum saturates at i64::MIN / i64::MAX. A slot whose rendered value cannot decode to i64 propagates an Err immediately and stops the aggregation.

Source

pub fn cpu_max_i64(&self, path: &str) -> SnapshotResult<i64>

Maximum of per-CPU values at path as i64. Returns Err(NoMatch) when every slot is None (no slot contributed). A slot whose rendered value cannot decode to i64 propagates an Err immediately.

Source

pub fn cpu_min_i64(&self, path: &str) -> SnapshotResult<i64>

Minimum of per-CPU values at path as i64. Returns Err(NoMatch) when every slot is None. A slot whose rendered value cannot decode to i64 propagates an Err immediately.

Source

pub fn cpu_sum_f64(&self, path: &str) -> SnapshotResult<f64>

Sum the per-CPU values at path as f64. Returns Err(NoMatch) when every slot is None: a None slot is UNREADABLE, not a real zero, so an all-None sum of 0.0 would be a silent drop. A readable all-zero map still sums to Ok(0.0). A slot whose rendered value cannot decode to f64 propagates an Err immediately. NaN slot values propagate through += per IEEE-754 — a single NaN slot makes the result NaN.

Source

pub fn cpu_max_f64(&self, path: &str) -> SnapshotResult<f64>

Maximum of per-CPU values at path as f64. Returns Err(NoMatch) when every slot is None. A slot whose rendered value cannot decode to f64 propagates an Err immediately. NaN slot values are filtered out per f64::max semantics — f64::max(NaN, x) returns x, so a NaN slot never wins against a non-NaN slot. An all-NaN run is an edge case: the first NaN slot sets best=NaN, then subsequent NaN.max(NaN) returns NaN, so the final result is Ok(NaN) rather than NoMatch.

Source

pub fn cpu_min_f64(&self, path: &str) -> SnapshotResult<f64>

Minimum of per-CPU values at path as f64. Returns Err(NoMatch) when every slot is None. A slot whose rendered value cannot decode to f64 propagates an Err immediately. NaN slot values are filtered out per f64::min semantics — f64::min(NaN, x) returns x, so a NaN slot never wins against a non-NaN slot. An all-NaN run yields Ok(NaN) rather than NoMatch — same edge case as cpu_max_f64.

Source

pub fn cpu_each<F>(&self, path: &str, f: F) -> SnapshotResult<()>

Iterate non-None per-CPU rendered values at path. For each successful slot, invokes f(cpu_idx, &RenderedValue). Slots whose value is None are skipped silently; the iteration stops at the first slot whose value cannot be reached via path (returning the path-walk error). Returns Err for non-percpu variants.

Trait Implementations§

Source§

impl<'a> Debug for SnapshotEntry<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for SnapshotEntry<'a>

§

impl<'a> RefUnwindSafe for SnapshotEntry<'a>

§

impl<'a> Send for SnapshotEntry<'a>

§

impl<'a> Sync for SnapshotEntry<'a>

§

impl<'a> Unpin for SnapshotEntry<'a>

§

impl<'a> UnwindSafe for SnapshotEntry<'a>

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> 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,