pub struct WindowState {
pub window_type: WindowType,
pub events: Vec<WindowEvent>,
pub window_start: u64,
pub last_event_time: u64,
}Expand description
State for a window, buffering events and determining when to fire.
Fields§
§window_type: WindowType§events: Vec<WindowEvent>§window_start: u64§last_event_time: u64Implementations§
Source§impl WindowState
impl WindowState
pub fn new(window_type: WindowType) -> Self
Sourcepub fn should_fire(&self, current_time: u64) -> bool
pub fn should_fire(&self, current_time: u64) -> bool
Check if the window should fire (emit results).
Sourcepub fn fire(&mut self) -> Vec<WindowEvent>
pub fn fire(&mut self) -> Vec<WindowEvent>
Fire the window: drain events and reset. Returns the events that were in the window.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowState
impl RefUnwindSafe for WindowState
impl Send for WindowState
impl Sync for WindowState
impl Unpin for WindowState
impl UnsafeUnpin for WindowState
impl UnwindSafe for WindowState
Blanket Implementations§
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
Mutably borrows from an owned value. Read more