pub enum SourceProvider<'a> {
Eager(&'a HashMap<String, Arc<String>>),
Lazy(&'a HashMap<String, PathBuf>),
}Expand description
How the diagnostic layer fetches a file’s source text (by its cache-key path) when building rustc-style help/suggestions. The batch path keeps every source in memory; the streaming path keeps only the on-disk paths and re-reads the handful of files that actually produce a warning — so the ~4 MB of source text isn’t resident through the compile’s peak. Cheap to copy (just borrows).
Variants§
Eager(&'a HashMap<String, Arc<String>>)
Sources already resident, keyed by cache key.
Lazy(&'a HashMap<String, PathBuf>)
Cache key → on-disk path; re-read on demand.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for SourceProvider<'a>
impl<'a> Clone for SourceProvider<'a>
impl<'a> Copy for SourceProvider<'a>
Auto Trait Implementations§
impl<'a> Forget for SourceProvider<'a>
impl<'a> Freeze for SourceProvider<'a>
impl<'a> Move for SourceProvider<'a>
impl<'a> RefUnwindSafe for SourceProvider<'a>
impl<'a> Send for SourceProvider<'a>
impl<'a> Sync for SourceProvider<'a>
impl<'a> Unpin for SourceProvider<'a>
impl<'a> UnsafeUnpin for SourceProvider<'a>
impl<'a> UnwindSafe for SourceProvider<'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