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§

type Boolean

type Output

Required Methods§

fn ternary( condition: &Self::Boolean, first: &Self, second: &Self ) -> Self::Output
where Self: Sized,

Returns first if condition is true, otherwise returns second.

Implementations on Foreign Types§

source§

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

Returns first if condition is true, otherwise returns second.

§

type Boolean = Boolean<N>

§

type Output = Box<Signature<N>>

source§

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

Returns first if condition is true, otherwise returns second.

§

type Boolean = Boolean<N>

§

type Output = ComputeKey<N>

Implementors§

§

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

§

type Boolean = Boolean<E>

§

type Output = Boolean<E>

§

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

§

type Boolean = Boolean<E>

§

type Output = Field<E>

§

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

§

type Boolean = Boolean<E>

§

type Output = Address<E>

§

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

§

type Boolean = Boolean<E>

§

type Output = Group<E>

§

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

§

type Boolean = Boolean<E>

§

type Output = Scalar<E>

§

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

§

impl<E, I> Ternary for Integer<E, I>
where E: Environment, I: IntegerType,

§

type Boolean = Boolean<E>

§

type Output = Integer<E, I>

source§

impl<N> Ternary for Signature<N>
where N: Network,

§

type Boolean = Boolean<N>

§

type Output = Signature<N>