pub enum Type {
Never,
Bool,
Int(IntWidth, Signedness),
Float(FloatWidth),
Pointer(Mutability, Box<Self>),
Array(Box<Self>, usize),
Vector(Box<Self>, usize),
Slice(Mutability, Box<Self>),
Tuple(Vec<Self>),
Enum(Vec<Self>),
Named(String),
Function(FunctionSignature),
}Expand description
A resolved type in the AST.
Variants§
Never
Diverging type (never returns).
Bool
Boolean.
Int(IntWidth, Signedness)
Integer with width and signedness.
Float(FloatWidth)
Floating-point with width.
Pointer(Mutability, Box<Self>)
Pointer with mutability and pointee type.
Array(Box<Self>, usize)
Fixed-size array with element type and length.
Vector(Box<Self>, usize)
SIMD vector with element type and lane count.
Slice(Mutability, Box<Self>)
Slice with mutability and element type.
Tuple(Vec<Self>)
Tuple of types (product/AND type).
Enum(Vec<Self>)
Enum of variant types (sum/OR type).
Named(String)
Named/user-defined type.
Function(FunctionSignature)
Function pointer type.
Implementations§
Trait Implementations§
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnsafeUnpin for Type
impl UnwindSafe for Type
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