Trait snarkvm_circuit::environment::traits::Ternary
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§
§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,
§impl<E> Metrics<dyn Ternary<Output = Field<E>, Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> Metrics<dyn Ternary<Output = Field<E>, Boolean = Boolean<E>>> for Field<E>where E: Environment,
§impl<E> Metrics<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where
E: Environment,
impl<E> Metrics<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where E: Environment,
§impl<E, I> Metrics<dyn Ternary<Output = Integer<E, I>, Boolean = Boolean<E>>> for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> Metrics<dyn Ternary<Output = Integer<E, I>, Boolean = Boolean<E>>> for Integer<E, I>where E: Environment, I: IntegerType,
§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,
type Case = (CircuitType<Boolean<E>>, Mode, Mode)
§fn output_mode(
parameter: &<Address<E> as OutputMode<dyn Ternary<Output = Address<E>, Boolean = Boolean<E>>>>::Case
) -> Mode
fn output_mode( parameter: &<Address<E> as OutputMode<dyn Ternary<Output = Address<E>, Boolean = Boolean<E>>>>::Case ) -> Mode
Returns the mode of the output.
§impl<E> OutputMode<dyn Ternary<Output = Field<E>, Boolean = Boolean<E>>> for Field<E>where
E: Environment,
impl<E> OutputMode<dyn Ternary<Output = Field<E>, Boolean = Boolean<E>>> for Field<E>where E: Environment,
type Case = (CircuitType<Boolean<E>>, Mode, Mode)
§fn output_mode(
parameter: &<Field<E> as OutputMode<dyn Ternary<Output = Field<E>, Boolean = Boolean<E>>>>::Case
) -> Mode
fn output_mode( parameter: &<Field<E> as OutputMode<dyn Ternary<Output = Field<E>, Boolean = Boolean<E>>>>::Case ) -> Mode
Returns the mode of the output.
§impl<E> OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where
E: Environment,
impl<E> OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>> for Group<E>where E: Environment,
type Case = (CircuitType<Boolean<E>>, Mode, Mode)
§fn output_mode(
parameter: &<Group<E> as OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>>>::Case
) -> Mode
fn output_mode( parameter: &<Group<E> as OutputMode<dyn Ternary<Output = Group<E>, Boolean = Boolean<E>>>>::Case ) -> Mode
Returns the mode of the output.
§impl<E, I> OutputMode<dyn Ternary<Output = Integer<E, I>, Boolean = Boolean<E>>> for Integer<E, I>where
E: Environment,
I: IntegerType,
impl<E, I> OutputMode<dyn Ternary<Output = Integer<E, I>, Boolean = Boolean<E>>> for Integer<E, I>where E: Environment, I: IntegerType,
type Case = (CircuitType<Boolean<E>>, Mode, Mode)
§fn output_mode(
case: &<Integer<E, I> as OutputMode<dyn Ternary<Output = Integer<E, I>, Boolean = Boolean<E>>>>::Case
) -> Mode
fn output_mode( case: &<Integer<E, I> as OutputMode<dyn Ternary<Output = Integer<E, I>, Boolean = Boolean<E>>>>::Case ) -> Mode
Returns the mode of the output.