Struct hir_ty::display::HirFormatter
source · pub struct HirFormatter<'a> {
pub db: &'a dyn HirDatabase,
pub entity_limit: Option<usize>,
/* private fields */
}
Fields§
§db: &'a dyn HirDatabase
The database handle
entity_limit: Option<usize>
When rendering something that has a concept of “children” (like fields in a struct), this limits how many should be rendered.
Implementations§
source§impl HirFormatter<'_>
impl HirFormatter<'_>
pub fn edition(&self) -> Edition
pub fn write_joined<T: HirDisplay>( &mut self, iter: impl IntoIterator<Item = T>, sep: &str, ) -> Result<(), HirDisplayError>
sourcepub fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), HirDisplayError>
pub fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), HirDisplayError>
This allows using the write!
macro directly with a HirFormatter
.
pub fn write_str(&mut self, s: &str) -> Result<(), HirDisplayError>
pub fn write_char(&mut self, c: char) -> Result<(), HirDisplayError>
pub fn should_truncate(&self) -> bool
pub fn omit_verbose_types(&self) -> bool
pub fn show_container_bounds(&self) -> bool
Auto Trait Implementations§
impl<'a> Freeze for HirFormatter<'a>
impl<'a> !RefUnwindSafe for HirFormatter<'a>
impl<'a> !Send for HirFormatter<'a>
impl<'a> !Sync for HirFormatter<'a>
impl<'a> Unpin for HirFormatter<'a>
impl<'a> !UnwindSafe for HirFormatter<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more