Skip to main content

EventRecord

Struct EventRecord 

Source
pub struct EventRecord {
    pub timestamp_ms: u64,
    pub kind: EventKind,
    pub event_type: &'static str,
    pub target: Option<ElementId>,
    pub chain: Vec<ElementId>,
    pub consumed_by: Option<ElementId>,
    pub detail: String,
}
Expand description

单条事件日志。按 EventKind 区分记录内容。

Fields§

§timestamp_ms: u64

从进程启动到现在的毫秒数(与其他 trace 同时钟源)。

§kind: EventKind

这条记录的语义:事件派发/投递/消费 / 焦点转移 / 竞技场胜者 / 命中测试。

§event_type: &'static str

WidgetEvent 的短名(“PointerDown” / “FocusGained” 等)。

§target: Option<ElementId>

这条记录关联的主目标 ElementId(可能是 None,比如空命中)。

§chain: Vec<ElementId>

命中链 / 冒泡链(按内→外顺序)。为空表示这条记录不关心链。

§consumed_by: Option<ElementId>

谁消费了事件(deliver_event 返回 true 的那个 element)。

§detail: String

自由文本(竞技场“Accepted=id“、焦点“old→new“、命中“overlay vs main“等)。

Trait Implementations§

Source§

impl Clone for EventRecord

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for EventRecord

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.