IntoOperands

Trait IntoOperands 

Source
pub trait IntoOperands<D: VeScalar, TargetMapping: M> {
    // Required method
    fn into_operands(
        self,
    ) -> ArrayVec<VeBranchOperand<D, TargetMapping>, MAX_BRANCHES>;
}
Expand description

Trait for converting various operand types into an ArrayVec.

Types implementing Into<VeBranchOperand> automatically get this via blanket impl. Array types [VeBranchOperand; N] and ArrayVec implement this directly.

§Supported operand types

Single operand (via Into<VeBranchOperand>, auto-wrapped in ArrayVec):

  • i32, f32 - constant value
  • Stash - stash read marker
  • StashOperand<D> - stash read with branch validity
  • VeBranchOperand<D, _> - explicit operand (pass through)
  • &VrfTensor<D, ...> - VRF tensor reference

Multiple operands (direct implementations):

  • [VeBranchOperand<D, _>; N] - array of operands for multi-branch operations
  • ArrayVec<VeBranchOperand<D, _>, MAX_BRANCHES> - pass through

§Examples

// Single operand - direct usage
tensor.vector_fxp(op, 16384i32)

// Multiple homogeneous operands
tensor.vector_fxp(op, [
    VeBranchOperand::group(VeRhs::constant(100), GroupId::Group0),
    VeBranchOperand::group(VeRhs::constant(200), GroupId::Group1),
])

// Multiple heterogeneous operands - use .into()
tensor.vector_fxp(op, [
    16384i32.into(),
    Stash.into(),
])

Required Methods§

Source

fn into_operands( self, ) -> ArrayVec<VeBranchOperand<D, TargetMapping>, MAX_BRANCHES>

Converts into an ArrayVec of operands.

Implementations on Foreign Types§

Source§

impl<D: VeScalar, TargetMapping: M, const N: usize> IntoOperands<D, TargetMapping> for [VeBranchOperand<D, TargetMapping>; N]

Source§

fn into_operands( self, ) -> ArrayVec<VeBranchOperand<D, TargetMapping>, MAX_BRANCHES>

Implementors§

Source§

impl<D: VeScalar, TargetMapping: M> IntoOperands<D, TargetMapping> for ArrayVec<VeBranchOperand<D, TargetMapping>, MAX_BRANCHES>

Source§

impl<T, D: VeScalar, TargetMapping: M> IntoOperands<D, TargetMapping> for T
where T: Into<VeBranchOperand<D, TargetMapping>>,