Trait ra_ap_hir::HirDisplay

source ·
pub trait HirDisplay {
    // Required method
    fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError>;

    // Provided methods
    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 { ... }
    fn display<'a>(
        &'a self,
        db: &'a dyn HirDatabase
    ) -> 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 { ... }
    fn display_limited<'a>(
        &'a self,
        db: &'a dyn HirDatabase,
        limited_size: Option<usize>
    ) -> HirDisplayWrapper<'a, Self>
       where Self: Sized { ... }
    fn display_source_code<'a>(
        &'a self,
        db: &'a dyn HirDatabase,
        module_id: ModuleId,
        allow_opaque: bool
    ) -> Result<String, DisplaySourceCodeError> { ... }
    fn display_test<'a>(
        &'a self,
        db: &'a dyn HirDatabase
    ) -> HirDisplayWrapper<'a, Self>
       where Self: Sized { ... }
}

Required Methods§

source

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

Provided Methods§

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

Implementations on Foreign Types§

source§

impl HirDisplay for DomainGoal<Interner>

source§

impl HirDisplay for LifetimeData<Interner>

source§

impl HirDisplay for WhereClause<Interner>

source§

impl HirDisplay for TypeBound

source§

impl HirDisplay for GenericArg

source§

impl HirDisplay for Path

source§

impl HirDisplay for BoundVar

source§

impl HirDisplay for Const<Interner>

source§

impl HirDisplay for GenericArg<Interner>

source§

impl HirDisplay for Lifetime<Interner>

source§

impl HirDisplay for LifetimeOutlives<Interner>

source§

impl HirDisplay for OpaqueTy<Interner>

source§

impl HirDisplay for ProjectionTy<Interner>

source§

impl HirDisplay for TraitRef<Interner>

source§

impl HirDisplay for Ty<Interner>

source§

impl<T> HirDisplay for &T
where T: HirDisplay,

source§

impl<T> HirDisplay for Interned<T>

Implementors§