pub enum TypeAst {
Prim {
name: String,
loc: Option<Loc>,
},
Lit {
v: Value,
loc: Option<Loc>,
},
Range {
lo: Value,
hi: Value,
excl: bool,
loc: Option<Loc>,
},
Pattern {
re: String,
loc: Option<Loc>,
},
Record {
members: Vec<MemberAst>,
open: bool,
loc: Option<Loc>,
},
Map {
key: Box<TypeAst>,
val: Box<TypeAst>,
loc: Option<Loc>,
},
Array {
elem: Box<TypeAst>,
lo: Option<Value>,
hi: Option<Value>,
excl: bool,
loc: Option<Loc>,
},
Union {
arms: Vec<TypeAst>,
loc: Option<Loc>,
},
Isect {
arms: Vec<TypeAst>,
loc: Option<Loc>,
},
Func {
params: Vec<TypeAst>,
ret: Box<TypeAst>,
loc: Option<Loc>,
},
Named {
name: String,
args: Vec<TypeAst>,
preds: Option<Vec<Rc<Expr>>>,
ext: Option<Box<TypeAst>>,
loc: Option<Loc>,
},
}Expand description
a type expression (§3; chapter 11)
Variants§
Prim
a primitive type by name
Lit
a literal type
Range
a numeric range
Fields
Pattern
a string pattern
Record
a record type
Fields
Map
a map type
Fields
Array
an array type
Fields
Union
a union
Isect
an intersection
Func
a function type
Fields
Named
a named type, with its arguments, predicates, and extension
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TypeAst
impl !Send for TypeAst
impl !Sync for TypeAst
impl !UnwindSafe for TypeAst
impl Freeze for TypeAst
impl Unpin for TypeAst
impl UnsafeUnpin for TypeAst
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