Enum Never

Source
pub enum Never {}
Expand description

Functions taking Never as an argument can never be called directly.

Trait Implementations§

Source§

impl Metric<Never> for InvocationCount

Source§

type Output = u64

The type of elements recorded by the metric. For a delta of last vs current, this might be an n-dimentional vector. It typically needs to be an Owned type, rather than a reference. Read more
Source§

fn observe_opt(&mut self, _: Never) -> Option<Self::Output>

Similar to observe except None is returned instead of f64::NAN to indicate not enough data collected. Useful if you like Read more
Source§

fn observe(&mut self, x: Input) -> f64
where Self::Output: Into<f64>,

Records the value, and return the calculated metric. If there are not enough samples to calculate the metric, f64::NAN is returned, which will always compare false. So a tolerance check observe(x) < 0.0001 will fail until enough samples have been collected. If you don’t like NANs, then Metric::observe_opt is your friend.
Source§

impl StatefulMetric<Never> for InvocationCount

Source§

fn store(&mut self, _: Never)

Stores the value, and likely discards older values.
Source§

fn value_opt(&self) -> Option<Self::Output>

The calculated value. Read more
Source§

fn observe_opt(&mut self, x: Input) -> Option<Self::Output>

Source§

fn value(&self) -> f64
where Self::Output: Into<f64>,

The calculated value. Read more

Auto Trait Implementations§

§

impl Freeze for Never

§

impl RefUnwindSafe for Never

§

impl Send for Never

§

impl Sync for Never

§

impl Unpin for Never

§

impl UnwindSafe for Never

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.