Skip to navigation

Struct Observation

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub struct Observation<'a> {
    pub code: u32,
    pub outcome: DiagnosticOutcome,
    pub severity: DiagnosticSeverity,
    pub failure_class: Option<FailureClass>,
    pub count: NonZeroU64,
    pub detail: &'a str,
    pub correlation: DiagnosticCorrelation<'a>,
}

Typed observation with borrowed detail and shared caller correlation.

Fields

code: u32

One-based code position returned by registration.

outcome: DiagnosticOutcome

Observed outcome, checked against the declaration.

severity: DiagnosticSeverity

Severity is independent of outcome.

failure_class: Option<FailureClass>

Evidence-based cause, never inferred from text.

count: NonZeroU64

Positive input delta, not an accumulated total.

detail: &'a str

Restricted diagnostic-only detail; core reports any truncation.

correlation: DiagnosticCorrelation<'a>

Optional request/session identifiers, excluded from aggregation keys.

Implementations

impl<'a> Observation<'a>

impl<'a> Observation<'a>

failure

pub fn failure(
    code: u32,
    class: FailureClass,
    detail: &'a str,
    count: NonZeroU64,
) -> Self

Author a failed internal operation with error severity.

success

pub fn success(code: u32, detail: &'a str, count: NonZeroU64) -> Self

Author independent successful evidence.