pub struct Timer { /* private fields */ }Expand description
RAII wrapper for LVGL’s built-in timer.
LVGL timers fire from inside lvgl::handler() while the LVGL lock is
already held, so callbacks must NOT call lock again — the mutex is
not reentrant and you will deadlock. Prefer Timer over ove::Timer
for UI-update ticks that only touch LVGL state.
Dropping the Timer deletes the underlying lv_timer_t.
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn new(cb: lv_timer_cb_t, period_ms: u32, user_data: *mut c_void) -> Self
pub fn new(cb: lv_timer_cb_t, period_ms: u32, user_data: *mut c_void) -> Self
Create and start an LVGL timer.
§Safety
cb must be an extern "C" fn(*mut lv_timer_t) and user_data
must remain valid until the timer is dropped or its repeat count
reaches zero.
Sourcepub fn repeat_count(&self, count: i32) -> &Self
pub fn repeat_count(&self, count: i32) -> &Self
Fluent: set the number of times the timer fires; -1 for infinite.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Unpin for Timer
impl UnsafeUnpin for Timer
impl UnwindSafe for Timer
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