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