pub struct TypeFormatter<'a> { /* private fields */ }Expand description
Context for generating type strings.
Implementations§
Source§impl<'a> TypeFormatter<'a>
impl<'a> TypeFormatter<'a>
pub fn new(interner: &'a dyn TypeDatabase) -> Self
Sourcepub fn with_symbols(
interner: &'a dyn TypeDatabase,
symbol_arena: &'a SymbolArena,
) -> Self
pub fn with_symbols( interner: &'a dyn TypeDatabase, symbol_arena: &'a SymbolArena, ) -> Self
Create a formatter with access to symbol names.
Sourcepub const fn with_def_store(self, def_store: &'a DefinitionStore) -> Self
pub const fn with_def_store(self, def_store: &'a DefinitionStore) -> Self
Add access to definition store for DefId name resolution.
pub const fn with_limits(self, max_depth: u32, max_union_members: usize) -> Self
Sourcepub fn render(&mut self, pending: &PendingDiagnostic) -> TypeDiagnostic
pub fn render(&mut self, pending: &PendingDiagnostic) -> TypeDiagnostic
Render a pending diagnostic to a complete diagnostic with formatted message.
This is where the lazy evaluation happens - we format types to strings only when the diagnostic is actually going to be displayed.
Auto Trait Implementations§
impl<'a> Freeze for TypeFormatter<'a>
impl<'a> !RefUnwindSafe for TypeFormatter<'a>
impl<'a> !Send for TypeFormatter<'a>
impl<'a> !Sync for TypeFormatter<'a>
impl<'a> Unpin for TypeFormatter<'a>
impl<'a> UnsafeUnpin for TypeFormatter<'a>
impl<'a> !UnwindSafe for TypeFormatter<'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