pub struct HirFormatter<'a, 'db> {
pub db: &'db dyn HirDatabase,
pub interner: DbInterner<'db>,
pub entity_limit: Option<usize>,
/* private fields */
}Fields§
§db: &'db dyn HirDatabaseThe database handle
interner: DbInterner<'db>§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<'db> HirFormatter<'_, 'db>
impl<'db> HirFormatter<'_, 'db>
pub fn krate(&self) -> Crate
pub fn edition(&self) -> Edition
pub fn lang_items(&self) -> &'db LangItems
pub fn write_joined<T: HirDisplay<'db>>( &mut self, iter: impl IntoIterator<Item = T>, sep: &str, ) -> Result
Sourcepub fn write_fmt(&mut self, args: Arguments<'_>) -> Result
pub fn write_fmt(&mut self, args: Arguments<'_>) -> Result
This allows using the write! macro directly with a HirFormatter.
pub fn write_str(&mut self, s: &str) -> Result
pub fn write_char(&mut self, c: char) -> Result
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, 'db> Freeze for HirFormatter<'a, 'db>
impl<'a, 'db> !RefUnwindSafe for HirFormatter<'a, 'db>
impl<'a, 'db> !Send for HirFormatter<'a, 'db>
impl<'a, 'db> !Sync for HirFormatter<'a, 'db>
impl<'a, 'db> Unpin for HirFormatter<'a, 'db>
impl<'a, 'db> !UnwindSafe for HirFormatter<'a, 'db>
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
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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