openvm_native_compiler::ir

Trait Variable

Source
pub trait Variable<C: Config>: Clone {
    type Expression: From<Self>;

    // Required methods
    fn uninit(builder: &mut Builder<C>) -> Self;
    fn assign(&self, src: Self::Expression, builder: &mut Builder<C>);
    fn assert_eq(
        lhs: impl Into<Self::Expression>,
        rhs: impl Into<Self::Expression>,
        builder: &mut Builder<C>,
    );
    fn assert_ne(
        lhs: impl Into<Self::Expression>,
        rhs: impl Into<Self::Expression>,
        builder: &mut Builder<C>,
    );

    // Provided method
    fn eval(builder: &mut Builder<C>, expr: impl Into<Self::Expression>) -> Self { ... }
}

Required Associated Types§

Required Methods§

Source

fn uninit(builder: &mut Builder<C>) -> Self

Source

fn assign(&self, src: Self::Expression, builder: &mut Builder<C>)

Source

fn assert_eq( lhs: impl Into<Self::Expression>, rhs: impl Into<Self::Expression>, builder: &mut Builder<C>, )

Source

fn assert_ne( lhs: impl Into<Self::Expression>, rhs: impl Into<Self::Expression>, builder: &mut Builder<C>, )

Provided Methods§

Source

fn eval(builder: &mut Builder<C>, expr: impl Into<Self::Expression>) -> Self

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.

Implementations on Foreign Types§

Source§

impl<C: Config, T: Variable<C>, const N: usize> Variable<C> for [T; N]

Source§

type Expression = [T; N]

Source§

fn uninit(builder: &mut Builder<C>) -> Self

Source§

fn assign(&self, src: Self::Expression, builder: &mut Builder<C>)

Source§

fn assert_eq( lhs: impl Into<Self::Expression>, rhs: impl Into<Self::Expression>, builder: &mut Builder<C>, )

Source§

fn assert_ne( _lhs: impl Into<Self::Expression>, _rhs: impl Into<Self::Expression>, _builder: &mut Builder<C>, )

Implementors§

Source§

impl<C: Config> Variable<C> for Usize<C::N>

Source§

impl<C: Config> Variable<C> for Ext<C::F, C::EF>

Source§

type Expression = SymbolicExt<<C as Config>::F, <C as Config>::EF>

Source§

impl<C: Config> Variable<C> for Felt<C::F>

Source§

impl<C: Config> Variable<C> for Ptr<C::N>

Source§

impl<C: Config> Variable<C> for Var<C::N>

Source§

impl<C: Config, T: MemVariable<C>> Variable<C> for Array<C, T>

Source§

impl<C: Config, T: MemVariable<C>> Variable<C> for Ref<C, T>

Source§

type Expression = Ref<C, T>