pub enum Error {
InvalidSize,
OutputNotFound,
Timeout,
AccessLost,
DirectXError(Error),
InvalidStagingTexture(&'static str),
ImageEncoderError(ImageEncoderError),
IoError(Error),
WindowsError(Error),
}展开描述
使用 DXGI 桌面复制 API 包装器时可能发生的错误。
变体§
InvalidSize
裁剪矩形无效(任一坐标轴上起点 >= 终点)。
OutputNotFound
未找到与所提供显示器对应的 DXGI 输出。
Timeout
AcquireNextFrame 在超时前没有新帧可用。
AccessLost
复制访问权限已丢失,必须重新创建。
DirectXError(Error)
DirectX 设备创建或相关错误。
InvalidStagingTexture(&'static str)
提供给 DxgiDuplicationFrame::buffer_with 的 Staging 纹理无效或不匹配。
ImageEncoderError(ImageEncoderError)
图像编码失败。
IoError(Error)
将图像写入磁盘时发生 I/O 错误。
包装了 std::io::Error。
WindowsError(Error)
Windows API 错误。
Trait 实现§
Source§impl Error for Error
impl Error for Error
Source§impl From<ImageEncoderError> for Error
impl From<ImageEncoderError> for Error
Source§fn from(source: ImageEncoderError) -> Self
fn from(source: ImageEncoderError) -> 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
通用实现§
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>)。
否则将 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>)。
否则将 self 转换为 Right 变体
(属于 Either<Self, Self>)。阅读更多