IntoGroupTernaryOperand

Trait IntoGroupTernaryOperand 

Source
pub trait IntoGroupTernaryOperand<Mapping: M> {
    // Required method
    fn into_group_ternary_operand(self) -> GroupTernaryOperand<Mapping>;
}
Expand description

Trait for converting various types into a group ternary operand.

Uses Into<TernaryOperand> blanket impl for automatic conversion from types that implement From for TernaryOperand ((f32, f32), (VeRhs, f32), etc.).

§Supported types

  • () - skip operation for this group
  • (f32, f32) - two constant values (via Into<TernaryOperand>)
  • (VeRhs<f32, Mapping>, f32) - VeRhs and constant (via Into<TernaryOperand>)
  • TernaryOperand<Mapping> - explicit ternary operand (via Into<TernaryOperand>)
  • Option<TernaryOperand<Mapping>> - pass through

§Example

// Apply ternary op only to group0
pair.vector_fp_ternary(op, (2.0f32, 3.0f32), ())

// Apply to both groups with different operands
pair.vector_fp_ternary(op, (2.0f32, 3.0f32), (4.0f32, 5.0f32))

// With stash as operand0 for group0
pair.vector_fp_ternary(op, (Stash, 3.0f32), ())

Required Methods§

Source

fn into_group_ternary_operand(self) -> GroupTernaryOperand<Mapping>

Converts into a GroupTernaryOperand with the specified mapping.

Implementations on Foreign Types§

Source§

impl<Mapping: M> IntoGroupTernaryOperand<Mapping> for Option<TernaryOperand<Mapping>>

Option<TernaryOperand<Mapping>> passes through.

Source§

impl<Mapping: M> IntoGroupTernaryOperand<Mapping> for ()

() represents skipping the operation for this group.

Implementors§

Source§

impl<T, Mapping: M> IntoGroupTernaryOperand<Mapping> for T
where T: Into<TernaryOperand<Mapping>>,

Blanket impl: any type that implements Into<TernaryOperand> automatically implements IntoGroupTernaryOperand by wrapping in Some.