Enum TypeExpr
pub(in elab) enum TypeExpr {
TypeKind,
Named(String),
Pointer {
item: Box<TypeExpr>,
},
Array {
item: Box<TypeExpr>,
len: usize,
},
Slice {
item: Box<TypeExpr>,
},
Tuple(Vec<TypeExpr>),
Apply {
callee: String,
args: Vec<TypeExpr>,
},
Struct {
fields: Vec<NamedTypeField>,
},
Enum {
variants: Vec<VariantType>,
},
Union {
fields: Vec<NamedTypeField>,
},
}Expand description
Type syntax shared across frontend stages.
Variants§
TypeKind
The kind of all types in meta code.
Named(String)
Named type constructor.
Pointer
Pointer type constructor.
Array
Fixed-size array type constructor.
Slice
Borrowed slice type constructor.
Tuple(Vec<TypeExpr>)
Tuple type constructor.
Apply
Type application with explicit arguments.
Fields
Struct
Anonymous struct type literal.
Fields
§
fields: Vec<NamedTypeField>Fields declared on the anonymous struct type.
Enum
Anonymous enum type literal.
Fields
§
variants: Vec<VariantType>Variants declared on the anonymous enum type.
Union
Anonymous union type literal.
Fields
§
fields: Vec<NamedTypeField>Fields declared on the anonymous union type.
Trait Implementations§
impl Eq for TypeExpr
impl StructuralPartialEq for TypeExpr
Auto Trait Implementations§
impl Freeze for TypeExpr
impl RefUnwindSafe for TypeExpr
impl Send for TypeExpr
impl Sync for TypeExpr
impl Unpin for TypeExpr
impl UnwindSafe for TypeExpr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more