pub trait Assignment<F: Field> {
Show 13 methods
// Required methods
fn enter_region<NR, N>(&mut self, name_fn: N)
where NR: Into<String>,
N: FnOnce() -> NR;
fn annotate_column<A, AR>(&mut self, annotation: A, column: Column<Any>)
where A: FnOnce() -> AR,
AR: Into<String>;
fn exit_region(&mut self);
fn enable_selector<A, AR>(
&mut self,
annotation: A,
selector: &Selector,
row: usize,
) -> Result<(), Error>
where A: FnOnce() -> AR,
AR: Into<String>;
fn query_instance(
&self,
column: Column<Instance>,
row: usize,
) -> Result<Value<F>, Error>;
fn assign_advice<'v>(
&mut self,
column: Column<Advice>,
row: usize,
to: Value<Assigned<F>>,
) -> Value<&'v Assigned<F>>;
fn assign_fixed(
&mut self,
column: Column<Fixed>,
row: usize,
to: Assigned<F>,
);
fn copy(
&mut self,
left_column: Column<Any>,
left_row: usize,
right_column: Column<Any>,
right_row: usize,
);
fn fill_from_row(
&mut self,
column: Column<Fixed>,
row: usize,
to: Value<Assigned<F>>,
) -> Result<(), Error>;
fn get_challenge(&self, challenge: Challenge) -> Value<F>;
fn push_namespace<NR, N>(&mut self, name_fn: N)
where NR: Into<String>,
N: FnOnce() -> NR;
fn pop_namespace(&mut self, gadget_name: Option<String>);
// Provided method
fn next_phase(&mut self) { ... }
}
Expand description
This trait allows a Circuit
to direct some backend to assign a witness
for a constraint system.
Required Methods§
Sourcefn enter_region<NR, N>(&mut self, name_fn: N)
fn enter_region<NR, N>(&mut self, name_fn: N)
Creates a new region and enters into it.
Panics if we are currently in a region (if exit_region
was not called).
Not intended for downstream consumption; use Layouter::assign_region
instead.
Sourcefn annotate_column<A, AR>(&mut self, annotation: A, column: Column<Any>)
fn annotate_column<A, AR>(&mut self, annotation: A, column: Column<Any>)
Allows the developer to include an annotation for an specific column within a Region
.
This is usually useful for debugging circuit failures.
Sourcefn exit_region(&mut self)
fn exit_region(&mut self)
Exits the current region.
Panics if we are not currently in a region (if enter_region
was not called).
Not intended for downstream consumption; use Layouter::assign_region
instead.
Sourcefn enable_selector<A, AR>(
&mut self,
annotation: A,
selector: &Selector,
row: usize,
) -> Result<(), Error>
fn enable_selector<A, AR>( &mut self, annotation: A, selector: &Selector, row: usize, ) -> Result<(), Error>
Enables a selector at the given row.
Sourcefn query_instance(
&self,
column: Column<Instance>,
row: usize,
) -> Result<Value<F>, Error>
fn query_instance( &self, column: Column<Instance>, row: usize, ) -> Result<Value<F>, Error>
Queries the cell of an instance column at a particular absolute row.
Returns the cell’s value, if known.
Sourcefn assign_advice<'v>(
&mut self,
column: Column<Advice>,
row: usize,
to: Value<Assigned<F>>,
) -> Value<&'v Assigned<F>>
fn assign_advice<'v>( &mut self, column: Column<Advice>, row: usize, to: Value<Assigned<F>>, ) -> Value<&'v Assigned<F>>
Assign an advice column value (witness)
Sourcefn assign_fixed(&mut self, column: Column<Fixed>, row: usize, to: Assigned<F>)
fn assign_fixed(&mut self, column: Column<Fixed>, row: usize, to: Assigned<F>)
Assign a fixed value
Sourcefn copy(
&mut self,
left_column: Column<Any>,
left_row: usize,
right_column: Column<Any>,
right_row: usize,
)
fn copy( &mut self, left_column: Column<Any>, left_row: usize, right_column: Column<Any>, right_row: usize, )
Assign two cells to have the same value
Sourcefn fill_from_row(
&mut self,
column: Column<Fixed>,
row: usize,
to: Value<Assigned<F>>,
) -> Result<(), Error>
fn fill_from_row( &mut self, column: Column<Fixed>, row: usize, to: Value<Assigned<F>>, ) -> Result<(), Error>
Fills a fixed column
starting from the given row
with value to
.
Sourcefn get_challenge(&self, challenge: Challenge) -> Value<F>
fn get_challenge(&self, challenge: Challenge) -> Value<F>
Queries the value of the given challenge.
Returns Value::unknown()
if the current synthesis phase is before the challenge can be queried.
Sourcefn push_namespace<NR, N>(&mut self, name_fn: N)
fn push_namespace<NR, N>(&mut self, name_fn: N)
Creates a new (sub)namespace and enters into it.
Not intended for downstream consumption; use Layouter::namespace
instead.
Sourcefn pop_namespace(&mut self, gadget_name: Option<String>)
fn pop_namespace(&mut self, gadget_name: Option<String>)
Exits out of the existing namespace.
Not intended for downstream consumption; use Layouter::namespace
instead.
Provided Methods§
Sourcefn next_phase(&mut self)
fn next_phase(&mut self)
Commit advice columns in current phase and squeeze challenges. This can be called DURING synthesize.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.