Struct Observation
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 */
}
One observation. Its count is a positive input delta, never a cumulative total.
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>
new
pub fn new(
classification: Classification,
detail: impl Into<DiagnosticDetailRef<'a>>,
count: NonZero<u64>,
) -> Observation<'a>
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>
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>
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>
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>
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>
Attach known plugin execution and lifecycle facts without another series.
with_outcome
pub fn with_outcome(self, outcome: DiagnosticOutcome) -> Observation<'a>
Set the observed outcome without changing classification or health policy.
with_severity
pub fn with_severity(self, severity: DiagnosticSeverity) -> Observation<'a>
Set output severity independently of operation outcome and cause.
with_correlation
pub fn with_correlation(
self,
correlation: DiagnosticCorrelation<'a>,
) -> Observation<'a>
Attach safe borrowed correlation to be capped outside aggregate keys.
Trait Implementations
impl<'a> Clone for Observation<'a>
impl<'a> Clone for Observation<'a>
clone
fn clone(&self) -> Observation<'a>
clone_from
fn clone_from(&mut self, source: &Self)
impl<'a> Debug for Observation<'a>
impl<'a> Debug for Observation<'a>
fmt
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>