Trait ColAccessCap

Source
pub trait ColAccessCap<F: PrimeField, CIx: ColumnIndexer<usize>> {
    type Variable: Clone + Add<Self::Variable, Output = Self::Variable> + Sub<Self::Variable, Output = Self::Variable> + Mul<Self::Variable, Output = Self::Variable> + Neg<Output = Self::Variable> + From<u64> + Debug + 'static;

    // Required methods
    fn assert_zero(&mut self, cst: Self::Variable);
    fn set_assert_mapper(
        &mut self,
        mapper: Box<dyn Fn(Self::Variable) -> Self::Variable>,
    );
    fn read_column(&self, col: CIx) -> Self::Variable;
    fn constant(value: F) -> Self::Variable;
}
Expand description

Environment capability for accessing and reading columns. This is necessary for building constraints.

Required Associated Types§

Source

type Variable: Clone + Add<Self::Variable, Output = Self::Variable> + Sub<Self::Variable, Output = Self::Variable> + Mul<Self::Variable, Output = Self::Variable> + Neg<Output = Self::Variable> + From<u64> + Debug + 'static

Required Methods§

Source

fn assert_zero(&mut self, cst: Self::Variable)

Asserts that the value is zero.

Source

fn set_assert_mapper( &mut self, mapper: Box<dyn Fn(Self::Variable) -> Self::Variable>, )

Sets an assert predicate f(X) such that when assert_zero is called on x, it will actually perform assert_zero(f(x)).

Source

fn read_column(&self, col: CIx) -> Self::Variable

Reads value from a column position.

Source

fn constant(value: F) -> Self::Variable

Turns a constant value into a variable.

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§

Source§

impl<'a, F: PrimeField, CIx1: ColumnIndexer<usize>, CIx2: ColumnIndexer<usize>, Env1: ColAccessCap<F, CIx1>, L: MPrism<Source = CIx1, Target = CIx2>> ColAccessCap<F, CIx2> for SubEnvColumn<'a, F, CIx1, Env1, L>

Source§

type Variable = <Env1 as ColAccessCap<F, CIx1>>::Variable

Source§

impl<'a, F: PrimeField, CIx1: ColumnIndexer<usize>, Env1: ColAccessCap<F, CIx1>, L> ColAccessCap<F, CIx1> for SubEnvLookup<'a, F, CIx1, Env1, L>

Source§

type Variable = <Env1 as ColAccessCap<F, CIx1>>::Variable

Source§

impl<F: PrimeField, CIx: ColumnIndexer<usize>, LT: LookupTableID> ColAccessCap<F, CIx> for ConstraintBuilderEnv<F, LT>

Source§

impl<F: PrimeField, CIx: ColumnIndexer<usize>, const N_WIT: usize, const N_REL: usize, const N_DSEL: usize, const N_FSEL: usize, LT: LookupTableID> ColAccessCap<F, CIx> for WitnessBuilderEnv<F, CIx, N_WIT, N_REL, N_DSEL, N_FSEL, LT>