struct WitnessFolder<S, A> {
state: S,
accumulate: A,
}Expand description
Fold all witnesses in a circuit.
Fields§
§state: S§accumulate: AImplementations§
Source§impl<S, A> WitnessFolder<S, A>
impl<S, A> WitnessFolder<S, A>
Sourcefn new(init: S, accumulate: A) -> Self
fn new(init: S, accumulate: A) -> Self
Create the folder with some initial state and an accumulator function.
Sourcefn into_state(self) -> S
fn into_state(self) -> S
Take the accumulated state.
Sourcefn fold_circuit<F: AcirField>(&mut self, circuit: &Circuit<F>)
fn fold_circuit<F: AcirField>(&mut self, circuit: &Circuit<F>)
Add all witnesses from the circuit.
Sourcefn fold_many<'w, I: Iterator<Item = &'w Witness>>(&mut self, witnesses: I)
fn fold_many<'w, I: Iterator<Item = &'w Witness>>(&mut self, witnesses: I)
Fold many witnesses into the state.
Sourcefn fold_opcode<F: AcirField>(&mut self, opcode: &Opcode<F>)
fn fold_opcode<F: AcirField>(&mut self, opcode: &Opcode<F>)
Add witnesses from the opcode.
fn fold_expr<F: AcirField>(&mut self, expr: &Expression<F>)
fn fold_brillig_inputs<F: AcirField>(&mut self, inputs: &[BrilligInputs<F>])
fn fold_brillig_outputs(&mut self, outputs: &[BrilligOutputs])
fn fold_blackbox<F: AcirField>(&mut self, call: &BlackBoxFuncCall<F>)
fn fold_inputs<F: AcirField>(&mut self, inputs: &[FunctionInput<F>])
fn fold_input<F: AcirField>(&mut self, input: &FunctionInput<F>)
Auto Trait Implementations§
impl<S, A> Freeze for WitnessFolder<S, A>
impl<S, A> RefUnwindSafe for WitnessFolder<S, A>where
S: RefUnwindSafe,
A: RefUnwindSafe,
impl<S, A> Send for WitnessFolder<S, A>
impl<S, A> Sync for WitnessFolder<S, A>
impl<S, A> Unpin for WitnessFolder<S, A>
impl<S, A> UnwindSafe for WitnessFolder<S, A>where
S: UnwindSafe,
A: UnwindSafe,
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