Struct snarkvm_circuit_types_boolean::Boolean
source · pub struct Boolean<E: Environment>(_);
Methods from Deref<Target = LinearCombination<E::BaseField>>§
sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Returns true
if there are no terms in the linear combination.
sourcepub fn is_public(&self) -> bool
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.
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Returns true
if the linear combination is not constant or public.
sourcepub fn is_boolean_type(&self) -> bool
pub fn is_boolean_type(&self) -> bool
Returns true
if the linear combination represents a Boolean
type,
and is well-formed.
Properties:
- Either
constant
orterms
is utilized, however never both. - Every individual variable in the linear combination must always be either
0
or1
. - The value of the linear combination must always be either
0
or1
.
Trait Implementations§
source§impl<E: Environment> Adder for Boolean<E>
impl<E: Environment> Adder for Boolean<E>
source§impl<E: Environment> BitAndAssign<&Boolean<E>> for Boolean<E>
impl<E: Environment> BitAndAssign<&Boolean<E>> for Boolean<E>
source§fn bitand_assign(&mut self, other: &Boolean<E>)
fn bitand_assign(&mut self, other: &Boolean<E>)
Sets self
as (self AND other)
.
source§impl<E: Environment> BitAndAssign<Boolean<E>> for Boolean<E>
impl<E: Environment> BitAndAssign<Boolean<E>> for Boolean<E>
source§fn bitand_assign(&mut self, other: Boolean<E>)
fn bitand_assign(&mut self, other: Boolean<E>)
Sets self
as (self AND other)
.
source§impl<E: Environment> BitOrAssign<&Boolean<E>> for Boolean<E>
impl<E: Environment> BitOrAssign<&Boolean<E>> for Boolean<E>
source§fn bitor_assign(&mut self, other: &Boolean<E>)
fn bitor_assign(&mut self, other: &Boolean<E>)
Sets self
as (self OR other)
.
source§impl<E: Environment> BitOrAssign<Boolean<E>> for Boolean<E>
impl<E: Environment> BitOrAssign<Boolean<E>> for Boolean<E>
source§fn bitor_assign(&mut self, other: Boolean<E>)
fn bitor_assign(&mut self, other: Boolean<E>)
Sets self
as (self OR other)
.
source§impl<E: Environment> BitXorAssign<&Boolean<E>> for Boolean<E>
impl<E: Environment> BitXorAssign<&Boolean<E>> for Boolean<E>
source§fn bitxor_assign(&mut self, other: &Boolean<E>)
fn bitxor_assign(&mut self, other: &Boolean<E>)
Sets self
as (self != other)
.
source§impl<E: Environment> BitXorAssign<Boolean<E>> for Boolean<E>
impl<E: Environment> BitXorAssign<Boolean<E>> for Boolean<E>
source§fn bitxor_assign(&mut self, other: Boolean<E>)
fn bitxor_assign(&mut self, other: Boolean<E>)
Sets self
as (self != other)
.
source§impl<E: Environment> Debug for Boolean<E>
impl<E: Environment> Debug for Boolean<E>
source§impl<E: Environment> Deref for Boolean<E>
impl<E: Environment> Deref for Boolean<E>
§type Target = LinearCombination<<E as Environment>::BaseField>
type Target = LinearCombination<<E as Environment>::BaseField>
The resulting type after dereferencing.
source§impl<E: Environment> Display for Boolean<E>
impl<E: Environment> Display for Boolean<E>
source§impl<E: Environment> Eject for Boolean<E>
impl<E: Environment> Eject for Boolean<E>
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the boolean.
source§fn eject_value(&self) -> Self::Primitive
fn eject_value(&self) -> Self::Primitive
Ejects the boolean as a constant boolean value.
type Primitive = bool
source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
Ejects the mode and primitive value of the circuit type.
source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns
true
if the circuit is a constant.source§fn is_private(&self) -> bool
fn is_private(&self) -> bool
Returns
true
if the circuit is a private.source§impl<E: Environment> Equal<Boolean<E>> for Boolean<E>
impl<E: Environment> Equal<Boolean<E>> for Boolean<E>
source§impl<E: Environment> From<&Boolean<E>> for LinearCombination<E::BaseField>
impl<E: Environment> From<&Boolean<E>> for LinearCombination<E::BaseField>
source§impl<E: Environment> From<Boolean<E>> for LinearCombination<E::BaseField>
impl<E: Environment> From<Boolean<E>> for LinearCombination<E::BaseField>
source§impl<E: Environment> FromBits for Boolean<E>
impl<E: Environment> FromBits for Boolean<E>
source§impl<E: Environment> FromStr for Boolean<E>
impl<E: Environment> FromStr for Boolean<E>
source§impl<E: Environment> Inject for Boolean<E>
impl<E: Environment> Inject for Boolean<E>
source§impl<E: Environment> Nand<Boolean<E>> for Boolean<E>
impl<E: Environment> Nand<Boolean<E>> for Boolean<E>
source§impl<E: Environment> Nor<Boolean<E>> for Boolean<E>
impl<E: Environment> Nor<Boolean<E>> for Boolean<E>
source§impl<E: Environment> Not for &Boolean<E>
impl<E: Environment> Not for &Boolean<E>
source§impl<E: Environment> Not for Boolean<E>
impl<E: Environment> Not for Boolean<E>
source§impl<E: Environment> OutputMode<dyn Nor<Boolean<E>, Output = Boolean<E>>> for Boolean<E>
impl<E: Environment> OutputMode<dyn Nor<Boolean<E>, Output = Boolean<E>>> for Boolean<E>
type Case = (CircuitType<Boolean<E>>, CircuitType<Boolean<E>>)
source§fn output_mode(case: &Self::Case) -> Mode
fn output_mode(case: &Self::Case) -> Mode
Returns the mode of the output.
source§impl<E: Environment> OutputMode<dyn Not<Output = Boolean<E>>> for Boolean<E>
impl<E: Environment> OutputMode<dyn Not<Output = Boolean<E>>> for Boolean<E>
source§impl<E: Environment> Parser for Boolean<E>
impl<E: Environment> Parser for Boolean<E>
source§impl<E: Environment> Subtractor for Boolean<E>
impl<E: Environment> Subtractor for Boolean<E>
source§fn subtractor(
&self,
other: &Self,
borrow: &Self
) -> (Self::Difference, Self::Borrow)
fn subtractor( &self, other: &Self, borrow: &Self ) -> (Self::Difference, Self::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: Environment> Ternary for Boolean<E>
impl<E: Environment> Ternary for Boolean<E>
source§impl<E: Environment> ToBits for &Boolean<E>
impl<E: Environment> ToBits for &Boolean<E>
source§impl<E: Environment> ToBits for Boolean<E>
impl<E: Environment> ToBits for Boolean<E>
source§impl<E: Environment> TypeName for Boolean<E>
impl<E: Environment> TypeName for Boolean<E>
impl<E: Environment> BooleanTrait for Boolean<E>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more