pub struct Instant { /* private fields */ }Expand description
Point dans le temps associé à une horloge Linux spécifique.
Implementations§
Source§impl Instant
impl Instant
Sourcepub const fn try_new(
clock: Clock,
seconds: i64,
nanoseconds: u32,
) -> Option<Self>
pub const fn try_new( clock: Clock, seconds: i64, nanoseconds: u32, ) -> Option<Self>
Construit un Instant après validation des champs temporels.
Sourcepub const fn nanoseconds(self) -> u32
pub const fn nanoseconds(self) -> u32
Composante nanosecondes, toujours < 1_000_000_000.
Sourcepub fn as_duration_since_epoch(self) -> Duration
pub fn as_duration_since_epoch(self) -> Duration
Conversion en durée depuis l’époque de l’horloge.
Si la composante secondes est négative, retourne Duration::ZERO.
Sourcepub fn checked_duration_since(self, earlier: Instant) -> Option<Duration>
pub fn checked_duration_since(self, earlier: Instant) -> Option<Duration>
Différence positive entre deux instants de même horloge.
Sourcepub fn saturating_duration_since(self, earlier: Instant) -> Duration
pub fn saturating_duration_since(self, earlier: Instant) -> Duration
Variante saturante de Self::checked_duration_since.
Trait Implementations§
impl Copy for Instant
impl Eq for Instant
Source§impl Ord for Instant
impl Ord for Instant
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Instant
impl PartialOrd for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl Freeze for Instant
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnsafeUnpin for Instant
impl UnwindSafe for Instant
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