hir_ty

Trait TyExt

Source
pub trait TyExt {
Show 28 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_str(&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_str(&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