pub enum Observation<L> {
Observed {
label: L,
count: u64,
timestamp: Instant,
},
ObservedOne {
label: L,
timestamp: Instant,
},
ObservedOneValue {
label: L,
value: ObservedValue,
timestamp: Instant,
},
}Expand description
An observation that has been made.
Be aware that not all instruments handle all
observations or values.
E.g. a Meter does not take the value of
an Observation::ObservedOneValue into account but
simply counts the observation as one occurrence.
Variants§
Observed
Observed many occurrences with no value at the given timestamp
ObservedOne
Observed one occurrence without a value at the given timestamp
ObservedOneValue
Observed one occurrence with a value at a given timestamp.
Implementations§
Source§impl<L> Observation<L>
impl<L> Observation<L>
pub fn observed(label: L, count: u64, timestamp: Instant) -> Self
pub fn observed_now(label: L, count: u64) -> Self
pub fn observed_one(label: L, timestamp: Instant) -> Self
pub fn observed_one_now(label: L) -> Self
pub fn observed_one_value<T: Into<ObservedValue>>( label: L, value: T, timestamp: Instant, ) -> Self
pub fn observed_one_value_now<T: Into<ObservedValue>>( label: L, value: T, ) -> Self
Source§impl<L> Observation<L>
impl<L> Observation<L>
Trait Implementations§
Source§impl<L: Debug> Debug for Observation<L>
impl<L: Debug> Debug for Observation<L>
Source§impl<'a, T> From<&'a Observation<T>> for BorrowedLabelAndUpdate<'a, T>
impl<'a, T> From<&'a Observation<T>> for BorrowedLabelAndUpdate<'a, T>
Source§fn from(obs: &'a Observation<T>) -> BorrowedLabelAndUpdate<'a, T>
fn from(obs: &'a Observation<T>) -> BorrowedLabelAndUpdate<'a, T>
Converts to this type from the input type.
Source§impl<T> From<Observation<T>> for LabelAndUpdate<T>
impl<T> From<Observation<T>> for LabelAndUpdate<T>
Source§fn from(obs: Observation<T>) -> LabelAndUpdate<T>
fn from(obs: Observation<T>) -> LabelAndUpdate<T>
Converts to this type from the input type.
Auto Trait Implementations§
impl<L> Freeze for Observation<L>where
L: Freeze,
impl<L> RefUnwindSafe for Observation<L>where
L: RefUnwindSafe,
impl<L> Send for Observation<L>where
L: Send,
impl<L> Sync for Observation<L>where
L: Sync,
impl<L> Unpin for Observation<L>where
L: Unpin,
impl<L> UnsafeUnpin for Observation<L>where
L: UnsafeUnpin,
impl<L> UnwindSafe for Observation<L>where
L: UnwindSafe,
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