pub struct EngineTimer { /* private fields */ }Expand description
Concrete timer with a callback handler.
When the timer fires, the handler function is called. This mirrors
Python’s EngineTimer which has _fire() calling handler.ev_timer().
Implementations§
Source§impl EngineTimer
impl EngineTimer
Sourcepub fn new(
fire_delay: f64,
interval: f64,
autoclose: bool,
handler: impl FnMut() + Send + 'static,
) -> Self
pub fn new( fire_delay: f64, interval: f64, autoclose: bool, handler: impl FnMut() + Send + 'static, ) -> Self
Create a new EngineTimer.
§Arguments
fire_delay- Seconds until timer fires (-1.0 means not armed)interval- Seconds between repeats (-1.0 means no repeat)autoclose- Whether to autoclose the associated clienthandler- Callback invoked when the timer fires
Sourcepub fn base(&self) -> &EngineBaseTimer
pub fn base(&self) -> &EngineBaseTimer
Get a reference to the underlying EngineBaseTimer.
Sourcepub fn base_mut(&mut self) -> &mut EngineBaseTimer
pub fn base_mut(&mut self) -> &mut EngineBaseTimer
Get a mutable reference to the underlying EngineBaseTimer.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for EngineTimer
impl !Sync for EngineTimer
impl !UnwindSafe for EngineTimer
impl Freeze for EngineTimer
impl Send for EngineTimer
impl Unpin for EngineTimer
impl UnsafeUnpin for EngineTimer
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