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 valueStash- stash read markerStashOperand<D>- stash read with branch validityVeBranchOperand<D, _>- explicit operand (pass through)&VrfTensor<D, ...>- VRF tensor reference
Multiple operands (direct implementations):
[VeBranchOperand<D, _>; N]- array of operands for multi-branch operationsArrayVec<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§
Sourcefn into_operands(
self,
) -> ArrayVec<VeBranchOperand<D, TargetMapping>, MAX_BRANCHES>
fn into_operands( self, ) -> ArrayVec<VeBranchOperand<D, TargetMapping>, MAX_BRANCHES>
Converts into an ArrayVec of operands.