Struct bellperson::gadgets::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 alloc_conditionally<E, CS>(
cs: CS,
value: Option<bool>,
must_be_false: &AllocatedBit
) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]
pub fn alloc_conditionally<E, CS>(
cs: CS,
value: Option<bool>,
must_be_false: &AllocatedBit
) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]Allocate a variable in the constraint system which can only be a boolean value. Further, constrain that the boolean is false unless the condition is false.
pub fn alloc<E, CS>(cs: CS, value: Option<bool>) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]
pub fn alloc<E, CS>(cs: CS, value: Option<bool>) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]Allocate a variable in the constraint system which can only be a boolean value.
pub fn xor<E, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]
pub fn xor<E, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]Performs an XOR operation over the two operands, returning
an AllocatedBit
.
pub fn and<E, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]
pub fn and<E, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]Performs an AND operation over the two operands, returning
an AllocatedBit
.
pub fn and_not<E, CS>(
cs: CS,
a: &Self,
b: &Self
) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]
pub fn and_not<E, CS>(
cs: CS,
a: &Self,
b: &Self
) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]Calculates a AND (NOT b)
.
pub fn nor<E, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]
pub fn nor<E, CS>(cs: CS, a: &Self, b: &Self) -> Result<Self, SynthesisError> where
E: ScalarEngine,
CS: ConstraintSystem<E>,
[src]Calculates (NOT a) AND (NOT b)
.
Trait Implementations
impl Clone for AllocatedBit
[src]
impl Clone for AllocatedBit
[src]fn clone(&self) -> AllocatedBit
[src]
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 From<AllocatedBit> for Boolean
[src]
impl From<AllocatedBit> for Boolean
[src]fn from(b: AllocatedBit) -> Boolean
[src]
fn from(b: AllocatedBit) -> Boolean
[src]Performs the conversion.
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<T> Pointable for T
impl<T> Pointable for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should 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 = T
The 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>,