Trait piston::IdleEvent [−][src]
pub trait IdleEvent { pub fn from_idle_args(args: &IdleArgs, old_event: &Self) -> Option<Self>; pub fn idle<U, F>(&self, f: F) -> Option<U>
where
F: FnMut(&IdleArgs) -> U; pub fn from_dt(dt: f64, old_event: &Self) -> Option<Self> { ... } pub fn idle_args(&self) -> Option<IdleArgs> { ... } }
When background tasks should be performed.
Required methods
pub fn from_idle_args(args: &IdleArgs, old_event: &Self) -> Option<Self>
[src][−]
Creates an idle event.
pub fn idle<U, F>(&self, f: F) -> Option<U> where
F: FnMut(&IdleArgs) -> U,
[src][−]
F: FnMut(&IdleArgs) -> U,
Calls closure if this is an idle event.
Provided methods
pub fn from_dt(dt: f64, old_event: &Self) -> Option<Self>
[src][−]
Creates an update event with delta time.
pub fn idle_args(&self) -> Option<IdleArgs>
[src][−]
Returns idle arguments.