pub enum Boolean<F: Field> {
Var(AllocatedBool<F>),
Constant(bool),
}
Expand description
Represents a boolean value in the constraint system which is guaranteed to be either zero or one.
Variants§
Var(AllocatedBool<F>)
Constant(bool)
Implementations§
Source§impl<F: Field> Boolean<F>
impl<F: Field> Boolean<F>
Sourcepub fn nand(&self, other: &Self) -> Result<Self, SynthesisError>
pub fn nand(&self, other: &Self) -> Result<Self, SynthesisError>
Outputs !(self & other)
.
Source§impl<F: PrimeField> Boolean<F>
impl<F: PrimeField> Boolean<F>
Sourcepub fn kary_and(bits: &[Self]) -> Result<Self, SynthesisError>
pub fn kary_and(bits: &[Self]) -> Result<Self, SynthesisError>
Outputs bits[0] & bits[1] & ... & bits.last().unwrap()
.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
let c = Boolean::new_witness(cs.clone(), || Ok(true))?;
Boolean::kary_and(&[a.clone(), b.clone(), c.clone()])?.enforce_equal(&Boolean::FALSE)?;
Boolean::kary_and(&[a.clone(), c.clone()])?.enforce_equal(&Boolean::TRUE)?;
assert!(cs.is_satisfied().unwrap());
Sourcepub fn kary_nand(bits: &[Self]) -> Result<Self, SynthesisError>
pub fn kary_nand(bits: &[Self]) -> Result<Self, SynthesisError>
Outputs !(bits[0] & bits[1] & ... & bits.last().unwrap())
.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
let c = Boolean::new_witness(cs.clone(), || Ok(true))?;
Boolean::kary_nand(&[a.clone(), b.clone(), c.clone()])?.enforce_equal(&Boolean::TRUE)?;
Boolean::kary_nand(&[a.clone(), c.clone()])?.enforce_equal(&Boolean::FALSE)?;
Boolean::kary_nand(&[b.clone(), c.clone()])?.enforce_equal(&Boolean::TRUE)?;
assert!(cs.is_satisfied().unwrap());
Sourcepub fn enforce_kary_nand(bits: &[Self]) -> Result<(), SynthesisError>
pub fn enforce_kary_nand(bits: &[Self]) -> Result<(), SynthesisError>
Enforces that !(bits[0] & bits[1] & ... ) == Boolean::TRUE
.
Informally, this means that at least one element in bits
must be
false
.
Source§impl<F: PrimeField> Boolean<F>
impl<F: PrimeField> Boolean<F>
Sourcepub fn enforce_in_field_le(bits: &[Self]) -> Result<(), SynthesisError>
pub fn enforce_in_field_le(bits: &[Self]) -> Result<(), SynthesisError>
Enforces that bits
, when interpreted as a integer, is less than
F::characteristic()
, That is, interpret bits as a little-endian
integer, and enforce that this integer is “in the field Z_p”, where
p = F::characteristic()
.
Sourcepub fn enforce_smaller_or_equal_than_le(
bits: &[Self],
element: impl AsRef<[u64]>,
) -> Result<Vec<Self>, SynthesisError>
pub fn enforce_smaller_or_equal_than_le( bits: &[Self], element: impl AsRef<[u64]>, ) -> Result<Vec<Self>, SynthesisError>
Enforces that bits
is less than or equal to element
,
when both are interpreted as (little-endian) integers.
Source§impl<F: Field> Boolean<F>
impl<F: Field> Boolean<F>
pub fn not_in_place(&mut self) -> Result<(), SynthesisError>
Source§impl<F: PrimeField> Boolean<F>
impl<F: PrimeField> Boolean<F>
Sourcepub fn kary_or(bits: &[Self]) -> Result<Self, SynthesisError>
pub fn kary_or(bits: &[Self]) -> Result<Self, SynthesisError>
Outputs bits[0] | bits[1] | ... | bits.last().unwrap()
.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
let c = Boolean::new_witness(cs.clone(), || Ok(false))?;
Boolean::kary_or(&[a.clone(), b.clone(), c.clone()])?.enforce_equal(&Boolean::TRUE)?;
Boolean::kary_or(&[a.clone(), c.clone()])?.enforce_equal(&Boolean::TRUE)?;
Boolean::kary_or(&[b.clone(), c.clone()])?.enforce_equal(&Boolean::FALSE)?;
assert!(cs.is_satisfied().unwrap());
Source§impl<F: PrimeField> Boolean<F>
impl<F: PrimeField> Boolean<F>
Sourcepub fn select<T: CondSelectGadget<F>>(
&self,
first: &T,
second: &T,
) -> Result<T, SynthesisError>
pub fn select<T: CondSelectGadget<F>>( &self, first: &T, second: &T, ) -> Result<T, SynthesisError>
Conditionally selects one of first
and second
based on the value of
self
:
If self.is_eq(&Boolean::TRUE)
, this outputs first
; else, it outputs
second
.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
let cond = Boolean::new_witness(cs.clone(), || Ok(true))?;
cond.select(&a, &b)?.enforce_equal(&Boolean::TRUE)?;
cond.select(&b, &a)?.enforce_equal(&Boolean::FALSE)?;
assert!(cs.is_satisfied().unwrap());
Source§impl<F: Field> Boolean<F>
impl<F: Field> Boolean<F>
Sourcepub fn constant_vec_from_bytes(values: &[u8]) -> Vec<Self>
pub fn constant_vec_from_bytes(values: &[u8]) -> Vec<Self>
Constructs a Boolean
vector from a slice of constant u8
.
The u8
s are decomposed in little-endian manner.
This does not create any new variables or constraints.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let t = Boolean::<Fr>::TRUE;
let f = Boolean::<Fr>::FALSE;
let bits = vec![f, t];
let generated_bits = Boolean::constant_vec_from_bytes(&[2]);
bits[..2].enforce_equal(&generated_bits[..2])?;
assert!(cs.is_satisfied().unwrap());
Sourcepub fn constant(b: bool) -> Self
pub fn constant(b: bool) -> Self
Constructs a constant Boolean
with value b
.
This does not create any new variables or constraints.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_r1cs_std::prelude::*;
let true_var = Boolean::<Fr>::TRUE;
let false_var = Boolean::<Fr>::FALSE;
true_var.enforce_equal(&Boolean::TRUE)?;
false_var.enforce_equal(&Boolean::constant(false))?;
Sourcepub fn lc(&self) -> LinearCombination<F>
pub fn lc(&self) -> LinearCombination<F>
Constructs a LinearCombination
from Self
’s variables according
to the following map.
Boolean::TRUE => lc!() + Variable::One
Boolean::FALSE => lc!()
Boolean::Var(v) => lc!() + v.variable()
Sourcepub fn le_bits_to_fp(bits: &[Self]) -> Result<FpVar<F>, SynthesisError>where
F: PrimeField,
pub fn le_bits_to_fp(bits: &[Self]) -> Result<FpVar<F>, SynthesisError>where
F: PrimeField,
Convert a little-endian bitwise representation of a field element to
FpVar<F>
Wraps around if the bit representation is larger than the field modulus.
Trait Implementations§
Source§impl<F: Field> AllocVar<bool, F> for Boolean<F>
impl<F: Field> AllocVar<bool, F> for Boolean<F>
Source§fn new_variable<T: Borrow<bool>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode,
) -> Result<Self, SynthesisError>
fn new_variable<T: Borrow<bool>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, mode: AllocationMode, ) -> Result<Self, SynthesisError>
Self
in the ConstraintSystem
cs
.
The mode of allocation is decided by mode
.Source§fn new_constant(
cs: impl Into<Namespace<F>>,
t: impl Borrow<V>,
) -> Result<Self, SynthesisError>
fn new_constant( cs: impl Into<Namespace<F>>, t: impl Borrow<V>, ) -> Result<Self, SynthesisError>
Source§fn new_input<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>
fn new_input<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
Self
in the ConstraintSystem
cs
.Source§fn new_witness<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>
fn new_witness<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
Self
in the ConstraintSystem
cs
.Source§fn new_variable_with_inferred_mode<T: Borrow<V>>(
cs: impl Into<Namespace<F>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
) -> Result<Self, SynthesisError>
fn new_variable_with_inferred_mode<T: Borrow<V>>( cs: impl Into<Namespace<F>>, f: impl FnOnce() -> Result<T, SynthesisError>, ) -> Result<Self, SynthesisError>
Self
in the
ConstraintSystem
cs
with the allocation mode inferred from cs
.
A constant is allocated if cs
is None
, and a private witness is
allocated otherwise. Read moreSource§impl<'a, F: Field> BitAnd for &'a Boolean<F>
impl<'a, F: Field> BitAnd for &'a Boolean<F>
Source§fn bitand(self, other: Self) -> Self::Output
fn bitand(self, other: Self) -> Self::Output
Outputs self & other
.
If at least one of self
and other
are constants, then this method
does not create any constraints or variables.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
(&a & &a).enforce_equal(&Boolean::TRUE)?;
(&a & &b).enforce_equal(&Boolean::FALSE)?;
(&b & &a).enforce_equal(&Boolean::FALSE)?;
(&b & &b).enforce_equal(&Boolean::FALSE)?;
assert!(cs.is_satisfied().unwrap());
Source§impl<'a, F: Field> BitAndAssign<&'a Boolean<F>> for Boolean<F>
impl<'a, F: Field> BitAndAssign<&'a Boolean<F>> for Boolean<F>
Source§fn bitand_assign(&mut self, other: &'a Self)
fn bitand_assign(&mut self, other: &'a Self)
Sets self = self & other
.
Source§impl<F: Field> BitAndAssign for Boolean<F>
impl<F: Field> BitAndAssign for Boolean<F>
Source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Sets self = self & other
.
Source§impl<'a, F: PrimeField> BitOr for &'a Boolean<F>
impl<'a, F: PrimeField> BitOr for &'a Boolean<F>
Source§fn bitor(self, other: Self) -> Self::Output
fn bitor(self, other: Self) -> Self::Output
Outputs self | other
.
If at least one of self
and other
are constants, then this method
does not create any constraints or variables.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
(&a | &b).enforce_equal(&Boolean::TRUE)?;
(&b | &a).enforce_equal(&Boolean::TRUE)?;
(&a | &a).enforce_equal(&Boolean::TRUE)?;
(&b | &b).enforce_equal(&Boolean::FALSE)?;
assert!(cs.is_satisfied().unwrap());
Source§impl<F: PrimeField> BitOr for Boolean<F>
impl<F: PrimeField> BitOr for Boolean<F>
Source§impl<'a, F: PrimeField> BitOrAssign<&'a Boolean<F>> for Boolean<F>
impl<'a, F: PrimeField> BitOrAssign<&'a Boolean<F>> for Boolean<F>
Source§fn bitor_assign(&mut self, other: &'a Self)
fn bitor_assign(&mut self, other: &'a Self)
Sets self = self | other
.
Source§impl<F: PrimeField> BitOrAssign for Boolean<F>
impl<F: PrimeField> BitOrAssign for Boolean<F>
Source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Sets self = self | other
.
Source§impl<'a, F: Field> BitXor for &'a Boolean<F>
impl<'a, F: Field> BitXor for &'a Boolean<F>
Source§fn bitxor(self, other: Self) -> Self::Output
fn bitxor(self, other: Self) -> Self::Output
Outputs self ^ other
.
If at least one of self
and other
are constants, then this method
does not create any constraints or variables.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
(&a ^ &b).enforce_equal(&Boolean::TRUE)?;
(&b ^ &a).enforce_equal(&Boolean::TRUE)?;
(&a ^ &a).enforce_equal(&Boolean::FALSE)?;
(&b ^ &b).enforce_equal(&Boolean::FALSE)?;
assert!(cs.is_satisfied().unwrap());
Source§impl<'a, F: Field> BitXorAssign<&'a Boolean<F>> for Boolean<F>
impl<'a, F: Field> BitXorAssign<&'a Boolean<F>> for Boolean<F>
Source§fn bitxor_assign(&mut self, other: &'a Self)
fn bitxor_assign(&mut self, other: &'a Self)
Sets self = self ^ other
.
Source§impl<F: Field> BitXorAssign for Boolean<F>
impl<F: Field> BitXorAssign for Boolean<F>
Source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Sets self = self ^ other
.
Source§impl<F: PrimeField> CmpGadget<F> for Boolean<F>
impl<F: PrimeField> CmpGadget<F> for Boolean<F>
Source§impl<F: PrimeField> CondSelectGadget<F> for Boolean<F>
impl<F: PrimeField> CondSelectGadget<F> for Boolean<F>
Source§fn conditionally_select(
cond: &Boolean<F>,
true_val: &Self,
false_val: &Self,
) -> Result<Self, SynthesisError>
fn conditionally_select( cond: &Boolean<F>, true_val: &Self, false_val: &Self, ) -> Result<Self, SynthesisError>
Source§fn conditionally_select_power_of_two_vector(
position: &[Boolean<ConstraintF>],
values: &[Self],
) -> Result<Self, SynthesisError>
fn conditionally_select_power_of_two_vector( position: &[Boolean<ConstraintF>], values: &[Self], ) -> Result<Self, SynthesisError>
values
whose index in represented by position
.
position
is an array of boolean that represents an unsigned integer in
big endian order. Read moreSource§impl<F: Field> EqGadget<F> for Boolean<F>
impl<F: Field> EqGadget<F> for Boolean<F>
Source§fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
fn is_eq(&self, other: &Self) -> Result<Boolean<F>, SynthesisError>
Boolean
value representing whether self.value() == other.value()
.Source§fn conditional_enforce_equal(
&self,
other: &Self,
condition: &Boolean<F>,
) -> Result<(), SynthesisError>
fn conditional_enforce_equal( &self, other: &Self, condition: &Boolean<F>, ) -> Result<(), SynthesisError>
should_enforce == true
, enforce that self
and other
are equal;
else, enforce a vacuously true statement. Read moreSource§fn conditional_enforce_not_equal(
&self,
other: &Self,
should_enforce: &Boolean<F>,
) -> Result<(), SynthesisError>
fn conditional_enforce_not_equal( &self, other: &Self, should_enforce: &Boolean<F>, ) -> Result<(), SynthesisError>
should_enforce == true
, enforce that self
and other
are not
equal; else, enforce a vacuously true statement. Read moreSource§fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>
fn enforce_equal(&self, other: &Self) -> Result<(), SynthesisError>
Source§fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>
fn enforce_not_equal(&self, other: &Self) -> Result<(), SynthesisError>
Source§impl<F: Field> From<AllocatedBool<F>> for Boolean<F>
impl<F: Field> From<AllocatedBool<F>> for Boolean<F>
Source§fn from(b: AllocatedBool<F>) -> Self
fn from(b: AllocatedBool<F>) -> Self
Source§impl<BF, P> From<Boolean<<P as CubicExtConfig>::BasePrimeField>> for CubicExtVar<BF, P>where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarConfig<BF>,
impl<BF, P> From<Boolean<<P as CubicExtConfig>::BasePrimeField>> for CubicExtVar<BF, P>where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarConfig<BF>,
Source§fn from(other: Boolean<P::BasePrimeField>) -> Self
fn from(other: Boolean<P::BasePrimeField>) -> Self
Source§impl<BF, P> From<Boolean<<P as QuadExtConfig>::BasePrimeField>> for QuadExtVar<BF, P>where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: QuadExtVarConfig<BF>,
impl<BF, P> From<Boolean<<P as QuadExtConfig>::BasePrimeField>> for QuadExtVar<BF, P>where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: QuadExtVarConfig<BF>,
Source§fn from(other: Boolean<P::BasePrimeField>) -> Self
fn from(other: Boolean<P::BasePrimeField>) -> Self
Source§impl<TargetF: PrimeField, BaseF: PrimeField> From<Boolean<BaseF>> for EmulatedFpVar<TargetF, BaseF>
impl<TargetF: PrimeField, BaseF: PrimeField> From<Boolean<BaseF>> for EmulatedFpVar<TargetF, BaseF>
Source§impl<'a, F: Field> Not for &'a Boolean<F>
impl<'a, F: Field> Not for &'a Boolean<F>
Source§fn not(self) -> Self::Output
fn not(self) -> Self::Output
Negates self
.
This does not create any new variables or constraints.
// We'll use the BLS12-381 scalar field for our constraints.
use ark_test_curves::bls12_381::Fr;
use ark_relations::r1cs::*;
use ark_r1cs_std::prelude::*;
let cs = ConstraintSystem::<Fr>::new_ref();
let a = Boolean::new_witness(cs.clone(), || Ok(true))?;
let b = Boolean::new_witness(cs.clone(), || Ok(false))?;
(!&a).enforce_equal(&b)?;
(!&b).enforce_equal(&a)?;
(!&a).enforce_equal(&Boolean::FALSE)?;
(!&b).enforce_equal(&Boolean::TRUE)?;
assert!(cs.is_satisfied().unwrap());
Source§impl<F: Field> ToBitsGadget<F> for Boolean<F>
impl<F: Field> ToBitsGadget<F> for Boolean<F>
Source§fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
self
. Read moreSource§fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
self
. Read moreSource§fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
self
.Source§fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
self
.Source§impl<F: Field> ToBytesGadget<F> for Boolean<F>
impl<F: Field> ToBytesGadget<F> for Boolean<F>
Source§fn to_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
fn to_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
Outputs 1u8
if self
is true, and 0u8
otherwise.
Source§fn to_non_unique_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
fn to_non_unique_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
self
. Read moreSource§impl<F: PrimeField> ToConstraintFieldGadget<F> for Boolean<F>
impl<F: PrimeField> ToConstraintFieldGadget<F> for Boolean<F>
Source§fn to_constraint_field(&self) -> Result<Vec<FpVar<F>>, SynthesisError>
fn to_constraint_field(&self) -> Result<Vec<FpVar<F>>, SynthesisError>
self
to FpVar<ConstraintF>
variables.impl<F: Eq + Field> Eq for Boolean<F>
impl<F: Field> StructuralPartialEq for Boolean<F>
Auto Trait Implementations§
impl<F> Freeze for Boolean<F>
impl<F> !RefUnwindSafe for Boolean<F>
impl<F> !Send for Boolean<F>
impl<F> !Sync for Boolean<F>
impl<F> Unpin for Boolean<F>
impl<F> !UnwindSafe for Boolean<F>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more