Skip to main content

UsageRecorder

Trait UsageRecorder 

Source
pub trait UsageRecorder: Send + Sync {
    // Required method
    fn record(&self, event: UsageEvent) -> Result<RecordOutcome, RecordError>;
}
Expand description

A synchronous usage sink suitable for the HTTP hot path.

Required Methods§

Source

fn record(&self, event: UsageEvent) -> Result<RecordOutcome, RecordError>

Add one event without performing I/O.

§Errors

Returns RecordError only when the local synchronization primitive is unusable; provider outages cannot surface on this path.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§