pub enum Measurement<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> {
Exact(V),
Range(V, V),
UpperBound(V),
}
Expand description
A Measurement
is a quantity that can be measured.
The variants of the Measurement
defines a condition associated with the measurable quantity.
Variants§
Implementations§
Source§impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Measurement<V>
impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Measurement<V>
Sourcepub fn matches(&self, candidate: V) -> bool
pub fn matches(&self, candidate: V) -> bool
Returns true
if the value matches the metric.
For an Exact
metric, value
must be equal to the exact value defined by the metric.
For a Range
metric, value
must be satisfy lower bound and the upper bound.
For an UpperBound
metric, value
must be satisfy the upper bound.
Trait Implementations§
Source§impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Add for Measurement<V>
impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Add for Measurement<V>
Source§fn add(self, other: Measurement<V>) -> Self::Output
fn add(self, other: Measurement<V>) -> Self::Output
Adds two variants of Measurement
together, returning the newly-summed Measurement
.
Source§type Output = Measurement<V>
type Output = Measurement<V>
The resulting type after applying the
+
operator.Source§impl<V: Clone + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Clone for Measurement<V>
impl<V: Clone + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Clone for Measurement<V>
Source§fn clone(&self) -> Measurement<V>
fn clone(&self) -> Measurement<V>
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<V: Debug + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Debug for Measurement<V>
impl<V: Debug + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Debug for Measurement<V>
Source§impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Display for Measurement<V>
impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Display for Measurement<V>
Source§impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Mul<V> for Measurement<V>
impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Mul<V> for Measurement<V>
Source§impl<V: PartialEq + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> PartialEq for Measurement<V>
impl<V: PartialEq + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> PartialEq for Measurement<V>
impl<V: Copy + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Copy for Measurement<V>
impl<V: Eq + Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> Eq for Measurement<V>
impl<V: Copy + Debug + Display + Ord + Add<Output = V> + Sub<Output = V> + Mul<Output = V>> StructuralPartialEq for Measurement<V>
Auto Trait Implementations§
impl<V> Freeze for Measurement<V>where
V: Freeze,
impl<V> RefUnwindSafe for Measurement<V>where
V: RefUnwindSafe,
impl<V> Send for Measurement<V>where
V: Send,
impl<V> Sync for Measurement<V>where
V: Sync,
impl<V> Unpin for Measurement<V>where
V: Unpin,
impl<V> UnwindSafe for Measurement<V>where
V: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more