pub trait Ternary {
type Boolean;
type Output;
// Required method
fn ternary(
condition: &Self::Boolean,
first: &Self,
second: &Self,
) -> Self::Output
where Self: Sized;
}Expand description
Trait for ternary operations.
Required Associated Types§
Required Methods§
Trait Implementations§
Source§impl<E> Metrics<dyn Ternary<Output = Address<E>, Boolean = Boolean<E>>> for Address<E>where
E: Environment,
impl<E> Metrics<dyn Ternary<Output = Address<E>, Boolean = Boolean<E>>> for Address<E>where
E: Environment,
Source§impl<E> OutputMode<dyn Ternary<Output = Address<E>, Boolean = Boolean<E>>> for Address<E>where
E: Environment,
impl<E> OutputMode<dyn Ternary<Output = Address<E>, Boolean = Boolean<E>>> for Address<E>where
E: Environment,
Implementations on Foreign Types§
Source§impl<A> Ternary for Box<Signature<A>>where
A: Aleo,
impl<A> Ternary for Box<Signature<A>>where
A: Aleo,
Source§fn ternary(
condition: &<Box<Signature<A>> as Ternary>::Boolean,
first: &Box<Signature<A>>,
second: &Box<Signature<A>>,
) -> <Box<Signature<A>> as Ternary>::Output
fn ternary( condition: &<Box<Signature<A>> as Ternary>::Boolean, first: &Box<Signature<A>>, second: &Box<Signature<A>>, ) -> <Box<Signature<A>> as Ternary>::Output
Returns first if condition is true, otherwise returns second.
type Boolean = Boolean<A>
type Output = Box<Signature<A>>
Source§impl<A> Ternary for ComputeKey<A>where
A: Aleo,
impl<A> Ternary for ComputeKey<A>where
A: Aleo,
Source§fn ternary(
condition: &<ComputeKey<A> as Ternary>::Boolean,
first: &ComputeKey<A>,
second: &ComputeKey<A>,
) -> <ComputeKey<A> as Ternary>::Output
fn ternary( condition: &<ComputeKey<A> as Ternary>::Boolean, first: &ComputeKey<A>, second: &ComputeKey<A>, ) -> <ComputeKey<A> as Ternary>::Output
Returns first if condition is true, otherwise returns second.
type Boolean = Boolean<A>
type Output = ComputeKey<A>
Source§impl<E> Ternary for Address<E>where
E: Environment,
impl<E> Ternary for Address<E>where
E: Environment,
Source§impl<E> Ternary for Boolean<E>where
E: Environment,
impl<E> Ternary for Boolean<E>where
E: Environment,
Source§impl<E> Ternary for Field<E>where
E: Environment,
impl<E> Ternary for Field<E>where
E: Environment,
Source§impl<E> Ternary for Group<E>where
E: Environment,
impl<E> Ternary for Group<E>where
E: Environment,
Source§impl<E> Ternary for Scalar<E>where
E: Environment,
impl<E> Ternary for Scalar<E>where
E: Environment,
Source§impl<E, I> Ternary for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> Ternary for Integer<E, I>where
E: Environment,
I: IntegerType,
Source§impl<E, const VARIANT: usize> Ternary for BooleanHash<E, VARIANT>where
E: Environment,
impl<E, const VARIANT: usize> Ternary for BooleanHash<E, VARIANT>where
E: Environment,
Source§fn ternary(
condition: &<BooleanHash<E, VARIANT> as Ternary>::Boolean,
first: &BooleanHash<E, VARIANT>,
second: &BooleanHash<E, VARIANT>,
) -> <BooleanHash<E, VARIANT> as Ternary>::Output
fn ternary( condition: &<BooleanHash<E, VARIANT> as Ternary>::Boolean, first: &BooleanHash<E, VARIANT>, second: &BooleanHash<E, VARIANT>, ) -> <BooleanHash<E, VARIANT> as Ternary>::Output
Returns first if condition is true, otherwise returns second.
type Boolean = Boolean<E>
type Output = BooleanHash<E, VARIANT>
Source§impl<N> Ternary for Box<Signature<N>>where
N: Network,
impl<N> Ternary for Box<Signature<N>>where
N: Network,
Source§fn ternary(
condition: &<Box<Signature<N>> as Ternary>::Boolean,
first: &Box<Signature<N>>,
second: &Box<Signature<N>>,
) -> <Box<Signature<N>> as Ternary>::Output
fn ternary( condition: &<Box<Signature<N>> as Ternary>::Boolean, first: &Box<Signature<N>>, second: &Box<Signature<N>>, ) -> <Box<Signature<N>> as Ternary>::Output
Returns first if condition is true, otherwise returns second.