pub trait SourceProvider {
// Required methods
fn get(&self, id: SourceId) -> Option<Source<'_>>;
fn line_column(&self, id: SourceId, offset: u32) -> Option<LineColumn>;
// Provided methods
fn find_by_name(&self, _display_name: &str) -> Option<SourceId> { ... }
fn offset_of(&self, _id: SourceId, _position: LineColumn) -> Option<u32> { ... }
}Expand description
Resolves one source universe by namespaced source ID.
Required Methods§
fn get(&self, id: SourceId) -> Option<Source<'_>>
fn line_column(&self, id: SourceId, offset: u32) -> Option<LineColumn>
Provided Methods§
Sourcefn find_by_name(&self, _display_name: &str) -> Option<SourceId>
fn find_by_name(&self, _display_name: &str) -> Option<SourceId>
Returns the most recently registered source with the given display name, if supported.
Display names are not required to be unique. Providers which do not maintain a reverse index may leave this operation unsupported.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".