Type Definition ra_ap_hir_ty::Ty
source · [−]Trait Implementations
sourceimpl HirDisplay for Ty
impl HirDisplay for Ty
fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError>
sourcefn into_displayable<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget
) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
fn into_displayable<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget
) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
Returns a Display
able type that is human-readable.
sourcefn display<'a>(&'a self, db: &'a dyn HirDatabase) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
fn display<'a>(&'a self, db: &'a dyn HirDatabase) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
Returns a Display
able type that is human-readable.
Use this for showing types to the user (e.g. diagnostics) Read more
sourcefn display_truncated<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
fn display_truncated<'a>(
&'a self,
db: &'a dyn HirDatabase,
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
Returns a Display
able type that is human-readable and tries to be succinct.
Use this for showing types to the user where space is constrained (e.g. doc popups) Read more
sourcefn display_source_code<'a>(
&'a self,
db: &'a dyn HirDatabase,
module_id: ModuleId
) -> Result<String, DisplaySourceCodeError>
fn display_source_code<'a>(
&'a self,
db: &'a dyn HirDatabase,
module_id: ModuleId
) -> Result<String, DisplaySourceCodeError>
Returns a String representation of self
that can be inserted into the given module.
Use this when generating code (e.g. assists) Read more
sourcefn display_test<'a>(
&'a self,
db: &'a dyn HirDatabase
) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
fn display_test<'a>(
&'a self,
db: &'a dyn HirDatabase
) -> HirDisplayWrapper<'a, Self> where
Self: Sized,
Returns a String representation of self
for test purposes
sourceimpl TyExt for Ty
impl TyExt for Ty
fn is_unit(&self) -> bool
fn is_never(&self) -> bool
fn is_unknown(&self) -> bool
fn is_ty_var(&self) -> bool
fn as_adt(&self) -> Option<(AdtId, &Substitution)>
fn as_builtin(&self) -> Option<BuiltinType>
fn as_tuple(&self) -> Option<&Substitution>
fn as_fn_def(&self, db: &dyn HirDatabase) -> Option<FunctionId>
fn as_reference(&self) -> Option<(&Ty, Lifetime, 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 impl_trait_bounds(
&self,
db: &dyn HirDatabase
) -> Option<Vec<QuantifiedWhereClause>>
fn associated_type_parent_trait(&self, db: &dyn HirDatabase) -> Option<TraitId>
sourcefn equals_ctor(&self, other: &Ty) -> bool
fn equals_ctor(&self, other: &Ty) -> bool
FIXME: Get rid of this, it’s not a good abstraction