Struct pipewire::loop_::TimerSource
source · pub struct TimerSource<'l> { /* private fields */ }
Expand description
A source that can be used to have a callback called on a timer.
This source can be obtained by calling add_timer
on a loop, registering a callback to it.
The timer starts out inactive.
You can arm or disarm the timer by calling update_timer
.
Implementations§
source§impl<'l> TimerSource<'l>
impl<'l> TimerSource<'l>
sourcepub fn update_timer(
&self,
value: Option<Duration>,
interval: Option<Duration>
) -> SpaResult
pub fn update_timer( &self, value: Option<Duration>, interval: Option<Duration> ) -> SpaResult
Arm or disarm the timer.
The timer will be called the next time after the provided value
duration.
After that, the timer will be repeatedly called again at the the specified interval
.
If interval
is None
or zero, the timer will only be called once.
If value
is None
or zero, the timer will be disabled.
§Panics
The provided durations seconds must fit in an i64. Otherwise, this function will panic.
Trait Implementations§
source§impl<'l> Drop for TimerSource<'l>
impl<'l> Drop for TimerSource<'l>
source§impl<'l> IsSource for TimerSource<'l>
impl<'l> IsSource for TimerSource<'l>
source§fn as_ptr(&self) -> *mut spa_source
fn as_ptr(&self) -> *mut spa_source
Return a valid pointer to a raw
spa_source
.Auto Trait Implementations§
impl<'l> !RefUnwindSafe for TimerSource<'l>
impl<'l> !Send for TimerSource<'l>
impl<'l> !Sync for TimerSource<'l>
impl<'l> Unpin for TimerSource<'l>
impl<'l> !UnwindSafe for TimerSource<'l>
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