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§

source

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.

source

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§

source

fn config(&self) -> &Self::Config

The chip holds its own configuration.

source

fn loaded(&self) -> &Self::Loaded

Provides access to general chip state loaded at the beginning of circuit synthesis.

Panics if called before Chip::load.

Implementors§