pub enum Error {
NotFound,
NameNotFound,
IndexIsLowerThanOne,
FailedToGetMonitorInfo,
FailedToGetMonitorSettings,
FailedToGetMonitorName,
FailedToParseMonitorIndex(ParseIntError),
FailedToConvertWindowsString(FromUtf16Error),
WindowsError(Error),
}展开描述
查询监视器或将它们转换为捕获项时可能发生的错误。
变体§
NotFound
没有监视器匹配查询。
由类似 Monitor::primary 或 Monitor::from_index 等方法在未找到任何监视器时返回。
NameNotFound
无法通过 DisplayConfig 检索监视器的友好名称。
IndexIsLowerThanOne
提供的监视器索引小于 1。
FailedToGetMonitorInfo
调用 GetMonitorInfoW 失败。
FailedToGetMonitorSettings
调用 EnumDisplaySettingsW 失败。
FailedToGetMonitorName
调用 EnumDisplayDevicesW 失败。
FailedToParseMonitorIndex(ParseIntError)
从设备名称(例如 \\.\DISPLAY1)解析数字索引失败。
FailedToConvertWindowsString(FromUtf16Error)
将 UTF-16 Windows 字符串转换为 String 失败。
WindowsError(Error)
Windows Runtime/Win32 API 调用失败。
包装了 windows::core::Error。
trait 实现§
Source§impl Error for Error
impl Error for Error
Source§impl From<FromUtf16Error> for Error
impl From<FromUtf16Error> for Error
Source§fn from(source: FromUtf16Error) -> Self
fn from(source: FromUtf16Error) -> Self
从输入类型转换为此类型。
Source§impl From<ParseIntError> for Error
impl From<ParseIntError> for Error
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
从输入类型转换为此类型。
自动 trait 实现§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket 实现§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
从拥有的值可变地借用。 了解更多
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
当
into_left 为 true 时,将 self 转换为
Left 变体的
Either<Self, Self>;
否则将其转换为
Right 变体的
Either<Self, Self>。
了解更多Source§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
当
into_left(&self) 返回 true 时,将 self 转换为
Left 变体的
Either<Self, Self>;
否则将其转换为
Right 变体的
Either<Self, Self>。
了解更多