#[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
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>
impl<'a> SnapshotEntry<'a>
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
True when the lookup succeeded.
Sourcepub fn get(&self, path: &str) -> SnapshotField<'a>
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.
Sourcepub fn key(&self, path: &str) -> SnapshotField<'a>
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).
Sourcepub fn cpu_sum_u64(&self, path: &str) -> SnapshotResult<u64>
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.
Sourcepub fn cpu_max_u64(&self, path: &str) -> SnapshotResult<u64>
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.
Sourcepub fn cpu_min_u64(&self, path: &str) -> SnapshotResult<u64>
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.
Sourcepub fn cpu_sum_i64(&self, path: &str) -> SnapshotResult<i64>
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.
Sourcepub fn cpu_max_i64(&self, path: &str) -> SnapshotResult<i64>
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.
Sourcepub fn cpu_min_i64(&self, path: &str) -> SnapshotResult<i64>
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.
Sourcepub fn cpu_sum_f64(&self, path: &str) -> SnapshotResult<f64>
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.
Sourcepub fn cpu_max_f64(&self, path: &str) -> SnapshotResult<f64>
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.
Sourcepub fn cpu_min_f64(&self, path: &str) -> SnapshotResult<f64>
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.
Sourcepub fn cpu_each<F>(&self, path: &str, f: F) -> SnapshotResult<()>
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§
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> 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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