enum LiteralVector {
F64(ArrayVec<f64, { crate::VectorSize::MAX }>),
F32(ArrayVec<f32, { crate::VectorSize::MAX }>),
F16(ArrayVec<f16, { crate::VectorSize::MAX }>),
U32(ArrayVec<u32, { crate::VectorSize::MAX }>),
I32(ArrayVec<i32, { crate::VectorSize::MAX }>),
U64(ArrayVec<u64, { crate::VectorSize::MAX }>),
I64(ArrayVec<i64, { crate::VectorSize::MAX }>),
Bool(ArrayVec<bool, { crate::VectorSize::MAX }>),
AbstractInt(ArrayVec<i64, { crate::VectorSize::MAX }>),
AbstractFloat(ArrayVec<f64, { crate::VectorSize::MAX }>),
}Expand description
Vectors with a concrete element type.
Variants§
F64(ArrayVec<f64, { crate::VectorSize::MAX }>)
F32(ArrayVec<f32, { crate::VectorSize::MAX }>)
F16(ArrayVec<f16, { crate::VectorSize::MAX }>)
U32(ArrayVec<u32, { crate::VectorSize::MAX }>)
I32(ArrayVec<i32, { crate::VectorSize::MAX }>)
U64(ArrayVec<u64, { crate::VectorSize::MAX }>)
I64(ArrayVec<i64, { crate::VectorSize::MAX }>)
Bool(ArrayVec<bool, { crate::VectorSize::MAX }>)
AbstractInt(ArrayVec<i64, { crate::VectorSize::MAX }>)
AbstractFloat(ArrayVec<f64, { crate::VectorSize::MAX }>)
Implementations§
Source§impl LiteralVector
impl LiteralVector
fn len(&self) -> usize
Sourcefn from_literal(literal: Literal) -> Self
fn from_literal(literal: Literal) -> Self
Creates LiteralVector of size 1 from single Literal
Sourcefn from_literal_vec(
components: ArrayVec<Literal, { crate::VectorSize::MAX }>,
) -> Result<Self, ConstantEvaluatorError>
fn from_literal_vec( components: ArrayVec<Literal, { crate::VectorSize::MAX }>, ) -> Result<Self, ConstantEvaluatorError>
Creates LiteralVector from ArrayVec of Literals.
Returns error if components types do not match.
§Panics
Panics if vector is empty
Sourcefn to_literal_vec(&self) -> ArrayVec<Literal, { crate::VectorSize::MAX }>
fn to_literal_vec(&self) -> ArrayVec<Literal, { crate::VectorSize::MAX }>
Sourcefn register_as_evaluated_expr(
&self,
eval: &mut ConstantEvaluator<'_>,
span: Span,
) -> Result<Handle<Expression>, ConstantEvaluatorError>
fn register_as_evaluated_expr( &self, eval: &mut ConstantEvaluator<'_>, span: Span, ) -> Result<Handle<Expression>, ConstantEvaluatorError>
Puts self into eval’s expressions arena and returns handle to it
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LiteralVector
impl RefUnwindSafe for LiteralVector
impl Send for LiteralVector
impl Sync for LiteralVector
impl Unpin for LiteralVector
impl UnwindSafe for LiteralVector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more