pub enum Type {
Path {
path: Path,
args: Vec<Spanned<Type>>,
},
Ref {
is_mut: bool,
inner: Box<Spanned<Type>>,
},
Ptr {
is_mut: bool,
inner: Box<Spanned<Type>>,
},
Array(Box<Spanned<Type>>),
Tuple(Vec<Spanned<Type>>),
Fn {
params: Vec<Spanned<Type>>,
ret: Box<Spanned<Type>>,
},
Optional(Box<Spanned<Type>>),
Infer,
}Expand description
A type expression.
Variants§
Path
A named type, possibly with generic arguments: Vec<Int>, String.
Ref
A shared reference &T or mutable reference &mut T.
Ptr
A raw pointer *T or *mut T (unsafe only).
Array(Box<Spanned<Type>>)
An array / slice type [T].
Tuple(Vec<Spanned<Type>>)
A tuple type (A, B, C). Empty tuple () is the unit type.
Fn
A function type fn(A, B) -> C.
Optional(Box<Spanned<Type>>)
The optional sugar T? (equivalent to Option<T>).
Infer
A placeholder _ that tells the compiler to infer the type.
Trait Implementations§
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