[−][src]Struct snarkvm_models::gadgets::utilities::boolean::AllocatedBit
Represents a variable in the constraint system which is guaranteed to be either zero or one.
Implementations
impl AllocatedBit[src]
pub fn get_value(&self) -> Option<bool>[src]
pub fn get_variable(&self) -> Variable[src]
pub fn xor<F, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
F: Field,
CS: ConstraintSystem<F>, [src]
F: Field,
CS: ConstraintSystem<F>,
Performs an XOR operation over the two operands, returning
an AllocatedBit.
pub fn and<F, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
F: Field,
CS: ConstraintSystem<F>, [src]
F: Field,
CS: ConstraintSystem<F>,
Performs an AND operation over the two operands, returning
an AllocatedBit.
pub fn or<F, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
F: Field,
CS: ConstraintSystem<F>, [src]
F: Field,
CS: ConstraintSystem<F>,
Performs an OR operation over the two operands, returning
an AllocatedBit.
pub fn and_not<F, CS>(
cs: CS,
a: &Self,
b: &Self
) -> Result<Self, SynthesisError> where
F: Field,
CS: ConstraintSystem<F>, [src]
cs: CS,
a: &Self,
b: &Self
) -> Result<Self, SynthesisError> where
F: Field,
CS: ConstraintSystem<F>,
Calculates a AND (NOT b).
pub fn nor<F, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
F: Field,
CS: ConstraintSystem<F>, [src]
F: Field,
CS: ConstraintSystem<F>,
Calculates (NOT a) AND (NOT b).
Trait Implementations
impl<F: Field> AllocGadget<bool, F> for AllocatedBit[src]
pub fn alloc<Fn, T, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<bool>, [src]
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<bool>,
pub fn alloc_input<Fn, T, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<bool>, [src]
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
T: Borrow<bool>,
pub fn alloc_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>[src]
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
pub fn alloc_input_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>[src]
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
impl Clone for AllocatedBit[src]
pub fn clone(&self) -> AllocatedBit[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<F: PrimeField> CondSelectGadget<F> for AllocatedBit[src]
pub fn conditionally_select<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>[src]
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>
pub fn cost() -> usize[src]
impl Copy for AllocatedBit[src]
impl Debug for AllocatedBit[src]
impl Eq for AllocatedBit[src]
impl From<AllocatedBit> for Boolean[src]
pub fn from(b: AllocatedBit) -> Boolean[src]
impl PartialEq<AllocatedBit> for AllocatedBit[src]
Auto Trait Implementations
impl RefUnwindSafe for AllocatedBit[src]
impl Send for AllocatedBit[src]
impl Sync for AllocatedBit[src]
impl Unpin for AllocatedBit[src]
impl UnwindSafe for AllocatedBit[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,