pub struct Idler { /* private fields */ }Expand description
This struct handles the main loop going to idle when there is no user input for a while.
Implementations§
Source§impl Idler
impl Idler
Sourcepub fn set_idle_time(&mut self, time: Duration)
pub fn set_idle_time(&mut self, time: Duration)
Sets the maximum time that the window will be rendered without user input.
Sourcepub fn set_idle_frame_count(&mut self, frame_count: u32)
pub fn set_idle_frame_count(&mut self, frame_count: u32)
Sets the maximum number of frames time that the window will be rendered without user input.
Sourcepub fn incr_frame(&mut self)
pub fn incr_frame(&mut self)
Call this when the window is renderer.
Sourcepub fn has_to_render(&self) -> bool
pub fn has_to_render(&self) -> bool
Check whether the window should go to idle or keep on rendering.
Sourcepub fn ping_user_input(&mut self)
pub fn ping_user_input(&mut self)
Notify this struct that user input happened.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Idler
impl RefUnwindSafe for Idler
impl Send for Idler
impl Sync for Idler
impl Unpin for Idler
impl UnwindSafe for Idler
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
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> ⓘ
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. Read moreSource§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. Read more