Enum snarkvm_circuit::Variable
source · pub enum Variable<F>where
F: PrimeField,{
Constant(Rc<F>),
Public(u64, Rc<F>),
Private(u64, Rc<F>),
}
Variants
Constant(Rc<F>)
Public(u64, Rc<F>)
Private(u64, Rc<F>)
Implementations
sourceimpl<F> Variable<F>where
F: PrimeField,
impl<F> Variable<F>where
F: PrimeField,
sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Returns true
if the variable is a constant.
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Returns true
if the variable is private.
Trait Implementations
sourceimpl<F> Add<&LinearCombination<F>> for &Variable<F>where
F: PrimeField,
impl<F> Add<&LinearCombination<F>> for &Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.sourcefn add(
self,
other: &LinearCombination<F>
) -> <&Variable<F> as Add<&LinearCombination<F>>>::Output
fn add(
self,
other: &LinearCombination<F>
) -> <&Variable<F> as Add<&LinearCombination<F>>>::Output
Performs the
+
operation. Read moresourceimpl<F> Add<&LinearCombination<F>> for Variable<F>where
F: PrimeField,
impl<F> Add<&LinearCombination<F>> for Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.sourcefn add(
self,
other: &LinearCombination<F>
) -> <Variable<F> as Add<&LinearCombination<F>>>::Output
fn add(
self,
other: &LinearCombination<F>
) -> <Variable<F> as Add<&LinearCombination<F>>>::Output
Performs the
+
operation. Read moresourceimpl<F> Add<&Variable<F>> for &Variable<F>where
F: PrimeField,
impl<F> Add<&Variable<F>> for &Variable<F>where
F: PrimeField,
sourceimpl<F> Add<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Add<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.sourceimpl<F> Add<&Variable<F>> for Variable<F>where
F: PrimeField,
impl<F> Add<&Variable<F>> for Variable<F>where
F: PrimeField,
sourceimpl<F> Add<LinearCombination<F>> for &Variable<F>where
F: PrimeField,
impl<F> Add<LinearCombination<F>> for &Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.sourcefn add(
self,
other: LinearCombination<F>
) -> <&Variable<F> as Add<LinearCombination<F>>>::Output
fn add(
self,
other: LinearCombination<F>
) -> <&Variable<F> as Add<LinearCombination<F>>>::Output
Performs the
+
operation. Read moresourceimpl<F> Add<LinearCombination<F>> for Variable<F>where
F: PrimeField,
impl<F> Add<LinearCombination<F>> for Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.sourcefn add(
self,
other: LinearCombination<F>
) -> <Variable<F> as Add<LinearCombination<F>>>::Output
fn add(
self,
other: LinearCombination<F>
) -> <Variable<F> as Add<LinearCombination<F>>>::Output
Performs the
+
operation. Read moresourceimpl<F> Add<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
impl<F> Add<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.sourceimpl<F> Add<Variable<F>> for &Variable<F>where
F: PrimeField,
impl<F> Add<Variable<F>> for &Variable<F>where
F: PrimeField,
sourceimpl<F> Add<Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Add<Variable<F>> for LinearCombination<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
+
operator.sourceimpl<F> Add<Variable<F>> for Variable<F>where
F: PrimeField,
impl<F> Add<Variable<F>> for Variable<F>where
F: PrimeField,
sourceimpl<F> Clone for Variable<F>where
F: Clone + PrimeField,
impl<F> Clone for Variable<F>where
F: Clone + PrimeField,
sourceimpl<F> Debug for Variable<F>where
F: PrimeField,
impl<F> Debug for Variable<F>where
F: PrimeField,
sourceimpl<F> Display for Variable<F>where
F: PrimeField,
impl<F> Display for Variable<F>where
F: PrimeField,
sourceimpl<F> From<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> From<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
sourcefn from(variable: &Variable<F>) -> LinearCombination<F>
fn from(variable: &Variable<F>) -> LinearCombination<F>
Converts to this type from the input type.
sourceimpl<F> From<Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> From<Variable<F>> for LinearCombination<F>where
F: PrimeField,
sourcefn from(variable: Variable<F>) -> LinearCombination<F>
fn from(variable: Variable<F>) -> LinearCombination<F>
Converts to this type from the input type.
sourceimpl<F> Hash for Variable<F>where
F: Hash + PrimeField,
impl<F> Hash for Variable<F>where
F: Hash + PrimeField,
sourceimpl<F> Ord for Variable<F>where
F: PrimeField,
impl<F> Ord for Variable<F>where
F: PrimeField,
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<F> PartialEq<Variable<F>> for Variable<F>where
F: PartialEq<F> + PrimeField,
impl<F> PartialEq<Variable<F>> for Variable<F>where
F: PartialEq<F> + PrimeField,
sourceimpl<F> PartialOrd<Variable<F>> for Variable<F>where
F: PrimeField,
impl<F> PartialOrd<Variable<F>> for Variable<F>where
F: PrimeField,
sourcefn partial_cmp(&self, other: &Variable<F>) -> Option<Ordering>
fn partial_cmp(&self, other: &Variable<F>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<F> Sub<&LinearCombination<F>> for &Variable<F>where
F: PrimeField,
impl<F> Sub<&LinearCombination<F>> for &Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.sourcefn sub(
self,
other: &LinearCombination<F>
) -> <&Variable<F> as Sub<&LinearCombination<F>>>::Output
fn sub(
self,
other: &LinearCombination<F>
) -> <&Variable<F> as Sub<&LinearCombination<F>>>::Output
Performs the
-
operation. Read moresourceimpl<F> Sub<&LinearCombination<F>> for Variable<F>where
F: PrimeField,
impl<F> Sub<&LinearCombination<F>> for Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.sourcefn sub(
self,
other: &LinearCombination<F>
) -> <Variable<F> as Sub<&LinearCombination<F>>>::Output
fn sub(
self,
other: &LinearCombination<F>
) -> <Variable<F> as Sub<&LinearCombination<F>>>::Output
Performs the
-
operation. Read moresourceimpl<F> Sub<&Variable<F>> for &Variable<F>where
F: PrimeField,
impl<F> Sub<&Variable<F>> for &Variable<F>where
F: PrimeField,
sourceimpl<F> Sub<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Sub<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.sourceimpl<F> Sub<&Variable<F>> for Variable<F>where
F: PrimeField,
impl<F> Sub<&Variable<F>> for Variable<F>where
F: PrimeField,
sourceimpl<F> Sub<LinearCombination<F>> for &Variable<F>where
F: PrimeField,
impl<F> Sub<LinearCombination<F>> for &Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.sourcefn sub(
self,
other: LinearCombination<F>
) -> <&Variable<F> as Sub<LinearCombination<F>>>::Output
fn sub(
self,
other: LinearCombination<F>
) -> <&Variable<F> as Sub<LinearCombination<F>>>::Output
Performs the
-
operation. Read moresourceimpl<F> Sub<LinearCombination<F>> for Variable<F>where
F: PrimeField,
impl<F> Sub<LinearCombination<F>> for Variable<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.sourcefn sub(
self,
other: LinearCombination<F>
) -> <Variable<F> as Sub<LinearCombination<F>>>::Output
fn sub(
self,
other: LinearCombination<F>
) -> <Variable<F> as Sub<LinearCombination<F>>>::Output
Performs the
-
operation. Read moresourceimpl<F> Sub<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
impl<F> Sub<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.sourceimpl<F> Sub<Variable<F>> for &Variable<F>where
F: PrimeField,
impl<F> Sub<Variable<F>> for &Variable<F>where
F: PrimeField,
sourceimpl<F> Sub<Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Sub<Variable<F>> for LinearCombination<F>where
F: PrimeField,
type Output = LinearCombination<F>
type Output = LinearCombination<F>
The resulting type after applying the
-
operator.sourceimpl<F> Sub<Variable<F>> for Variable<F>where
F: PrimeField,
impl<F> Sub<Variable<F>> for Variable<F>where
F: PrimeField,
impl<F> Eq for Variable<F>where
F: Eq + PrimeField,
impl<F> StructuralEq for Variable<F>where
F: PrimeField,
impl<F> StructuralPartialEq for Variable<F>where
F: PrimeField,
Auto Trait Implementations
impl<F> RefUnwindSafe for Variable<F>where
F: RefUnwindSafe,
impl<F> !Send for Variable<F>
impl<F> !Sync for Variable<F>
impl<F> Unpin for Variable<F>
impl<F> UnwindSafe for Variable<F>where
F: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.