pub struct UpdatableCount {
pub constant: Constant,
pub public: Public,
pub private: Private,
pub constraints: Constraints,
/* private fields */
}Expand description
A helper struct for tracking the number of constants, public inputs, private inputs, and constraints.
Warning: Do not construct this struct directly. Instead, use the count_is! and count_less_than! macros.
Fields§
§constant: Constant§public: Public§private: Private§constraints: ConstraintsImplementations§
Source§impl UpdatableCount
impl UpdatableCount
Sourcepub fn matches(
&self,
num_constants: u64,
num_public: u64,
num_private: u64,
num_constraints: u64,
) -> bool
pub fn matches( &self, num_constants: u64, num_public: u64, num_private: u64, num_constraints: u64, ) -> bool
Returns true if the values matches the Measurements in UpdatableCount.
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.
Sourcepub fn assert_matches(
&self,
num_constants: u64,
num_public: u64,
num_private: u64,
num_constraints: u64,
)
pub fn assert_matches( &self, num_constants: u64, num_public: u64, num_private: u64, num_constraints: u64, )
If all values match, do nothing. If all values metrics do not match:
- If the update condition is satisfied, then update the macro invocation that constructed this
UpdatableCount. - Otherwise, panic.
Trait Implementations§
Source§impl Clone for UpdatableCount
impl Clone for UpdatableCount
Source§fn clone(&self) -> UpdatableCount
fn clone(&self) -> UpdatableCount
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 Debug for UpdatableCount
impl Debug for UpdatableCount
Source§impl Display for UpdatableCount
impl Display for UpdatableCount
impl Copy for UpdatableCount
Auto Trait Implementations§
impl Freeze for UpdatableCount
impl RefUnwindSafe for UpdatableCount
impl Send for UpdatableCount
impl Sync for UpdatableCount
impl Unpin for UpdatableCount
impl UnwindSafe for UpdatableCount
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<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