pub enum TypeExprKind {
Named {
name: Ident,
args: Vec<TypeArg>,
},
Array {
elem: Box<TypeExpr>,
size: Box<Expr>,
},
Tuple(Vec<TypeExpr>),
Fn {
params: Vec<TypeExpr>,
ret: Box<TypeExpr>,
},
ShapeLit(Vec<ShapeDim>),
}Expand description
The kind of a type expression.
Covers named types, arrays, tuples, function types, and shape literals used in CJC’s tensor type system.
Variants§
Named
Named type with optional generic arguments: f64, Tensor<f32>, Vec<T>.
Fields
Array
Fixed-size array type: [T; N].
Fields
Tuple(Vec<TypeExpr>)
Tuple type: (T, U, V).
Fn
Function type: fn(T, U) -> V.
ShapeLit(Vec<ShapeDim>)
Shape literal in type position: [M, N] for tensor dimensions.
Trait Implementations§
Source§impl Clone for TypeExprKind
impl Clone for TypeExprKind
Source§fn clone(&self) -> TypeExprKind
fn clone(&self) -> TypeExprKind
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TypeExprKind
impl RefUnwindSafe for TypeExprKind
impl Send for TypeExprKind
impl Sync for TypeExprKind
impl Unpin for TypeExprKind
impl UnsafeUnpin for TypeExprKind
impl UnwindSafe for TypeExprKind
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