[][src]Struct opentelemetry::metrics::Number

pub struct Number(_);
This is supported on crate feature metrics only.

Number represents either an integral or a floating point value. It needs to be accompanied with a source of NumberKind that describes the actual type of the value stored within Number.

Implementations

impl Number[src]

pub fn to_atomic(&self) -> AtomicNumber[src]

Create an atomic version of the current number

pub fn partial_cmp(
    &self,
    number_kind: &NumberKind,
    other: &Number
) -> Option<Ordering>
[src]

Compares this number to the given other number. Both should be of the same kind.

pub fn to_i64(&self, number_kind: &NumberKind) -> i64[src]

Casts the number to i64. May result in data/precision loss.

pub fn to_f64(&self, number_kind: &NumberKind) -> f64[src]

Casts the number to f64. May result in data/precision loss.

pub fn to_u64(&self, number_kind: &NumberKind) -> u64[src]

Casts the number to u64. May result in data/precision loss.

pub fn is_nan(&self) -> bool[src]

Checks if this value ia an f64 nan value. Do not use on non-f64 values.

pub fn is_negative(&self, number_kind: &NumberKind) -> bool[src]

true if the actual value is less than zero.

pub fn to_debug(&self, kind: &NumberKind) -> Box<dyn Debug>[src]

Return loaded data for debugging purposes

Trait Implementations

impl Clone for Number[src]

impl Debug for Number[src]

impl Default for Number[src]

impl From<f64> for Number[src]

impl From<i64> for Number[src]

impl From<u64> for Number[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,