跳到主要内容

Error

搜索

枚举 Error 

Source
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)

图像编码失败。

包装了 crate::encoder::ImageEncoderError

§

IoError(Error)

将图像写入磁盘时发生 I/O 错误。

包装了 std::io::Error

§

WindowsError(Error)

Windows API 错误。

Trait 实现§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

返回此错误的更低层来源(若有)。阅读更多
1.0.0 · Source§

fn description(&self) -> &str

👎自 1.42.0 起已弃用:使用 Display 实现或 to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎自 1.33.0 起已弃用:已被 Error::source 取代,后者支持 downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬这是一个仅在 nightly 提供的实验性 API。(error_generic_member_access
提供基于类型的上下文访问,用于错误报告。阅读更多
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

从输入类型转换到此类型。
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

从输入类型转换到此类型。
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

从输入类型转换到此类型。
Source§

impl From<ImageEncoderError> for Error

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
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)

也就是说,此转换由 From<T> for U 的实现自行决定。

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

into_lefttrue,则将 self 转换为 Left 变体 (属于 Either<Self, Self>)。 否则将 self 转换为 Right 变体 (属于 Either<Self, Self>)。阅读更多
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

into_left(&self) 返回 true,则将 self 转换为 Left 变体 (属于 Either<Self, Self>)。 否则将 self 转换为 Right 变体 (属于 Either<Self, Self>)。阅读更多
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

指针的对齐方式。
Source§

type Init = T

初始化器的类型。
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

使用给定的初始化器初始化 a。阅读更多
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

解引用给定的指针。阅读更多
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

可变地解引用给定的指针。阅读更多
Source§

unsafe fn drop(ptr: usize)

丢弃给定指针指向的对象。阅读更多
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

将给定的值转换为 String阅读更多
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>

执行转换。