pub enum LatencyUnit {
Milli,
Micro,
Nano,
}
Expand description
Unit of time used to record latencies. Used as an argument in benchmarking functions.
Variants§
Implementations§
Source§impl LatencyUnit
impl LatencyUnit
Sourcepub fn latency_as_u64(&self, latency: Duration) -> u64
pub fn latency_as_u64(&self, latency: Duration) -> u64
Converts a latency
Duration
to a u64
value according to the unit self
.
Sourcepub fn latency_from_u64(&self, elapsed: u64) -> Duration
pub fn latency_from_u64(&self, elapsed: u64) -> Duration
Converts a u64
value to a Duration
according to the unit self
.
Sourcepub fn latency_as_f64(&self, latency: Duration) -> f64
pub fn latency_as_f64(&self, latency: Duration) -> f64
Converts a latency
Duration
to an f64
value according to the unit self
.
Sourcepub fn latency_from_f64(&self, elapsed: f64) -> Duration
pub fn latency_from_f64(&self, elapsed: f64) -> Duration
Converts an f64
value to a Duration
according to the unit self
.
Trait Implementations§
Source§impl Clone for LatencyUnit
impl Clone for LatencyUnit
Source§fn clone(&self) -> LatencyUnit
fn clone(&self) -> LatencyUnit
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LatencyUnit
impl Debug for LatencyUnit
impl Copy for LatencyUnit
Auto Trait Implementations§
impl Freeze for LatencyUnit
impl RefUnwindSafe for LatencyUnit
impl Send for LatencyUnit
impl Sync for LatencyUnit
impl Unpin for LatencyUnit
impl UnwindSafe for LatencyUnit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.