Skip to main content

Event

Trait Event 

Source
pub trait Event:
    Send
    + Sync
    + 'static {
    // Required methods
    fn event_type(&self) -> EventTypeName;
    fn event_id(&self) -> &EventId;
    fn timestamp(&self) -> u64;
}
Expand description

事件基础 trait

所有事件必须实现此 trait,定义事件的基本属性。

Required Methods§

Source

fn event_type(&self) -> EventTypeName

获取事件类型名称

Source

fn event_id(&self) -> &EventId

获取事件 ID

Source

fn timestamp(&self) -> u64

获取事件时间戳

Implementors§

Source§

impl<T: Serialize + Send + Sync + 'static> Event for BaseEvent<T>