pub struct Circuit {
pub current_witness_index: u32,
pub opcodes: Vec<Opcode>,
pub expression_width: ExpressionWidth,
pub private_parameters: BTreeSet<Witness>,
pub public_parameters: PublicInputs,
pub return_values: PublicInputs,
pub assert_messages: Vec<(OpcodeLocation, AssertionPayload)>,
pub recursive: bool,
}
Fields§
§current_witness_index: u32
§opcodes: Vec<Opcode>
§expression_width: ExpressionWidth
§private_parameters: BTreeSet<Witness>
The set of private inputs to the circuit.
public_parameters: PublicInputs
The set of public inputs provided by the prover.
return_values: PublicInputs
The set of public inputs calculated within the circuit.
assert_messages: Vec<(OpcodeLocation, AssertionPayload)>
Maps opcode locations to failed assertion payloads. The data in the payload is embedded in the circuit to provide useful feedback to users when a constraint in the circuit is not satisfied.
recursive: bool
States whether the backend should use a SNARK recursion friendly prover. If implemented by a backend, this means that proofs generated with this circuit will be friendly for recursively verifying inside of another SNARK.
Implementations§
Source§impl Circuit
impl Circuit
pub fn num_vars(&self) -> u32
Sourcepub fn circuit_arguments(&self) -> BTreeSet<Witness>
pub fn circuit_arguments(&self) -> BTreeSet<Witness>
Returns all witnesses which are required to execute the circuit successfully.
Sourcepub fn public_inputs(&self) -> PublicInputs
pub fn public_inputs(&self) -> PublicInputs
Returns all public inputs. This includes those provided as parameters to the circuit and those computed as return values.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Circuit
impl<'de> Deserialize<'de> for Circuit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Circuit
impl StructuralPartialEq for Circuit
Auto Trait Implementations§
impl Freeze for Circuit
impl RefUnwindSafe for Circuit
impl Send for Circuit
impl Sync for Circuit
impl Unpin for Circuit
impl UnwindSafe for Circuit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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