pub enum CaptureControlError<E> {
FailedToJoinThread,
ThreadHandleIsTaken,
FailedToPostThreadMessage,
StoppedHandlerError(E),
GraphicsCaptureApiError(GraphicsCaptureApiError<E>),
}展开描述
通过 CaptureControl 控制运行中的捕获会话时可能发生的错误。
此错误包装了来自 Windows Graphics Capture 流水线的底层错误,以及 启动/停止后台捕获线程时的线程控制失败。
变体§
FailedToJoinThread
后台捕获线程的 join 失败(panic 或操作系统级别的 join 错误)。
如果内部线程 panic 或无法被 join,则由 CaptureControl::wait 和 CaptureControl::stop 返回。
ThreadHandleIsTaken
std::thread::JoinHandle 已经被从结构体中取出(例如通过调用
CaptureControl::into_thread_handle),因此操作无法继续。
FailedToPostThreadMessage
无法向捕获线程发送 WM_QUIT 消息以请求关闭。
这可能发生在线程已不再存活或 Windows 拒绝该消息的情况下。
StoppedHandlerError(E)
用户提供的处理器在捕获停止后返回了错误。
此变体携带处理器的错误类型。
GraphicsCaptureApiError(GraphicsCaptureApiError<E>)
来自图形捕获流水线的底层错误。
trait 实现§
源代码§impl<E: Debug> Debug for CaptureControlError<E>
impl<E: Debug> Debug for CaptureControlError<E>
源代码§impl<E> Display for CaptureControlError<E>
impl<E> Display for CaptureControlError<E>
源代码§impl<E> Error for CaptureControlError<E>
impl<E> Error for CaptureControlError<E>
源代码§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. 阅读更多
1.0.0 · 源代码§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
源代码§impl<E> From<GraphicsCaptureApiError<E>> for CaptureControlError<E>
impl<E> From<GraphicsCaptureApiError<E>> for CaptureControlError<E>
源代码§fn from(source: GraphicsCaptureApiError<E>) -> Self
fn from(source: GraphicsCaptureApiError<E>) -> Self
从输入类型转换为该类型。
自动 trait 实现§
impl<E> Freeze for CaptureControlError<E>where
E: Freeze,
impl<E> RefUnwindSafe for CaptureControlError<E>where
E: RefUnwindSafe,
impl<E> Send for CaptureControlError<E>where
E: Send,
impl<E> Sync for CaptureControlError<E>where
E: Sync,
impl<E> Unpin for CaptureControlError<E>where
E: Unpin,
impl<E> UnsafeUnpin for CaptureControlError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for CaptureControlError<E>where
E: UnwindSafe,
blanket 实现§
源代码§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
源代码§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
从拥有的值可变地借用。 阅读更多
源代码§impl<T> IntoEither for T
impl<T> IntoEither for T
源代码§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. 阅读更多源代码§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. 阅读更多