halo2_axiom::circuit

Trait Chip

Source
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.

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.

Implementors§