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§
Implementations on Foreign Types§
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> Ternary for StringType<E>where
E: Environment,
impl<E> Ternary for StringType<E>where
E: Environment,
Source§fn ternary(
condition: &<StringType<E> as Ternary>::Boolean,
first: &StringType<E>,
second: &StringType<E>,
) -> <StringType<E> as Ternary>::Output
fn ternary( condition: &<StringType<E> as Ternary>::Boolean, first: &StringType<E>, second: &StringType<E>, ) -> <StringType<E> as Ternary>::Output
Returns first
if condition
is true
, otherwise returns second
.
type Boolean = Boolean<E>
type Output = StringType<E>
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<N> Ternary for ComputeKey<N>where
N: Network,
impl<N> Ternary for ComputeKey<N>where
N: Network,
Source§fn ternary(
condition: &<ComputeKey<N> as Ternary>::Boolean,
first: &ComputeKey<N>,
second: &ComputeKey<N>,
) -> <ComputeKey<N> as Ternary>::Output
fn ternary( condition: &<ComputeKey<N> as Ternary>::Boolean, first: &ComputeKey<N>, second: &ComputeKey<N>, ) -> <ComputeKey<N> as Ternary>::Output
Returns first
if condition
is true
, otherwise returns second
.