Struct vise::DurationAsSecs
source · pub struct DurationAsSecs(pub Duration);
Expand description
Wraps a Duration
so that it can be used as a label value, which will be set to the fractional
number of seconds in the duration, i.e. Duration::as_secs_f64()
. Mostly useful for Info
metrics.
Tuple Fields§
§0: Duration
Trait Implementations§
source§impl Clone for DurationAsSecs
impl Clone for DurationAsSecs
source§fn clone(&self) -> DurationAsSecs
fn clone(&self) -> DurationAsSecs
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 DurationAsSecs
impl Debug for DurationAsSecs
source§impl EncodeLabelValue for DurationAsSecs
impl EncodeLabelValue for DurationAsSecs
source§fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result
fn encode(&self, encoder: &mut LabelValueEncoder<'_>) -> Result
Encode oneself into the given encoder.
source§impl From<Duration> for DurationAsSecs
impl From<Duration> for DurationAsSecs
source§impl Hash for DurationAsSecs
impl Hash for DurationAsSecs
source§impl Ord for DurationAsSecs
impl Ord for DurationAsSecs
source§fn cmp(&self, other: &DurationAsSecs) -> Ordering
fn cmp(&self, other: &DurationAsSecs) -> Ordering
1.21.0 · 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 PartialEq for DurationAsSecs
impl PartialEq for DurationAsSecs
source§fn eq(&self, other: &DurationAsSecs) -> bool
fn eq(&self, other: &DurationAsSecs) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for DurationAsSecs
impl PartialOrd for DurationAsSecs
source§fn partial_cmp(&self, other: &DurationAsSecs) -> Option<Ordering>
fn partial_cmp(&self, other: &DurationAsSecs) -> Option<Ordering>
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 moreimpl Copy for DurationAsSecs
impl Eq for DurationAsSecs
impl StructuralPartialEq for DurationAsSecs
Auto Trait Implementations§
impl Freeze for DurationAsSecs
impl RefUnwindSafe for DurationAsSecs
impl Send for DurationAsSecs
impl Sync for DurationAsSecs
impl Unpin for DurationAsSecs
impl UnwindSafe for DurationAsSecs
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: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)