Struct snarkvm_wasm::traits::utilities::boolean::AllocatedBit [−][src]
pub struct AllocatedBit { /* fields omitted */ }Expand description
Represents a variable in the constraint system which is guaranteed to be either zero or one.
Implementations
impl AllocatedBit[src]
impl AllocatedBit[src]pub fn get_value(&self) -> Option<bool>[src]
pub fn get_variable(&self) -> Variable[src]
pub fn and<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]
pub fn and<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]Performs an AND operation over the two operands, returning
an AllocatedBit.
pub fn or<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]
pub fn or<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]Performs an OR operation over the two operands, returning
an AllocatedBit.
pub fn and_not<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]
pub fn and_not<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]Calculates a AND (NOT b).
pub fn nor<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]
pub fn nor<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]Calculates (NOT a) AND (NOT b).
Trait Implementations
impl<F> AllocGadget<bool, F> for AllocatedBit where
F: Field, [src]
impl<F> AllocGadget<bool, F> for AllocatedBit where
F: Field, [src]pub fn alloc<Fn, T, CS>(
cs: CS,
value_gen: Fn
) -> Result<AllocatedBit, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<bool>, [src]
cs: CS,
value_gen: Fn
) -> Result<AllocatedBit, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<bool>,
pub fn alloc_input<Fn, T, CS>(
cs: CS,
value_gen: Fn
) -> Result<AllocatedBit, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<bool>, [src]
cs: CS,
value_gen: Fn
) -> Result<AllocatedBit, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<bool>,
fn alloc_constant<Fn, T, CS>(_cs: CS, _f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
fn alloc_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
fn alloc_input_checked<Fn, T, CS>(cs: CS, f: Fn) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>, [src]
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
impl Clone for AllocatedBit[src]
impl Clone for AllocatedBit[src]pub fn clone(&self) -> AllocatedBit[src]
pub fn clone(&self) -> AllocatedBit[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]Performs copy-assignment from source. Read more
impl<F> CondSelectGadget<F> for AllocatedBit where
F: PrimeField, [src]
impl<F> CondSelectGadget<F> for AllocatedBit where
F: PrimeField, [src]pub fn conditionally_select<CS>(
cs: CS,
cond: &Boolean,
first: &AllocatedBit,
second: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>, [src]
cs: CS,
cond: &Boolean,
first: &AllocatedBit,
second: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
pub fn cost() -> usize[src]
impl Debug for AllocatedBit[src]
impl Debug for AllocatedBit[src]impl From<AllocatedBit> for Boolean[src]
impl From<AllocatedBit> for Boolean[src]pub fn from(b: AllocatedBit) -> Boolean[src]
pub fn from(b: AllocatedBit) -> Boolean[src]Performs the conversion.
impl PartialEq<AllocatedBit> for AllocatedBit[src]
impl PartialEq<AllocatedBit> for AllocatedBit[src]impl<F> Xor<F, AllocatedBit> for AllocatedBit where
F: Field, [src]
impl<F> Xor<F, AllocatedBit> for AllocatedBit where
F: Field, [src]pub fn xor<CS>(
&self,
cs: CS,
other: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>, [src]
&self,
cs: CS,
other: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
impl Copy for AllocatedBit[src]
impl Eq for AllocatedBit[src]
Auto Trait Implementations
impl RefUnwindSafe for AllocatedBit
impl Send for AllocatedBit
impl Sync for AllocatedBit
impl Unpin for AllocatedBit
impl UnwindSafe for AllocatedBit
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]pub fn equivalent(&self, key: &K) -> bool[src]
pub fn equivalent(&self, key: &K) -> bool[src]Compare self to key and return true if they are equal.
impl<T> Pointable for T
impl<T> Pointable for Timpl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,