跳到主要内容

Event

搜索

结构体Event 

Source
pub struct Event {
    pub time: SystemTime,
    pub name: Option<String>,
    pub event_type: EventType,
}
展开描述

当事件从操作系统到达时,会根据 EventType 添加一些附加信息:事件被接收的时间,以及一个 name Option,其中包含该事件应产生的字符。这些信息依赖于操作系统的布局和键盘状态机制。注意:Linux(X11)上死键目前还无法工作——遇到死键时会收到 None,并返回原始字母而非带音标的字母。

字段§

§time: SystemTime§name: Option<String>§event_type: EventType

Trait 实现§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Event

返回该值的一个副本。阅读更多
1.0.0 · Source§

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

执行从 source. 阅读更多
Source§

impl Debug for Event

Source§

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

使用给定的格式化器格式化该值。阅读更多
Source§

impl PartialEq for Event

Source§

fn eq(&self, other: &Event) -> bool

测试 selfother 的值是否相等,并由 == 使用。
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

测试 !=。默认实现几乎总是足够的,除非有非常充分的理由,否则不应被重写。
Source§

impl StructuralPartialEq for Event

自动 Trait 实现§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

通用实现§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. 阅读更多
Source§

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

Source§

fn borrow(&self) -> &T

对拥有的值进行不可变借用。阅读更多
Source§

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

Source§

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

对拥有的值进行可变借用。阅读更多
Source§

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

Source§

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

🔬这是一个仅在 nightly 可见的实验性 API。(clone_to_uninit)
执行从 self to dest. 阅读更多
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

原样返回参数。

Source§

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

Source§

fn into(self) -> U

调用 U::from(self)

That is, this conversion is whatever the implementation of From<T> for U 的实现自行决定。

Source§

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

Source§

type Owned = T

获取所有权后得到的类型。
Source§

fn to_owned(&self) -> T

从借用的数据创建拥有的数据,通常通过克隆完成。阅读更多
Source§

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

使用借用的数据替换拥有的数据,通常通过克隆完成。阅读更多
Source§

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

Source§

type Error = Infallible

转换失败时返回的类型。
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行转换。
Source§

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

Source§

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

转换失败时返回的类型。
Source§

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

执行转换。