pub trait Val {
type PreferredConstraintField: PrimeField;
type Var: AllocVar<Self, Self::PreferredConstraintField> + GR1CSVar<Self::PreferredConstraintField, Value = Self>;
type EmulatedVar<F: SonobeField>: AllocVar<Self, F> + GR1CSVar<F, Value = Self>;
}Expand description
Val associates a type with its in-circuit variables.
Required Associated Types§
Sourcetype PreferredConstraintField: PrimeField
type PreferredConstraintField: PrimeField
Val::PreferredConstraintField is the preferred constraint field for
expressing Self in-circuit.
Sourcetype Var: AllocVar<Self, Self::PreferredConstraintField> + GR1CSVar<Self::PreferredConstraintField, Value = Self>
type Var: AllocVar<Self, Self::PreferredConstraintField> + GR1CSVar<Self::PreferredConstraintField, Value = Self>
Val::Var is the canonical in-circuit variable.
In this case, the circuit is defined over the preferred constraint field
and can represent Self directly (i.e., without emulation).
Sourcetype EmulatedVar<F: SonobeField>: AllocVar<Self, F> + GR1CSVar<F, Value = Self>
type EmulatedVar<F: SonobeField>: AllocVar<Self, F> + GR1CSVar<F, Value = Self>
Val::EmulatedVar is the emulated in-circuit variable.
In this case, the circuit is defined over an arbitrary field F which
may differ from the preferred constraint field, and Self is
represented in-circuit via emulation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".