Skip to main content

TelemetryRecorder

Trait TelemetryRecorder 

Source
pub trait TelemetryRecorder:
    Send
    + Sync
    + 'static {
    // Required methods
    fn record(&self, event: TelemetryEvent) -> Result<(), TelemetryHandleError>;
    fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>;
}
Expand description

统一遥测记录接口(方便 inject 时不需要 enum)。

Required Methods§

Source

fn record(&self, event: TelemetryEvent) -> Result<(), TelemetryHandleError>

记录一个事件。

Source

fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

等待关闭(Boxed future 以保持 dyn 兼容)。

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: TelemetryRecorder> TelemetryRecorder for Arc<T>

Source§

fn record(&self, event: TelemetryEvent) -> Result<(), TelemetryHandleError>

Source§

fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Implementors§