pub struct Assignment<F: PrimeField> { /* private fields */ }
Expand description
A struct that contains public variable assignments, private variable assignments, and constraint assignments.
Implementations§
Source§impl<F: PrimeField> Assignment<F>
impl<F: PrimeField> Assignment<F>
Sourcepub const fn public_inputs(&self) -> &Arc<[(Index, F)]>
pub const fn public_inputs(&self) -> &Arc<[(Index, F)]>
Returns the public inputs of the assignment.
Sourcepub const fn private_inputs(&self) -> &Arc<[(Index, F)]>
pub const fn private_inputs(&self) -> &Arc<[(Index, F)]>
Returns the private inputs of the assignment.
Sourcepub const fn constraints(
&self,
) -> &Arc<[(AssignmentLC<F>, AssignmentLC<F>, AssignmentLC<F>)]>
pub const fn constraints( &self, ) -> &Arc<[(AssignmentLC<F>, AssignmentLC<F>, AssignmentLC<F>)]>
Returns the constraints of the assignment.
Sourcepub fn num_public(&self) -> u64
pub fn num_public(&self) -> u64
Returns the number of public variables in the assignment.
Sourcepub fn num_private(&self) -> u64
pub fn num_private(&self) -> u64
Returns the number of private variables in the assignment.
Sourcepub fn num_variables(&self) -> u64
pub fn num_variables(&self) -> u64
Returns the number of constants, public, and private variables in the assignment.
Sourcepub fn num_constraints(&self) -> u64
pub fn num_constraints(&self) -> u64
Returns the number of constraints in the assignment.
Sourcepub fn num_nonzeros(&self) -> (u64, u64, u64)
pub fn num_nonzeros(&self) -> (u64, u64, u64)
Returns the number of nonzeros in the assignment.
Trait Implementations§
Source§impl<F: Clone + PrimeField> Clone for Assignment<F>
impl<F: Clone + PrimeField> Clone for Assignment<F>
Source§fn clone(&self) -> Assignment<F>
fn clone(&self) -> Assignment<F>
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<F: PrimeField> ConstraintSynthesizer<F> for Assignment<F>
impl<F: PrimeField> ConstraintSynthesizer<F> for Assignment<F>
Source§fn generate_constraints<CS: ConstraintSystem<F>>(
&self,
cs: &mut CS,
) -> Result<(), SynthesisError>
fn generate_constraints<CS: ConstraintSystem<F>>( &self, cs: &mut CS, ) -> Result<(), SynthesisError>
Synthesizes the constraints from the environment into a snarkvm_algorithms::r1cs
-compliant constraint system.
Source§impl<F: Debug + PrimeField> Debug for Assignment<F>
impl<F: Debug + PrimeField> Debug for Assignment<F>
Source§impl<F: PrimeField> From<R1CS<F>> for Assignment<F>
impl<F: PrimeField> From<R1CS<F>> for Assignment<F>
Auto Trait Implementations§
impl<F> Freeze for Assignment<F>
impl<F> RefUnwindSafe for Assignment<F>where
F: RefUnwindSafe,
impl<F> Send for Assignment<F>
impl<F> Sync for Assignment<F>
impl<F> Unpin for Assignment<F>
impl<F> UnwindSafe for Assignment<F>where
F: RefUnwindSafe,
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