pub trait RootResolver {
// Required method
fn resolve_package_root(&self, pkg: &PackageSpec) -> FileResult<ImmutPath>;
// Provided methods
fn path_for_id(&self, file_id: FileId) -> FileResult<PathResolution> { ... }
fn resolve_root(&self, file_id: FileId) -> FileResult<Option<ImmutPath>> { ... }
}
Expand description
Trait for resolving file paths and roots for different types of files.
Required Methods§
Sourcefn resolve_package_root(&self, pkg: &PackageSpec) -> FileResult<ImmutPath>
fn resolve_package_root(&self, pkg: &PackageSpec) -> FileResult<ImmutPath>
Resolves the root path for a given package specification.
Provided Methods§
Sourcefn path_for_id(&self, file_id: FileId) -> FileResult<PathResolution>
fn path_for_id(&self, file_id: FileId) -> FileResult<PathResolution>
Resolves a file ID to its corresponding path resolution.
Sourcefn resolve_root(&self, file_id: FileId) -> FileResult<Option<ImmutPath>>
fn resolve_root(&self, file_id: FileId) -> FileResult<Option<ImmutPath>>
Resolves the root path for a given file ID.