pub struct AtomicInstant { /* private fields */ }
Expand description

An Instant, stored as an AtomicDuration offset from an arbitrary epoch.

Due to Instant not having any const epoch, that epoch is taken by calling Instant::now() at construction. AtomicInstant’s range and resolution are bound by those of AtomicDuration.

Defaults to Instant::now().

Implementations

Constructs a new AtomicInstant, using Instant::now() as epoch.

Atomically loads the internal atomic using the specified Ordering, and uses it to reconstruct the corresponding Instant.

Converts the Instant into an atomically storeable value, and stores it atomically using the specified Ordering.

A shortcut for self.store(std::time::Instant::now(), ord).

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.