pub trait TrajectorySink: Send + Sync {
// Required method
fn emit<'life0, 'async_trait>(
&'life0 self,
event: TrajectoryEvent,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
轨迹事件的下游。实现者负责把事件送到日志 / channel / websocket 等。
emit 不返回错误:可观测性不应阻断主流程,投递失败(如 channel 关闭)由实现内部吞掉。
Required Methods§
fn emit<'life0, 'async_trait>(
&'life0 self,
event: TrajectoryEvent,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".