pub struct MainWindowIdler { /* 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 MainWindowIdler
impl MainWindowIdler
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§
Source§impl Default for MainWindowIdler
impl Default for MainWindowIdler
Source§fn default() -> MainWindowIdler
fn default() -> MainWindowIdler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MainWindowIdler
impl RefUnwindSafe for MainWindowIdler
impl Send for MainWindowIdler
impl Sync for MainWindowIdler
impl Unpin for MainWindowIdler
impl UnwindSafe for MainWindowIdler
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.