Properly implement Debug for Window and EventLoop types (#3297)
For EventLoop, EventLoopBuilder, EventLoopProxy and by requiring it as a supertrait of Window and ActiveEventLoop. It is especially useful for user to be able to know that Window is Debug.
This commit is contained in:
parent
39c0862198
commit
be1baf164c
43 changed files with 152 additions and 42 deletions
|
|
@ -4,7 +4,7 @@ use std::collections::VecDeque;
|
|||
use std::rc::Rc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Instant;
|
||||
use std::{mem, panic};
|
||||
use std::{fmt, mem, panic};
|
||||
|
||||
use windows_sys::Win32::Foundation::HWND;
|
||||
|
||||
|
|
@ -40,6 +40,14 @@ pub(crate) struct EventLoopRunner {
|
|||
panic_error: Cell<Option<PanicError>>,
|
||||
}
|
||||
|
||||
impl fmt::Debug for EventLoopRunner {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("EventLoopRunner")
|
||||
.field("thread_msg_target", &self.thread_msg_target)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
pub type PanicError = Box<dyn Any + Send + 'static>;
|
||||
|
||||
/// See `move_state_to` function for details on how the state loop works.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue