Skip to navigation

Struct Component Recorder

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 ComponentRecorder { /* private fields */ }

Producer capability scoped to one admitted registration.

Clones share its lease; the last recorder drop closes the component. Producers cannot refresh or replace registrations. Disabled recorders have no active identity and skip lazy observation factories.

Implementations

impl ComponentRecorder

impl ComponentRecorder

identity

pub fn identity(&self) -> Option<&ComponentIdentity>

Borrow the original registration identity, or None while disabled.

Closure or retention cannot relabel this handle as another registration.

reader

pub fn reader(&self) -> DiagnosticsReader

Read the same source context without granting lifecycle authority.

capture_origin

pub fn capture_origin(&self) -> Result<OriginRecorder, DiagnosticError>

Capture bounded configuration attribution for an operation’s completion.

Refreshing does not pin history or invalidate the captured origin. Disabled collection returns an inert recorder without allocating.

register_extension

pub fn register_extension(
    &self,
    registration: ExtensionRegistration<'_>,
) -> Result<Option<ExtensionHandle>, DiagnosticError>

Admit namespaced extension metadata and its component code counter.

The handle retains registration/descriptor generation scope. Disabled mode returns None without backend allocation. Explicit capacity failure may be reported using a summary-only classification overflow observation.

register_extension_class

pub fn register_extension_class(
    &self,
    extension: ExtensionHandle,
    name: &str,
) -> Result<Option<ExtensionClassHandle>, DiagnosticError>

Admit a custom failure-class name for a registered extension. Each code has four fixed class slots, each at most 32 bytes, within metadata budgets. Disabled contexts return None without registering metadata.

record_lazy

pub fn record_lazy<'a>(
    &self,
    make: impl FnOnce() -> Observation<'a>,
) -> Result<RecordOutcome, DiagnosticError>

Build and record one observation synchronously only when enabled.

Reserved summaries accept positive deltas independently of history pressure. Projections follow store unlocking. Disabled mode skips the factory and returns RecordOutcome::Disabled without loss accounting.

record_without_projection_lazy

pub fn record_without_projection_lazy<'a>(
    &self,
    make: impl FnOnce() -> Observation<'a>,
) -> Result<RecordOutcome, DiagnosticError>

Use the same recording boundary while bypassing every projection.

Sink feedback and existing operational emitters use this path to avoid output recursion or duplicates. Disabled mode skips the factory.

record

pub fn record(
    &self,
    observation: Observation<'_>,
) -> Result<RecordOutcome, DiagnosticError>

Record constructed evidence and attempt optional projections.

Disabled mode discards it but cannot undo caller construction work. Built-in producers use Self::record_lazy for diagnostic-only work.

record_without_projection

pub fn record_without_projection(
    &self,
    observation: Observation<'_>,
) -> Result<RecordOutcome, DiagnosticError>

Record constructed evidence without any projection callback.

Prefer Self::record_without_projection_lazy to skip construction while disabled. Counting and retention use the same canonical boundary.

Trait Implementations

impl Clone for ComponentRecorder

impl Clone for ComponentRecorder

clone

fn clone(&self) -> ComponentRecorder

clone_from

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

impl Debug for ComponentRecorder

impl Debug for ComponentRecorder

fmt

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