pub enum Type {
Show 15 variants
Error,
Int {
width: IntWidth,
is_signed: bool,
},
Float(FloatWidth),
Pointer(Box<QualType>),
Inout(Box<Type>),
Function(FunctionType),
Struct(StructType),
Enum(EnumId),
Internal(InternalType),
Bool,
Void,
Mod,
Ty,
GenericParam(GenericParamId),
Never,
}
Variants
Error
Int
Float(FloatWidth)
Pointer(Box<QualType>)
Inout(Box<Type>)
Function(FunctionType)
Struct(StructType)
Enum(EnumId)
Internal(InternalType)
Used for internal compiler data structures exposed to compile-time code TODO: Mod and Ty, at minimum, could probably be moved here
Bool
Void
Mod
Ty
GenericParam(GenericParamId)
Never
Implementations
sourceimpl Type
impl Type
pub fn has_generic_parameters(&self) -> bool
pub fn ptr(self) -> Self
pub fn mut_ptr(self) -> Self
pub fn ptr_with_mut(self, is_mut: bool) -> Self
pub fn inout(self) -> Self
pub fn as_function(&self) -> Option<&FunctionType>
pub fn return_ty(&self) -> Option<&Type>
pub fn deref(&self) -> Option<&QualType>
pub const fn u8() -> Self
pub const fn u16() -> Self
pub const fn u32() -> Self
pub const fn u64() -> Self
pub const fn usize() -> Self
pub const fn i8() -> Self
pub const fn i16() -> Self
pub const fn i32() -> Self
pub const fn i64() -> Self
pub const fn isize() -> Self
pub const fn f32() -> Self
pub const fn f64() -> Self
pub fn trivially_convertible_to(&self, other: &Type) -> bool
pub fn is_error(&self) -> bool
pub fn is_int(&self) -> bool
Trait Implementations
sourceimpl From<InternalType> for Type
impl From<InternalType> for Type
sourcefn from(internal: InternalType) -> Self
fn from(internal: InternalType) -> Self
Converts to this type from the input type.
impl Eq for Type
impl StructuralEq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more