pub enum TyKind {
RigidTy(RigidTy),
Alias(AliasKind, AliasTy),
Param(ParamTy),
Bound(usize, BoundTy),
}
Variants§
Implementations§
Source§impl TyKind
impl TyKind
pub fn rigid(&self) -> Option<&RigidTy>
pub fn is_unit(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_char(&self) -> bool
pub fn is_trait(&self) -> bool
pub fn is_enum(&self) -> bool
pub fn is_struct(&self) -> bool
pub fn is_union(&self) -> bool
pub fn is_adt(&self) -> bool
pub fn is_ref(&self) -> bool
pub fn is_fn(&self) -> bool
pub fn is_fn_ptr(&self) -> bool
pub fn is_primitive(&self) -> bool
pub fn is_float(&self) -> bool
pub fn is_integral(&self) -> bool
pub fn is_numeric(&self) -> bool
pub fn is_signed(&self) -> bool
pub fn is_str(&self) -> bool
pub fn is_cstr(&self) -> bool
pub fn is_slice(&self) -> bool
pub fn is_array(&self) -> bool
pub fn is_mutable_ptr(&self) -> bool
pub fn is_raw_ptr(&self) -> bool
Sourcepub fn is_any_ptr(&self) -> bool
pub fn is_any_ptr(&self) -> bool
Tests if this is any kind of primitive pointer type (reference, raw pointer, fn pointer).
pub fn is_coroutine(&self) -> bool
pub fn is_closure(&self) -> bool
pub fn is_box(&self) -> bool
pub fn is_simd(&self) -> bool
pub fn trait_principal(&self) -> Option<Binder<ExistentialTraitRef>>
Sourcepub fn builtin_index(&self) -> Option<Ty>
pub fn builtin_index(&self) -> Option<Ty>
Returns the type of ty[i]
for builtin types.
Sourcepub fn builtin_deref(&self, explicit: bool) -> Option<TypeAndMut>
pub fn builtin_deref(&self, explicit: bool) -> Option<TypeAndMut>
Returns the type and mutability of *ty
for builtin types.
The parameter explicit
indicates if this is an explicit dereference.
Some types – notably unsafe ptrs – can only be dereferenced explicitly.
Sourcepub fn fn_sig(&self) -> Option<PolyFnSig>
pub fn fn_sig(&self) -> Option<PolyFnSig>
Get the function signature for function like types (Fn, FnPtr, and Closure)
Sourcepub fn discriminant_ty(&self) -> Option<Ty>
pub fn discriminant_ty(&self) -> Option<Ty>
Get the discriminant type for this type.
Sourcepub fn fn_def(&self) -> Option<(FnDef, &GenericArgs)>
pub fn fn_def(&self) -> Option<(FnDef, &GenericArgs)>
Deconstruct a function type if this is one.
Trait Implementations§
impl Eq for TyKind
impl StructuralPartialEq for TyKind
Auto Trait Implementations§
impl Freeze for TyKind
impl RefUnwindSafe for TyKind
impl Send for TyKind
impl Sync for TyKind
impl Unpin for TyKind
impl UnwindSafe for TyKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 176 bytes
Size for each variant:
RigidTy
: 176 bytesAlias
: 48 bytesParam
: 40 bytesBound
: 56 bytes