Skip to navigation

Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -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 detail: DiagnosticDetailRef<'a>,
pub count: NonZero<u64>,
pub severity: DiagnosticSeverity,
pub outcome: DiagnosticOutcome,
pub correlation: DiagnosticCorrelation<'a>,
pub context: PluginObservationContext,
/* private fields */
}

Referenced types: DiagnosticDetailRef, NonZero, u64, DiagnosticSeverity, DiagnosticOutcome, DiagnosticCorrelation, PluginObservationContext

One observation. Its count is a positive input delta, never a cumulative total.

This example intentionally does not compile.
use nemo_relay_diagnostics::{Classification, Observation, SuccessCode};
// Constructors require NonZeroU64, so a zero integer is not a valid input.
let observation = Observation::new(
Classification::success(SuccessCode::SinkInitialized), "initialized", 0,
);

Fields

detail: DiagnosticDetailRef<'a>

Optional producer-approved explanation; bounding does not perform redaction.

count: NonZero<u64>

Positive input occurrence delta, never a cumulative report total.

severity: DiagnosticSeverity

Operational evidence severity, independent of deployment health.

outcome: DiagnosticOutcome

Explicit observed operation outcome for summaries and windows.

correlation: DiagnosticCorrelation<'a>

Borrowed caller correlation, never an aggregate key.

context: PluginObservationContext

Plugin execution and phase names, validated before fixed-size core retention.

Implementations

impl<'a> Observation<'a>

impl<'a> Observation<'a>

Referenced types: Observation

new

pub fn new(
classification: Classification,
detail: impl Into<DiagnosticDetailRef<'a>>,
count: NonZero<u64>,
) -> Observation<'a>

Referenced types: Classification, Into, DiagnosticDetailRef, NonZero, u64, Observation

Author built-in evidence with severity/outcome defaults from its code.

The type guarantees a positive count; recording validates the reservation. Constructing this value does not retain its borrowed detail or source error.

extension

pub fn extension(
handle: ExtensionHandle,
class: Option<FailureClass>,
outcome: DiagnosticOutcome,
detail: impl Into<DiagnosticDetailRef<'a>>,
count: NonZero<u64>,
) -> Observation<'a>

Referenced types: ExtensionHandle, Option, FailureClass, DiagnosticOutcome, Into, DiagnosticDetailRef, NonZero, u64, Observation

Author evidence using an admitted extension handle and supported cause.

Recording validates ownership, descriptor generation, and class. A stale handle cannot reserve a replacement code or create another counter.

extension_with_class

pub fn extension_with_class(
handle: ExtensionHandle,
class: ExtensionClassHandle,
detail: impl Into<DiagnosticDetailRef<'a>>,
count: NonZero<u64>,
) -> Observation<'a>

Referenced types: ExtensionHandle, ExtensionClassHandle, Into, DiagnosticDetailRef, NonZero, u64, Observation

Author an extension failure with its own admitted immutable cause name. Handles from another code/registration or expired metadata are rejected.

classification_overflow

pub fn classification_overflow(
outcome: DiagnosticOutcome,
count: NonZero<u64>,
) -> Observation<'a>

Referenced types: DiagnosticOutcome, NonZero, u64, Observation

Explicit summary-only admission when extension vocabulary could not fit. This is not a way to reinterpret an invalid or undeclared code.

with_remote_origin

pub fn with_remote_origin(
self,
origin: RemoteDiagnosticOrigin,
) -> Observation<'a>

Referenced types: RemoteDiagnosticOrigin, Observation

Associate an authenticated remote producer. The transport must validate the remote identity before attaching it to an observation.

with_plugin_context

pub fn with_plugin_context(
self,
context: PluginObservationContext,
) -> Observation<'a>

Referenced types: PluginObservationContext, Observation

Attach known plugin execution and lifecycle facts without another series.

with_outcome

pub fn with_outcome(self, outcome: DiagnosticOutcome) -> Observation<'a>

Referenced types: DiagnosticOutcome, Observation

Set the observed outcome without changing classification or health policy.

with_severity

pub fn with_severity(self, severity: DiagnosticSeverity) -> Observation<'a>

Referenced types: DiagnosticSeverity, Observation

Set output severity independently of operation outcome and cause.

with_correlation

pub fn with_correlation(
self,
correlation: DiagnosticCorrelation<'a>,
) -> Observation<'a>

Referenced types: DiagnosticCorrelation, Observation

Attach safe borrowed correlation to be capped outside aggregate keys.

Trait Implementations

impl<'a> Clone for Observation<'a>

impl<'a> Clone for Observation<'a>

Referenced types: Clone, Observation

clone

fn clone(&self) -> Observation<'a>

Referenced types: clone, Observation

clone_from

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

Referenced types: clone_from

impl<'a> Debug for Observation<'a>

impl<'a> Debug for Observation<'a>

Referenced types: Debug, Observation

fmt

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

Referenced types: fmt, Formatter, Result, (), Error