pub enum Type {
Named {
name: String,
generics: Vec<Type>,
span: Span,
},
Tuple(Vec<Type>, Span),
Array(Box<Type>, usize, Span),
Slice(Box<Type>, Span),
Ref {
mutable: bool,
inner: Box<Type>,
lifetime: Option<String>,
span: Span,
},
Function {
params: Vec<Type>,
return_type: Box<Type>,
effects: Vec<Effect>,
span: Span,
},
Option(Box<Type>, Span),
Result(Box<Type>, Box<Type>, Span),
Infer(Span),
Never(Span),
Unit(Span),
Impl {
trait_name: String,
generics: Vec<Type>,
span: Span,
},
}Variants§
Named
Named type: Int, String, Vec<T>
Tuple(Vec<Type>, Span)
Tuple: (A, B, C)
Array(Box<Type>, usize, Span)
Array: [T; N]
Slice(Box<Type>, Span)
Slice: [T]
Ref
Reference: &T, &mut T
Function
Function type: fn(A, B) -> C with Effects
Option(Box<Type>, Span)
Option shorthand: T?
Result(Box<Type>, Box<Type>, Span)
Result shorthand: T!E
Infer(Span)
Inferred: _
Never(Span)
Never type: !
Unit(Span)
Unit type: ()
Impl
impl Trait: impl Future, impl Iterator<Item = T>
Implementations§
Trait Implementations§
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 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