Enum snarkvm_circuit_types::prelude::count::Measurement
source · pub enum Measurement<V>where
V: Copy + Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, 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> Measurement<V>where
V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
impl<V> Measurement<V>where V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
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> Add<Measurement<V>> for Measurement<V>where
V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
impl<V> Add<Measurement<V>> for Measurement<V>where V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
source§fn add(
self,
other: Measurement<V>
) -> <Measurement<V> as Add<Measurement<V>>>::Output
fn add( self, other: Measurement<V> ) -> <Measurement<V> as Add<Measurement<V>>>::Output
Adds two variants of Measurement
together, returning the newly-summed Measurement
.
§type Output = Measurement<V>
type Output = Measurement<V>
The resulting type after applying the
+
operator.source§impl<V> Clone for Measurement<V>where
V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + Clone + Mul<V, Output = V> + Copy,
impl<V> Clone for Measurement<V>where V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + Clone + Mul<V, Output = V> + Copy,
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 for Measurement<V>where
V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V> + Copy,
impl<V> Debug for Measurement<V>where V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + Mul<V, Output = V> + Copy,
source§impl<V> Mul<V> for Measurement<V>where
V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
impl<V> Mul<V> for Measurement<V>where V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
source§fn mul(self, other: V) -> <Measurement<V> as Mul<V>>::Output
fn mul(self, other: V) -> <Measurement<V> as Mul<V>>::Output
Scales the Measurement
by a value.
§type Output = Measurement<V>
type Output = Measurement<V>
The resulting type after applying the
*
operator.source§impl<V> PartialEq<Measurement<V>> for Measurement<V>where
V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + PartialEq<V> + Mul<V, Output = V> + Copy,
impl<V> PartialEq<Measurement<V>> for Measurement<V>where V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + PartialEq<V> + Mul<V, Output = V> + Copy,
source§fn eq(&self, other: &Measurement<V>) -> bool
fn eq(&self, other: &Measurement<V>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<V> Copy for Measurement<V>where V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V>,
impl<V> Eq for Measurement<V>where V: Debug + Ord + Add<V, Output = V> + Sub<V, Output = V> + Eq + Mul<V, Output = V> + Copy,
impl<V> StructuralEq for Measurement<V>where V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
impl<V> StructuralPartialEq for Measurement<V>where V: Ord + Add<V, Output = V> + Sub<V, Output = V> + Copy + Mul<V, Output = V> + Debug,
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.