pub trait Chip<F: Field>: Sized {
type Config: Debug + Clone;
type Loaded: Debug + Clone;
// Required methods
fn config(&self) -> &Self::Config;
fn loaded(&self) -> &Self::Loaded;
}
Expand description
A chip implements a set of instructions that can be used by gadgets.
The chip stores state that is required at circuit synthesis time in
Chip::Config
, which can be fetched via Chip::config
.
The chip also loads any fixed configuration needed at synthesis time
using its own implementation of load
, and stores it in Chip::Loaded
.
This can be accessed via Chip::loaded
.
Required Associated Types§
Sourcetype Config: Debug + Clone
type Config: Debug + Clone
A type that holds the configuration for this chip, and any other state it may need
during circuit synthesis, that can be derived during Circuit::configure
.
Sourcetype Loaded: Debug + Clone
type Loaded: Debug + Clone
A type that holds any general chip state that needs to be loaded at the start of
Circuit::synthesize
. This might simply be ()
for some chips.
Required Methods§
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.