pub enum ConstraintViolation {
Zero {
val: u64,
},
And {
a: u64,
b: u64,
c: u64,
residue: u64,
},
Imul {
a: u64,
b: u64,
lo: u64,
hi: u64,
expected_lo: u64,
expected_hi: u64,
},
Bmul {
a: u128,
b: u128,
c: u128,
expected: u128,
},
}Expand description
The arithmetic by which a single constraint fails on a value vector.
Every variant carries the operand words as the value vector evaluates them. The failing relation reads straight off the message, with no need to recompute it.
Variants§
Zero
An operand required to vanish holds a nonzero word.
And
A conjunction of two operands disagrees with the operand claiming it.
Fields
Imul
An integer product disagrees with the word pair claiming it.
Fields
Bmul
A binary-field product disagrees with the element claiming it.
Implementations§
Source§impl ConstraintViolation
impl ConstraintViolation
Sourcepub const fn kind(&self) -> ConstraintKind
pub const fn kind(&self) -> ConstraintKind
Returns the kind of constraint that failed.
The kind follows from which relation was violated. Storing it as a separate field would let the two disagree.
Trait Implementations§
Source§impl Debug for ConstraintViolation
impl Debug for ConstraintViolation
Source§impl Display for ConstraintViolation
impl Display for ConstraintViolation
Source§impl Error for ConstraintViolation
impl Error for ConstraintViolation
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ConstraintViolation
impl RefUnwindSafe for ConstraintViolation
impl Send for ConstraintViolation
impl Sync for ConstraintViolation
impl Unpin for ConstraintViolation
impl UnsafeUnpin for ConstraintViolation
impl UnwindSafe for ConstraintViolation
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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