Trait ra_ap_hir::HirDisplay [−][src]
pub trait HirDisplay { fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError>; fn into_displayable(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget
) -> HirDisplayWrapper<'a, Self> { ... } fn display(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> HirDisplayWrapper<'a, Self> { ... } fn display_truncated(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self> { ... } fn display_source_code(
&'a self,
db: &'a (dyn HirDatabase + 'a),
module_id: ModuleId
) -> Result<String, DisplaySourceCodeError> { ... } fn display_test(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> HirDisplayWrapper<'a, Self> { ... } }
Required methods
fn hir_fmt(&self, f: &mut HirFormatter<'_>) -> Result<(), HirDisplayError>
Provided methods
fn into_displayable(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget
) -> HirDisplayWrapper<'a, Self>
fn into_displayable(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>,
omit_verbose_types: bool,
display_target: DisplayTarget
) -> HirDisplayWrapper<'a, Self>
Returns a Display
able type that is human-readable.
fn display(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> HirDisplayWrapper<'a, Self>
fn display(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> HirDisplayWrapper<'a, Self>
Returns a Display
able type that is human-readable.
Use this for showing types to the user (e.g. diagnostics)
fn display_truncated(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self>
fn display_truncated(
&'a self,
db: &'a (dyn HirDatabase + 'a),
max_size: Option<usize>
) -> HirDisplayWrapper<'a, Self>
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)
fn display_source_code(
&'a self,
db: &'a (dyn HirDatabase + 'a),
module_id: ModuleId
) -> Result<String, DisplaySourceCodeError>
fn display_source_code(
&'a self,
db: &'a (dyn HirDatabase + 'a),
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)
fn display_test(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> HirDisplayWrapper<'a, Self>
fn display_test(
&'a self,
db: &'a (dyn HirDatabase + 'a)
) -> HirDisplayWrapper<'a, Self>
Returns a String representation of self
for test purposes