pub trait SourceProvider: Send + Sync {
// Required method
fn read(&self, path: &str) -> Option<Arc<str>>;
// Provided methods
fn prefetch(&self, _paths: &[String]) { ... }
fn clear_prefetch(&self) { ... }
}Expand description
Read a file’s source text on demand. Returns None if the path is
unreadable or doesn’t exist — the analyzer treats that as “this class is
unresolvable” and (negative-)caches the failure.
Required Methods§
Provided Methods§
Sourcefn prefetch(&self, _paths: &[String])
fn prefetch(&self, _paths: &[String])
Hint that paths will be read soon, so they may be fetched concurrently.
Sourcefn clear_prefetch(&self)
fn clear_prefetch(&self)
Drop hinted text that was never read.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".