Struct snarkvm_wasm::traits::utilities::boolean::AllocatedBit [−][src]
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: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field,
Performs an XOR operation over the two operands, returning
an AllocatedBit.
pub fn and<F, CS>(
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field, [src]
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field,
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]
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field,
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]
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field,
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]
cs: CS,
a: &AllocatedBit,
b: &AllocatedBit
) -> Result<AllocatedBit, SynthesisError> where
CS: ConstraintSystem<F>,
F: Field,
Calculates (NOT a) AND (NOT b).
Trait Implementations
impl<F> AllocGadget<bool, F> for AllocatedBit where
F: Field, [src]
F: Field,
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>,
pub 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]
_cs: CS,
_f: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
pub 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>,
pub 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]
cs: CS,
f: Fn
) -> Result<Self, SynthesisError> where
Fn: FnOnce() -> Result<T, SynthesisError>,
CS: ConstraintSystem<F>,
T: Borrow<V>,
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> CondSelectGadget<F> for AllocatedBit where
F: PrimeField, [src]
F: PrimeField,
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 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
impl Send for AllocatedBit
impl Sync for AllocatedBit
impl Unpin for AllocatedBit
impl UnwindSafe for AllocatedBit
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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
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>,