Type Alias hir_ty::Ty

source ·
pub type Ty = Ty<Interner>;

Aliased Type§

struct Ty { /* private fields */ }

Trait Implementations§

source§

impl HirDisplay for Ty

source§

fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError>

source§

fn into_displayable<'a>( &'a self, db: &'a dyn HirDatabase, max_size: Option<usize>, limited_size: Option<usize>, omit_verbose_types: bool, display_target: DisplayTarget, closure_style: ClosureStyle ) -> HirDisplayWrapper<'a, Self>
where Self: Sized,

Returns a Displayable type that is human-readable.
source§

fn display<'a>(&'a self, db: &'a dyn HirDatabase) -> HirDisplayWrapper<'a, Self>
where Self: Sized,

Returns a Displayable type that is human-readable. Use this for showing types to the user (e.g. diagnostics)
source§

fn display_truncated<'a>( &'a self, db: &'a dyn HirDatabase, max_size: Option<usize> ) -> HirDisplayWrapper<'a, Self>
where Self: Sized,

Returns a Displayable 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)
source§

fn display_limited<'a>( &'a self, db: &'a dyn HirDatabase, limited_size: Option<usize> ) -> HirDisplayWrapper<'a, Self>
where Self: Sized,

Returns a Displayable type that is human-readable and tries to limit the number of items inside. Use this for showing definitions which may contain too many items, like trait, struct, enum
source§

fn display_source_code<'a>( &'a self, db: &'a dyn HirDatabase, module_id: ModuleId, allow_opaque: bool ) -> 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)
source§

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
source§

impl TyExt for Ty

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 dyn_trait(&self) -> Option<TraitId>

If this is a dyn Trait, returns that trait.
source§

fn strip_references(&self) -> &Ty

source§

fn strip_reference(&self) -> &Ty

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