#[non_exhaustive]pub enum FailureDumpReportAny {
Single(Box<FailureDumpReport>),
Dual(Box<DualFailureDumpReport>),
Degraded(Box<DegradedFailureDumpReport>),
}Expand description
Either-or wrapper that owns a parsed FailureDumpReport,
DualFailureDumpReport, or DegradedFailureDumpReport. Lets
a consumer hold and render a failure-dump file without prematurely
committing to one schema — the discriminant lives in the JSON’s
schema field, not in the type the consumer holds.
Centralises the schema-tag dispatch logic that previously lived
inline at every read site (the auto-repro tail renderer, the
failure-dump-e2e test, any future consumer that wants to inspect
any shape). Use Self::from_json to parse an arbitrary
failure-dump JSON blob; the Display impl forwards to the
underlying report’s existing Display so the rendered output is
indistinguishable from holding the unwrapped report directly.
non_exhaustive so a future fourth schema can be added without
breaking external pattern matches.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Single(Box<FailureDumpReport>)
Single-snapshot report, schema="single". Emitted by the
primary VM’s freeze coordinator when an error-class SCX exit
fires.
Dual(Box<DualFailureDumpReport>)
Dual-snapshot wrapper, schema="dual". Emitted by the
auto-repro VM when the dual-snapshot path is enabled. Carries
optional early + required late snapshots plus jiffies
metadata for the early-trigger condition.
Boxed to keep FailureDumpReportAny’s on-stack size bounded
— DualFailureDumpReport carries the early+late snapshots
inline and is roughly 2x the size of FailureDumpReport.
Degraded(Box<DegradedFailureDumpReport>)
Degraded report, schema="degraded". Emitted when an
error-class trigger fires but the dump path aborts before a
full single/dual report can be captured — today only the
vCPU rendezvous-timeout path produces this shape. Carries
partial vCPU register data + trigger-state diagnostics
instead of the full map / scx-walker output.
Boxed for size parity with the other variants.
Implementations§
Source§impl FailureDumpReportAny
impl FailureDumpReportAny
Sourcepub fn from_json(json: &str) -> Option<Self>
pub fn from_json(json: &str) -> Option<Self>
Parse a failure-dump JSON blob, choosing the variant by the
schema field. Returns None on any of:
- the blob does not parse as JSON
- the
schemafield is absent (degraded variant requires an explicit discriminant; the previous “absent ⇒ single” fallback would silently mis-route a richer wrapper as a lossy single shape) - the
schemafield carries an unknown value - the typed deserialisation under the chosen schema fails
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FailureDumpReportAny
impl RefUnwindSafe for FailureDumpReportAny
impl Send for FailureDumpReportAny
impl Sync for FailureDumpReportAny
impl Unpin for FailureDumpReportAny
impl UnwindSafe for FailureDumpReportAny
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