pub trait AllocVar<V, F: Field>where
    Self: Sized,
    V: ?Sized,
{ fn new_variable<T: Borrow<V>>(
        cs: impl Into<Namespace<F>>,
        f: impl FnOnce() -> Result<T, SynthesisError>,
        mode: AllocationMode
    ) -> Result<Self, SynthesisError>; fn new_constant(
        cs: impl Into<Namespace<F>>,
        t: impl Borrow<V>
    ) -> Result<Self, SynthesisError> { ... } fn new_input<T: Borrow<V>>(
        cs: impl Into<Namespace<F>>,
        f: impl FnOnce() -> Result<T, SynthesisError>
    ) -> Result<Self, SynthesisError> { ... } fn new_witness<T: Borrow<V>>(
        cs: impl Into<Namespace<F>>,
        f: impl FnOnce() -> Result<T, SynthesisError>
    ) -> Result<Self, SynthesisError> { ... } }
Expand description

Specifies how variables of type Self should be allocated in a ConstraintSystem.

Required Methods§

Allocates a new variable of type Self in the ConstraintSystem cs. The mode of allocation is decided by mode.

Provided Methods§

Allocates a new constant of type Self in the ConstraintSystem cs.

This should not allocate any new variables or constraints in cs.

Allocates a new public input of type Self in the ConstraintSystem cs.

Allocates a new private witness of type Self in the ConstraintSystem cs.

Implementations on Foreign Types§

This blanket implementation just allocates variables in Self element by element.

Implementors§