pub trait ComposableChip<F>:
Chip<F>
+ Clone
+ Debugwhere
F: CircuitField,{
type SharedResources;
type InstructionDeps;
// Required methods
fn new(config: &Self::Config, sub_chips: &Self::InstructionDeps) -> Self;
fn configure(
meta: &mut ConstraintSystem<F>,
shared_resources: &Self::SharedResources,
) -> Self::Config;
fn load(&self, layouter: &mut impl Layouter<F>) -> Result<(), Error>;
}Expand description
Provides a common interface for layering chips with shared resources.
Required Associated Types§
Resources that can be used by other chips or gadgets, typically sub-chip configurations and columns.
Sourcetype InstructionDeps
type InstructionDeps
Instruction set dependencies of the chip. This chip will need to be provided with subchips that implement these instructions.
Required Methods§
Sourcefn new(config: &Self::Config, sub_chips: &Self::InstructionDeps) -> Self
fn new(config: &Self::Config, sub_chips: &Self::InstructionDeps) -> Self
Initialize the chip.
Sourcefn configure(
meta: &mut ConstraintSystem<F>,
shared_resources: &Self::SharedResources,
) -> Self::Config
fn configure( meta: &mut ConstraintSystem<F>, shared_resources: &Self::SharedResources, ) -> Self::Config
Configure the chip. Receives the underlying chips and columns it needs via Self::SharedResources. This method must not allocate any resource in the constraint system that is intended to be shared by other chips.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".