Trait ra_ap_hir_ty::TyExt

source ·
pub trait TyExt {
Show 27 methods // Required methods fn is_unit(&self) -> bool; fn is_integral(&self) -> bool; fn is_scalar(&self) -> bool; fn is_floating_point(&self) -> bool; fn is_never(&self) -> bool; fn is_unknown(&self) -> bool; fn contains_unknown(&self) -> bool; fn is_ty_var(&self) -> bool; fn is_union(&self) -> bool; fn as_adt(&self) -> Option<(AdtId, &Substitution)>; fn as_builtin(&self) -> Option<BuiltinType>; fn as_tuple(&self) -> Option<&Substitution>; fn as_closure(&self) -> Option<ClosureId>; fn as_fn_def(&self, db: &dyn HirDatabase) -> Option<FunctionId>; fn as_reference(&self) -> Option<(&Ty, Lifetime, Mutability)>; fn as_raw_ptr(&self) -> Option<(&Ty, Mutability)>; fn as_reference_or_ptr(&self) -> Option<(&Ty, Rawness, Mutability)>; fn as_generic_def(&self, db: &dyn HirDatabase) -> Option<GenericDefId>; fn callable_def(&self, db: &dyn HirDatabase) -> Option<CallableDefId>; fn callable_sig(&self, db: &dyn HirDatabase) -> Option<CallableSig>; fn strip_references(&self) -> &Ty; fn strip_reference(&self) -> &Ty; fn dyn_trait(&self) -> Option<TraitId>; fn impl_trait_bounds( &self, db: &dyn HirDatabase ) -> Option<Vec<QuantifiedWhereClause>>; fn associated_type_parent_trait( &self, db: &dyn HirDatabase ) -> Option<TraitId>; fn is_copy(self, db: &dyn HirDatabase, owner: DefWithBodyId) -> bool; fn equals_ctor(&self, other: &Ty) -> bool;
}

Required Methods§

source

fn is_unit(&self) -> bool

source

fn is_integral(&self) -> bool

source

fn is_scalar(&self) -> bool

source

fn is_floating_point(&self) -> bool

source

fn is_never(&self) -> bool

source

fn is_unknown(&self) -> bool

source

fn contains_unknown(&self) -> bool

source

fn is_ty_var(&self) -> bool

source

fn is_union(&self) -> bool

source

fn as_adt(&self) -> Option<(AdtId, &Substitution)>

source

fn as_builtin(&self) -> Option<BuiltinType>

source

fn as_tuple(&self) -> Option<&Substitution>

source

fn as_closure(&self) -> Option<ClosureId>

source

fn as_fn_def(&self, db: &dyn HirDatabase) -> Option<FunctionId>

source

fn as_reference(&self) -> Option<(&Ty, Lifetime, Mutability)>

source

fn as_raw_ptr(&self) -> Option<(&Ty, Mutability)>

source

fn as_reference_or_ptr(&self) -> Option<(&Ty, Rawness, Mutability)>

source

fn as_generic_def(&self, db: &dyn HirDatabase) -> Option<GenericDefId>

source

fn callable_def(&self, db: &dyn HirDatabase) -> Option<CallableDefId>

source

fn callable_sig(&self, db: &dyn HirDatabase) -> Option<CallableSig>

source

fn strip_references(&self) -> &Ty

source

fn strip_reference(&self) -> &Ty

source

fn dyn_trait(&self) -> Option<TraitId>

If this is a dyn Trait, returns that trait.

source

fn impl_trait_bounds( &self, db: &dyn HirDatabase ) -> Option<Vec<QuantifiedWhereClause>>

source

fn associated_type_parent_trait(&self, db: &dyn HirDatabase) -> Option<TraitId>

source

fn is_copy(self, db: &dyn HirDatabase, owner: DefWithBodyId) -> bool

source

fn equals_ctor(&self, other: &Ty) -> bool

FIXME: Get rid of this, it’s not a good abstraction

Implementors§

source§

impl TyExt for Ty