pub enum TypeExpr {
Tensor {
dims: Vec<Dimension>,
dtype: DTypeKind,
span: Span,
},
Scalar(DTypeKind, Span),
Tuple(Vec<TypeExpr>, Span),
List(Box<TypeExpr>, Span),
Dict(Vec<(String, TypeExpr)>, Span),
Named(String, Span),
Dynamic(Span),
IntDim(i64, Span),
BinaryDim {
left: Box<TypeExpr>,
op: BinOp,
right: Box<TypeExpr>,
span: Span,
},
}Expand description
A type expression (Tensor<dims, dtype>, scalar, tuple, etc.).
Variants§
Tensor
Tensor<[dim1, dim2, ...], dtype>
Scalar(DTypeKind, Span)
A bare scalar dtype: f32, i64, etc.
Tuple(Vec<TypeExpr>, Span)
(TypeA, TypeB, ...)
List(Box<TypeExpr>, Span)
[TypeExpr] — list of
Dict(Vec<(String, TypeExpr)>, Span)
{ field: Type, ... } — dict/struct
Named(String, Span)
A named type alias reference
Dynamic(Span)
? — dynamic/unknown
IntDim(i64, Span)
An integer dimension used as a type: concrete dimension value
BinaryDim
Arithmetic on dimensions: e.g. D / 2
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeExpr
impl RefUnwindSafe for TypeExpr
impl Send for TypeExpr
impl Sync for TypeExpr
impl Unpin for TypeExpr
impl UnwindSafe for TypeExpr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more