Enum snarkvm_circuit::Variable
source · pub enum Variable<F>where
F: PrimeField,{
Constant(Rc<F>),
Public(u64, Rc<F>),
Private(u64, Rc<F>),
}
Variants§
Implementations§
source§impl<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§
source§impl<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.source§fn 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 moresource§impl<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.source§fn 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 moresource§impl<F> Add<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Add<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
source§impl<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.source§fn 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 moresource§impl<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.source§fn 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 moresource§impl<F> Add<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
impl<F> Add<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
source§impl<F> Add<Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Add<Variable<F>> for LinearCombination<F>where
F: PrimeField,
source§impl<F> Debug for Variable<F>where
F: PrimeField,
impl<F> Debug for Variable<F>where
F: PrimeField,
source§impl<F> Display for Variable<F>where
F: PrimeField,
impl<F> Display for Variable<F>where
F: PrimeField,
source§impl<F> From<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> From<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
source§fn from(variable: &Variable<F>) -> LinearCombination<F>
fn from(variable: &Variable<F>) -> LinearCombination<F>
Converts to this type from the input type.
source§impl<F> From<Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> From<Variable<F>> for LinearCombination<F>where
F: PrimeField,
source§fn from(variable: Variable<F>) -> LinearCombination<F>
fn from(variable: Variable<F>) -> LinearCombination<F>
Converts to this type from the input type.
source§impl<F> Ord for Variable<F>where
F: PrimeField,
impl<F> Ord for Variable<F>where
F: PrimeField,
1.21.0 · source§fn 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
source§impl<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,
source§impl<F> PartialOrd<Variable<F>> for Variable<F>where
F: PrimeField,
impl<F> PartialOrd<Variable<F>> for Variable<F>where
F: PrimeField,
1.0.0 · source§fn 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 moresource§impl<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.source§fn 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 moresource§impl<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.source§fn 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 moresource§impl<F> Sub<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Sub<&Variable<F>> for LinearCombination<F>where
F: PrimeField,
source§impl<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.source§fn 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 moresource§impl<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.source§fn 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 moresource§impl<F> Sub<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
impl<F> Sub<Variable<F>> for &LinearCombination<F>where
F: PrimeField,
source§impl<F> Sub<Variable<F>> for LinearCombination<F>where
F: PrimeField,
impl<F> Sub<Variable<F>> for LinearCombination<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§
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more