Struct snarkvm_wasm::fields::AllocatedFp[][src]

pub struct AllocatedFp<F> where
    F: PrimeField
{ pub value: Option<F>, pub variable: ConstraintVariable<F>, }

Represents a variable in the constraint system whose value can be an arbitrary field element.

Fields

value: Option<F>variable: ConstraintVariable<F>

Implementations

impl<F> AllocatedFp<F> where
    F: PrimeField
[src]

pub fn from<CS>(cs: CS, value: &F) -> AllocatedFp<F> where
    CS: ConstraintSystem<F>, 
[src]

impl<F> AllocatedFp<F> where
    F: PrimeField
[src]

pub fn from_boolean<CS>(
    cs: CS,
    other: Boolean
) -> Result<AllocatedFp<F>, SynthesisError> where
    CS: ConstraintSystem<F>, 
[src]

Constructs Self from a Boolean: if other is false, this outputs zero, else it outputs one.

Trait Implementations

impl<F> AllocGadget<F, F> for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> Clone for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> CondSelectGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> ConditionalEqGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> Debug for AllocatedFp<F> where
    F: Debug + PrimeField
[src]

impl<F> Eq for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> EqGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> From<AllocatedFp<F>> for FpGadget<F> where
    F: PrimeField
[src]

impl<F> NEqGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> PartialEq<AllocatedFp<F>> for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> ThreeBitCondNegLookupGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

type TableConstant = F

impl<F> ToBitsGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

pub fn to_bits<CS>(
    &self,
    cs: CS
) -> Result<Vec<Boolean, Global>, SynthesisError> where
    CS: ConstraintSystem<F>, 
[src]

Outputs the binary representation of the value in self in big-endian form.

impl<F> ToBytesGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

impl<F> TwoBitLookupGadget<F> for AllocatedFp<F> where
    F: PrimeField
[src]

Uses two bits to perform a lookup into a table b is little-endian: b[0] is LSB.

type TableConstant = F

Auto Trait Implementations

impl<F> RefUnwindSafe for AllocatedFp<F> where
    F: RefUnwindSafe

impl<F> Send for AllocatedFp<F>

impl<F> Sync for AllocatedFp<F>

impl<F> Unpin for AllocatedFp<F> where
    F: Unpin

impl<F> UnwindSafe for AllocatedFp<F> where
    F: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<F, T> ConditionalOrEqualsGadget<F> for T where
    T: ConditionalEqGadget<F> + CondSelectGadget<F>,
    F: Field
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F, T> OrEqualsGadget<F> for T where
    T: ConditionalOrEqualsGadget<F>,
    F: Field
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,