[−][src]Enum ra_ap_hir_ty::TypeCtor
A type constructor or type name: this might be something like the primitive
type bool
, a struct like Vec
, or things like function pointers or
tuples.
Variants
The primitive boolean type. Written as bool
.
The primitive character type; holds a Unicode scalar value
(a non-surrogate code point). Written as char
.
Int(IntTy)
A primitive integer type. For example, i32
.
Float(FloatTy)
A primitive floating-point type. For example, f64
.
Adt(AdtId)
Structures, enumerations and unions.
The pointee of a string slice. Written as str
.
The pointee of an array slice. Written as [T]
.
An array with the given length. Written as [T; n]
.
RawPtr(Mutability)
A raw pointer. Written as *mut T
or *const T
Ref(Mutability)
A reference; a pointer with an associated lifetime. Written as
&'a mut T
or &'a T
.
FnDef(CallableDefId)
The anonymous type of a function declaration/definition. Each
function has a unique type, which is output (for a function
named foo
returning an i32
) as fn() -> i32 {foo}
.
This includes tuple struct / enum variant constructors as well.
For example the type of bar
here:
fn foo() -> i32 { 1 } let bar = foo; // bar: fn() -> i32 {foo}
A pointer to a function. Written as fn() -> i32
.
For example the type of bar
here:
fn foo() -> i32 { 1 } let bar: fn() -> i32 = foo;
The never type !
.
A tuple type. For example, (i32, bool)
.
Fields of Tuple
cardinality: u16
AssociatedType(TypeAliasId)
Represents an associated item like Iterator::Item
. This is used
when we have tried to normalize a projection like T::Item
but
couldn't find a better representation. In that case, we generate
an application type like (Iterator::Item)<T>
.
OpaqueType(OpaqueTyId)
This represents a placeholder for an opaque type in situations where we
don't know the hidden type (i.e. currently almost always). This is
analogous to the AssociatedType
type constructor. As with that one,
these are only produced by Chalk.
The type of a specific closure.
The closure signature is stored in a FnPtr
type in the first type
parameter.
Fields of Closure
def: DefWithBodyId
expr: ExprId
Implementations
impl TypeCtor
[src]
pub fn num_ty_params(self, db: &dyn HirDatabase) -> usize
[src]
pub fn krate(self, db: &dyn HirDatabase) -> Option<CrateId>
[src]
pub fn as_generic_def(self) -> Option<GenericDefId>
[src]
Trait Implementations
impl Clone for TypeCtor
[src]
impl Copy for TypeCtor
[src]
impl Debug for TypeCtor
[src]
impl Eq for TypeCtor
[src]
impl Hash for TypeCtor
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<TypeCtor> for TypeCtor
[src]
impl StructuralEq for TypeCtor
[src]
impl StructuralPartialEq for TypeCtor
[src]
Auto Trait Implementations
impl RefUnwindSafe for TypeCtor
impl Send for TypeCtor
impl Sync for TypeCtor
impl Unpin for TypeCtor
impl UnwindSafe for TypeCtor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Cast for T
[src]
fn cast<U>(self, interner: &<U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
[src]
Self: CastTo<U>,
U: HasInterner,
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,