doc.rust-lang.org
pub const fn as_secs(&self) -> u64
Returns the number of whole seconds contained by this Duration.
method
core
Stable since 1.3.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_nanos(&self) -> u128
Returns the total number of nanoseconds contained by this Duration.
method
core
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_millis(&self) -> u128
Returns the total number of whole milliseconds contained by this Duration.
method
core
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_micros(&self) -> u128
Returns the total number of whole microseconds contained by this Duration.
method
core
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn abs_diff(self, other: Duration) -> Duration
Computes the absolute difference between self and other.
method
core
Stable since 1.81.0
Version 1.100.0-nightly
doc.rust-lang.org
const ZERO: Duration
A duration of zero time.
associated_constant
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
const MAX: Duration
The maximum duration.
associated_constant
core
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Duration
A Duration type to represent a span of time, typically used for system timeouts.
struct
core
Stable since 1.3.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod time
Temporal quantification.
module
core
Stable since 1.25.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn will_wake(&self, other: &Waker) -> bool
Returns true if this Waker and another Waker would awake the same task.
method
core
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn wake_by_ref(&self)
Wakes up the task associated with this Waker without consuming the Waker.
method
core
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn wake(self)
Wakes up the task associated with this Waker.
method
core
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn vtable(&self) -> &'static RawWakerVTable
Gets the vtable pointer used to create this Waker.
method
core
Stable since 1.83.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn noop() -> &'static Waker
Returns a reference to a Waker that does nothing when used.
associated_function
core
Stable since 1.85.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn new(data: *const (), vtable: &'static RawWakerVTable) -> Self
Creates a new Waker from the provided data pointer and vtable.
associated_function
core
Stable since 1.83.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_raw(waker: RawWaker) -> Waker
Creates a new Waker from RawWaker.
associated_function
core
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn data(&self) -> *const ()
Gets the data pointer used to create this Waker.
method
core
Stable since 1.83.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Waker
A Waker is a handle for waking up a task by notifying its executor that it is ready to be run.
struct
core
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new(clone: unsafe fn(_: *const ()) -> RawWaker, wake: unsafe fn(_: *const ()), wake_by_ref: unsafe fn(_: *const ()), drop: unsafe fn(_: *const ())) -> Self
Creates a new RawWakerVTable from the provided clone, wake, wake_by_ref, and drop functions.
associated_function
core
Stable since 1.36.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct RawWakerVTable
A virtual function pointer table (vtable) that specifies the behavior of a RawWaker.
struct
core
Stable since 1.36.0
Version 1.100.0-nightly