pub enum AstType {
Simple {
name: SharedString,
type_args: Vec<AstTypeId>,
ty: TypeId,
},
Array {
element_type: AstTypeId,
dimensions: u32,
ty: TypeId,
},
Primitive {
kind: PrimitiveType,
ty: TypeId,
},
Wildcard {
bound: Option<WildcardBound>,
ty: TypeId,
},
Error,
}Variants§
Implementations§
Source§impl AstType
impl AstType
pub fn simple(name: SharedString) -> Self
pub fn simple_with_args(name: SharedString, type_args: Vec<AstTypeId>) -> Self
pub fn array(element_type: AstTypeId, dimensions: u32) -> Self
pub fn primitive(kind: PrimitiveType) -> Self
pub fn wildcard(bound: Option<WildcardBound>) -> Self
pub fn error() -> Self
pub fn ty(&self) -> TypeId
pub fn set_ty(&mut self, ty: TypeId)
pub fn is_simple(&self) -> bool
pub fn is_array(&self) -> bool
pub fn is_primitive(&self) -> bool
pub fn is_wildcard(&self) -> bool
pub fn is_error(&self) -> bool
Trait Implementations§
impl StructuralPartialEq for AstType
Auto Trait Implementations§
impl Freeze for AstType
impl RefUnwindSafe for AstType
impl Send for AstType
impl Sync for AstType
impl Unpin for AstType
impl UnsafeUnpin for AstType
impl UnwindSafe for AstType
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