Struct clocksource::Nanoseconds
source · #[repr(transparent)]pub struct Nanoseconds<T> { /* private fields */ }
Expand description
A container for time types that stores nanoseconds.
Implementations§
source§impl Nanoseconds<u64>
impl Nanoseconds<u64>
pub fn checked_add(&self, other: Self) -> Option<Self>
pub fn checked_sub(&self, other: Self) -> Option<Self>
pub fn saturating_add(&self, other: Self) -> Self
pub fn saturating_sub(&self, other: Self) -> Self
source§impl Nanoseconds<AtomicU64>
impl Nanoseconds<AtomicU64>
pub fn new(value: Nanoseconds<u64>) -> Self
pub fn load(&self, ordering: Ordering) -> Nanoseconds<u64>
pub fn store(&self, value: Nanoseconds<u64>, ordering: Ordering)
pub fn swap(
&self,
value: Nanoseconds<u64>,
ordering: Ordering
) -> Nanoseconds<u64>
pub fn compare_exchange(
&self,
current: Nanoseconds<u64>,
new: Nanoseconds<u64>,
success: Ordering,
failure: Ordering
) -> Result<Nanoseconds<u64>, Nanoseconds<u64>>
pub fn compare_exchange_weak(
&self,
current: Nanoseconds<u64>,
new: Nanoseconds<u64>,
success: Ordering,
failure: Ordering
) -> Result<Nanoseconds<u64>, Nanoseconds<u64>>
source§impl Nanoseconds<AtomicU64>
impl Nanoseconds<AtomicU64>
pub fn fetch_add(
&self,
value: Nanoseconds<u64>,
ordering: Ordering
) -> Nanoseconds<u64>
pub fn fetch_sub(
&self,
value: Nanoseconds<u64>,
ordering: Ordering
) -> Nanoseconds<u64>
Trait Implementations§
source§impl Add<Nanoseconds<u64>> for Nanoseconds<u64>
impl Add<Nanoseconds<u64>> for Nanoseconds<u64>
source§impl AddAssign<Nanoseconds<u64>> for Nanoseconds<u64>
impl AddAssign<Nanoseconds<u64>> for Nanoseconds<u64>
source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+=
operation. Read moresource§impl<T> Clone for Nanoseconds<T>where
T: Clone,
impl<T> Clone for Nanoseconds<T>where
T: Clone,
source§impl<T> Hash for Nanoseconds<T>where
T: Hash,
impl<T> Hash for Nanoseconds<T>where
T: Hash,
source§impl<T> Ord for Nanoseconds<T>where
T: Ord,
impl<T> Ord for Nanoseconds<T>where
T: Ord,
source§impl<T> PartialEq<Nanoseconds<T>> for Nanoseconds<T>where
T: PartialEq,
impl<T> PartialEq<Nanoseconds<T>> for Nanoseconds<T>where
T: PartialEq,
source§impl<T> PartialOrd<Nanoseconds<T>> for Nanoseconds<T>where
T: PartialOrd,
impl<T> PartialOrd<Nanoseconds<T>> for Nanoseconds<T>where
T: PartialOrd,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Sub<Nanoseconds<u64>> for Nanoseconds<u64>
impl Sub<Nanoseconds<u64>> for Nanoseconds<u64>
source§impl SubAssign<Nanoseconds<u64>> for Nanoseconds<u64>
impl SubAssign<Nanoseconds<u64>> for Nanoseconds<u64>
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-=
operation. Read more