pub struct Boolean<E>(_)
where
    E: Environment;

Methods from Deref<Target = LinearCombination<<E as Environment>::BaseField>>§

source

pub fn is_constant(&self) -> bool

Returns true if there are no terms in the linear combination.

source

pub fn is_public(&self) -> bool

Returns true if there is exactly one term with a coefficient of one, and the term contains a public variable.

source

pub fn is_private(&self) -> bool

Returns true if the linear combination is not constant or public.

source

pub fn mode(&self) -> Mode

Returns the mode of this linear combination.

source

pub fn value(&self) -> F

Returns the computed value of the linear combination.

source

pub fn is_boolean_type(&self) -> bool

Returns true if the linear combination represents a Boolean type, and is well-formed.

Properties:

  1. Either constant or terms is utilized, however never both.
  2. Every individual variable in the linear combination must always be either 0 or 1.
  3. The value of the linear combination must always be either 0 or 1.

Trait Implementations§

source§

impl<E> Adder for Boolean<E>where E: Environment,

source§

fn adder( &self, other: &Boolean<E>, carry: &Boolean<E> ) -> (<Boolean<E> as Adder>::Sum, <Boolean<E> as Adder>::Carry)

Returns the sum of self and other as a sum bit and carry bit.

§

type Carry = Boolean<E>

§

type Sum = Boolean<E>

source§

impl<E> BitAnd<&Boolean<E>> for &Boolean<E>where E: Environment,

source§

fn bitand( self, other: &Boolean<E> ) -> <&Boolean<E> as BitAnd<&Boolean<E>>>::Output

Returns (self AND other).

§

type Output = Boolean<E>

The resulting type after applying the & operator.
source§

impl<E> BitAnd<&Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitand( self, other: &Boolean<E> ) -> <Boolean<E> as BitAnd<&Boolean<E>>>::Output

Returns (self AND other).

§

type Output = Boolean<E>

The resulting type after applying the & operator.
source§

impl<E> BitAnd<Boolean<E>> for &Boolean<E>where E: Environment,

source§

fn bitand( self, other: Boolean<E> ) -> <&Boolean<E> as BitAnd<Boolean<E>>>::Output

Returns (self AND other).

§

type Output = Boolean<E>

The resulting type after applying the & operator.
source§

impl<E> BitAnd<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitand(self, other: Boolean<E>) -> <Boolean<E> as BitAnd<Boolean<E>>>::Output

Returns (self AND other).

§

type Output = Boolean<E>

The resulting type after applying the & operator.
source§

impl<E> BitAndAssign<&Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitand_assign(&mut self, other: &Boolean<E>)

Sets self as (self AND other).

source§

impl<E> BitAndAssign<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitand_assign(&mut self, other: Boolean<E>)

Sets self as (self AND other).

source§

impl<E> BitOr<&Boolean<E>> for &Boolean<E>where E: Environment,

source§

fn bitor( self, other: &Boolean<E> ) -> <&Boolean<E> as BitOr<&Boolean<E>>>::Output

Returns (self OR other).

§

type Output = Boolean<E>

The resulting type after applying the | operator.
source§

impl<E> BitOr<&Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitor(self, other: &Boolean<E>) -> <Boolean<E> as BitOr<&Boolean<E>>>::Output

Returns (self OR other).

§

type Output = Boolean<E>

The resulting type after applying the | operator.
source§

impl<E> BitOr<Boolean<E>> for &Boolean<E>where E: Environment,

source§

fn bitor(self, other: Boolean<E>) -> <&Boolean<E> as BitOr<Boolean<E>>>::Output

Returns (self OR other).

§

type Output = Boolean<E>

The resulting type after applying the | operator.
source§

impl<E> BitOr<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitor(self, other: Boolean<E>) -> <Boolean<E> as BitOr<Boolean<E>>>::Output

Returns (self OR other).

§

type Output = Boolean<E>

The resulting type after applying the | operator.
source§

impl<E> BitOrAssign<&Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitor_assign(&mut self, other: &Boolean<E>)

Sets self as (self OR other).

source§

impl<E> BitOrAssign<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitor_assign(&mut self, other: Boolean<E>)

Sets self as (self OR other).

source§

impl<E> BitXor<&Boolean<E>> for &Boolean<E>where E: Environment,

source§

fn bitxor( self, other: &Boolean<E> ) -> <&Boolean<E> as BitXor<&Boolean<E>>>::Output

Returns (self != other).

§

type Output = Boolean<E>

The resulting type after applying the ^ operator.
source§

impl<E> BitXor<&Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitxor( self, other: &Boolean<E> ) -> <Boolean<E> as BitXor<&Boolean<E>>>::Output

Returns (self != other).

§

type Output = Boolean<E>

The resulting type after applying the ^ operator.
source§

impl<E> BitXor<Boolean<E>> for &Boolean<E>where E: Environment,

source§

fn bitxor( self, other: Boolean<E> ) -> <&Boolean<E> as BitXor<Boolean<E>>>::Output

Returns (self != other).

§

type Output = Boolean<E>

The resulting type after applying the ^ operator.
source§

impl<E> BitXor<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitxor(self, other: Boolean<E>) -> <Boolean<E> as BitXor<Boolean<E>>>::Output

Returns (self != other).

§

type Output = Boolean<E>

The resulting type after applying the ^ operator.
source§

impl<E> BitXorAssign<&Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitxor_assign(&mut self, other: &Boolean<E>)

Sets self as (self != other).

source§

impl<E> BitXorAssign<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn bitxor_assign(&mut self, other: Boolean<E>)

Sets self as (self != other).

source§

impl<E> Clone for Boolean<E>where E: Clone + Environment, <E as Environment>::BaseField: Clone,

source§

fn clone(&self) -> Boolean<E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E> Debug for Boolean<E>where E: Environment,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<E> Deref for Boolean<E>where E: Environment,

§

type Target = LinearCombination<<E as Environment>::BaseField>

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Boolean<E> as Deref>::Target

Dereferences the value.
source§

impl<E> Display for Boolean<E>where E: Environment,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<E> Eject for Boolean<E>where E: Environment,

source§

fn eject_mode(&self) -> Mode

Ejects the mode of the boolean.

source§

fn eject_value(&self) -> <Boolean<E> as Eject>::Primitive

Ejects the boolean as a constant boolean value.

§

type Primitive = bool

source§

fn eject(&self) -> (Mode, Self::Primitive)

Ejects the mode and primitive value of the circuit type.
source§

fn is_constant(&self) -> bool

Returns true if the circuit is a constant.
source§

fn is_public(&self) -> bool

Returns true if the circuit is a public.
source§

fn is_private(&self) -> bool

Returns true if the circuit is a private.
source§

impl<E> Equal<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn is_equal( &self, other: &Boolean<E> ) -> <Boolean<E> as Equal<Boolean<E>>>::Output

Returns true if self and other are equal.

source§

fn is_not_equal( &self, other: &Boolean<E> ) -> <Boolean<E> as Equal<Boolean<E>>>::Output

Returns true if self and other are not equal.

§

type Output = Boolean<E>

source§

impl<E> From<&Boolean<E>> for LinearCombination<<E as Environment>::BaseField>where E: Environment,

source§

fn from( boolean: &Boolean<E> ) -> LinearCombination<<E as Environment>::BaseField>

Converts to this type from the input type.
source§

impl<E> From<Boolean<E>> for LinearCombination<<E as Environment>::BaseField>where E: Environment,

source§

fn from(boolean: Boolean<E>) -> LinearCombination<<E as Environment>::BaseField>

Converts to this type from the input type.
source§

impl<E> FromBits for Boolean<E>where E: Environment,

source§

fn from_bits_le(bits_le: &[<Boolean<E> as FromBits>::Boolean]) -> Boolean<E>

Returns a boolean circuit given a mode and single boolean.

source§

fn from_bits_be(bits_be: &[<Boolean<E> as FromBits>::Boolean]) -> Boolean<E>

Returns a boolean circuit given a mode and single boolean.

§

type Boolean = Boolean<E>

source§

impl<E> FromStr for Boolean<E>where E: Environment,

source§

fn from_str(string: &str) -> Result<Boolean<E>, Error>

Parses a string into a boolean.

§

type Err = Error

The associated error which can be returned from parsing.
source§

impl<E> Inject for Boolean<E>where E: Environment,

source§

fn new(mode: Mode, value: <Boolean<E> as Inject>::Primitive) -> Boolean<E>

Initializes a new instance of a boolean from a primitive boolean value.

source§

fn constant(value: <Boolean<E> as Inject>::Primitive) -> Boolean<E>

Initializes a constant boolean circuit from a primitive boolean value.

§

type Primitive = bool

source§

impl<E> Metrics<dyn Nor<Boolean<E>, Output = Boolean<E>>> for Boolean<E>where E: Environment,

§

type Case = (Mode, Mode)

source§

fn count( case: &<Boolean<E> as Metrics<dyn Nor<Boolean<E>, Output = Boolean<E>>>>::Case ) -> Count

Returns the number of constants, public inputs, private inputs, and constraints.
source§

impl<E> Metrics<dyn Not<Output = Boolean<E>>> for Boolean<E>where E: Environment,

§

type Case = Mode

source§

fn count( _case: &<Boolean<E> as Metrics<dyn Not<Output = Boolean<E>>>>::Case ) -> Count

Returns the number of constants, public inputs, private inputs, and constraints.
source§

impl<E> Nand<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn nand(&self, other: &Boolean<E>) -> <Boolean<E> as Nand<Boolean<E>>>::Output

Returns NOT (a AND b).

§

type Output = Boolean<E>

source§

impl<E> Nor<Boolean<E>> for Boolean<E>where E: Environment,

source§

fn nor(&self, other: &Boolean<E>) -> <Boolean<E> as Nor<Boolean<E>>>::Output

Returns (NOT a) AND (NOT b).

§

type Output = Boolean<E>

source§

impl<E> Not for &Boolean<E>where E: Environment,

source§

fn not(self) -> <&Boolean<E> as Not>::Output

Returns (NOT a).

§

type Output = Boolean<E>

The resulting type after applying the ! operator.
source§

impl<E> Not for Boolean<E>where E: Environment,

source§

fn not(self) -> <Boolean<E> as Not>::Output

Returns (NOT a).

§

type Output = Boolean<E>

The resulting type after applying the ! operator.
source§

impl<E> OutputMode<dyn Nor<Boolean<E>, Output = Boolean<E>>> for Boolean<E>where E: Environment,

§

type Case = (CircuitType<Boolean<E>>, CircuitType<Boolean<E>>)

source§

fn output_mode( case: &<Boolean<E> as OutputMode<dyn Nor<Boolean<E>, Output = Boolean<E>>>>::Case ) -> Mode

Returns the mode of the output.
source§

impl<E> OutputMode<dyn Not<Output = Boolean<E>>> for Boolean<E>where E: Environment,

§

type Case = Mode

source§

fn output_mode( case: &<Boolean<E> as OutputMode<dyn Not<Output = Boolean<E>>>>::Case ) -> Mode

Returns the mode of the output.
source§

impl<E> Parser for Boolean<E>where E: Environment,

source§

fn parse(string: &str) -> Result<(&str, Boolean<E>), Err<VerboseError<&str>>>

Parses a string into a boolean circuit.

source§

impl<E> Subtractor for Boolean<E>where E: Environment,

source§

fn subtractor( &self, other: &Boolean<E>, borrow: &Boolean<E> ) -> (<Boolean<E> as Subtractor>::Difference, <Boolean<E> as Subtractor>::Borrow)

Returns the difference of self and other as a difference bit and borrow bit.

§

type Borrow = Boolean<E>

§

type Difference = Boolean<E>

source§

impl<E> Ternary for Boolean<E>where E: Environment,

source§

fn ternary( condition: &<Boolean<E> as Ternary>::Boolean, first: &Boolean<E>, second: &Boolean<E> ) -> <Boolean<E> as Ternary>::Output

Returns first if condition is true, otherwise returns second.

§

type Boolean = Boolean<E>

§

type Output = Boolean<E>

source§

impl<E> ToBits for &Boolean<E>where E: Environment,

source§

fn to_bits_le(&self) -> Vec<<&Boolean<E> as ToBits>::Boolean, Global>

Outputs self as a single-element vector.

source§

fn to_bits_be(&self) -> Vec<<&Boolean<E> as ToBits>::Boolean, Global>

Outputs self as a single-element vector.

§

type Boolean = Boolean<E>

source§

impl<E> ToBits for Boolean<E>where E: Environment,

source§

fn to_bits_le(&self) -> Vec<<Boolean<E> as ToBits>::Boolean, Global>

Outputs self as a single-element vector.

source§

fn to_bits_be(&self) -> Vec<<Boolean<E> as ToBits>::Boolean, Global>

Outputs self as a single-element vector.

§

type Boolean = Boolean<E>

source§

impl<E> TypeName for Boolean<E>where E: Environment,

source§

fn type_name() -> &'static str

Returns the type name of the circuit as a string.

source§

impl<E> BooleanTrait for Boolean<E>where E: Environment,

Auto Trait Implementations§

§

impl<E> RefUnwindSafe for Boolean<E>where <E as Environment>::BaseField: RefUnwindSafe,

§

impl<E> !Send for Boolean<E>

§

impl<E> !Sync for Boolean<E>

§

impl<E> Unpin for Boolean<E>where <E as Environment>::BaseField: Unpin,

§

impl<E> UnwindSafe for Boolean<E>where <E as Environment>::BaseField: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V