pub struct Timer<T = MonotonicTimeline>(/* private fields */);Expand description
An object representing a Zircon timer, such as the one returned by zx_timer_create.
As essentially a subtype of NullableHandle, it can be freely interconverted.
Implementations§
Source§impl<T> Timer<T>where
T: Timeline,
impl<T> Timer<T>where
T: Timeline,
Sourcepub fn info(&self) -> Result<TimerInfo<T>, Status>
pub fn info(&self) -> Result<TimerInfo<T>, Status>
Wraps the zx_object_get_info syscall for the ZX_INFO_TIMER_T topic.
Sourcepub fn into_raw(self) -> u32
pub fn into_raw(self) -> u32
Return the raw handle’s integer value without closing it when self is dropped.
Sourcepub fn duplicate(&self, rights: Rights) -> Result<Timer<T>, Status>
pub fn duplicate(&self, rights: Rights) -> Result<Timer<T>, Status>
Wraps the
zx_handle_duplicate
syscall.
Sourcepub fn replace(self, rights: Rights) -> Result<Timer<T>, Status>
pub fn replace(self, rights: Rights) -> Result<Timer<T>, Status>
Wraps the
zx_handle_replace
syscall.
Sourcepub fn signal(
&self,
clear_mask: Signals,
set_mask: Signals,
) -> Result<(), Status>
pub fn signal( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>
Wraps the
zx_object_signal
syscall.
Sourcepub fn wait_one(
&self,
signals: Signals,
deadline: Instant<MonotonicTimeline>,
) -> WaitResult
pub fn wait_one( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> WaitResult
Wraps the
zx_object_wait_one
syscall.
Source§impl Timer
impl Timer
Sourcepub fn create() -> Timer
pub fn create() -> Timer
Create a timer, an object that can signal when a specified point on the monotonic clock has been reached. Wraps the zx_timer_create syscall.
§Panics
If the kernel reports no memory available to create a timer or the process’ job policy denies timer creation.
Source§impl Timer<BootTimeline>
impl Timer<BootTimeline>
Sourcepub fn create() -> Timer<BootTimeline>
pub fn create() -> Timer<BootTimeline>
Create a timer, an object that can signal when a specified point on the boot clock has been reached. Wraps the zx_timer_create syscall.
If the timer elapses while the system is suspended it will not wake the system.
§Panics
If the kernel reports no memory available to create a timer or the process’ job policy denies timer creation.
Trait Implementations§
Source§impl<T> AsHandleRef for Timer<T>where
T: Timeline,
impl<T> AsHandleRef for Timer<T>where
T: Timeline,
Source§fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
object_wait_many.