pub enum TyExpr {
None,
Ty(Ty),
Int(ConstValue),
}
Expand description
A type expression is something that we resolve from an identifier and are valid as type parameters. These aren’t always necessarily types, but are type-related expressions.
Variants§
None
None.
This is a special type only for use in Union types.
Ty(Ty)
A type.
Int(ConstValue)
A value, possibly resolved from a const.
This isn’t a normal type, but it’s valid and we can resolve to it from things that look like types and then would proceed to error from that.
Implementations§
Source§impl TyExpr
impl TyExpr
Sourcepub fn new_simple(ident: Identifier) -> Self
pub fn new_simple(ident: Identifier) -> Self
Create a new simple type expression.
Sourcepub fn iter_idents(&self) -> impl Iterator<Item = &Identifier>
pub fn iter_idents(&self) -> impl Iterator<Item = &Identifier>
Iterate over all the identifiers in the type expression.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TyExpr
impl RefUnwindSafe for TyExpr
impl Send for TyExpr
impl Sync for TyExpr
impl Unpin for TyExpr
impl UnwindSafe for TyExpr
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