跳到主要内容

GrabError

搜索

枚举GrabError 

Source
#[non_exhaustive]
pub enum GrabError { EventTapError, LoopSourceError, MissingDisplayError, KeyboardError, KeyHookError(u32), MouseHookError(u32), SimulateError, IoError(Error), }
展开描述

尝试抓取操作系统事件时可能发生的错误。注意在 Mac 上,不设置辅助功能不会导致错误,只是会忽略事件。

变体(非穷尽)§

此枚举被标记为非穷尽
非穷尽枚举将来可能会添加更多变体。因此,在对非穷尽枚举的变体进行匹配时,必须添加一个额外的通配符分支以应对未来可能新增的变体。
§

EventTapError

MacOS

§

LoopSourceError

MacOS

§

MissingDisplayError

Linux

§

KeyboardError

Linux

§

KeyHookError(u32)

Windows

§

MouseHookError(u32)

Windows

§

SimulateError

全部

§

IoError(Error)

Trait 实现§

Source§

impl Debug for GrabError

Source§

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

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

impl From<Error> for GrabError

Source§

fn from(err: Error) -> GrabError

从输入类型转换为该类型。
Source§

impl From<SimulateError> for GrabError

Source§

fn from(_: SimulateError) -> GrabError

从输入类型转换为该类型。

自动 Trait 实现§

通用实现§

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> 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, 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>

执行转换。