pub struct ResourceFetchingService;Expand description
Service for fetching resource content and resolving paths.
Implementations§
Source§impl ResourceFetchingService
impl ResourceFetchingService
Sourcepub fn canonicalize_with_context(
path: &Path,
operation_desc: String,
caller: &str,
) -> Result<PathBuf>
pub fn canonicalize_with_context( path: &Path, operation_desc: String, caller: &str, ) -> Result<PathBuf>
Helper function to canonicalize a path with proper error context.
This function provides consistent error handling for path canonicalization operations throughout the resource service.
§Arguments
path- The path to canonicalizeoperation_desc- Description of the operation being performedcaller- The function name calling this helper
§Returns
The canonical path with structured error context on failure
Sourcepub async fn fetch_content(
core: &ResolutionCore,
dep: &ResourceDependency,
version_service: &VersionResolutionService,
) -> Result<String>
pub async fn fetch_content( core: &ResolutionCore, dep: &ResourceDependency, version_service: &VersionResolutionService, ) -> Result<String>
Fetch the content of a resource for metadata extraction.
This method retrieves the file content from either:
- Local filesystem (for path-only dependencies)
- Git worktree (for Git-backed dependencies with version)
This method can prepare versions on-demand if they haven’t been prepared yet, which is necessary for transitive dependencies discovered during resolution.
§Arguments
core- The resolution core with manifest and cachedep- The resource dependency to fetchversion_service- Version service to get/prepare worktree paths
§Returns
The file content as a string
Sourcepub async fn get_canonical_path(
core: &ResolutionCore,
dep: &ResourceDependency,
version_service: &VersionResolutionService,
) -> Result<PathBuf>
pub async fn get_canonical_path( core: &ResolutionCore, dep: &ResourceDependency, version_service: &VersionResolutionService, ) -> Result<PathBuf>
Get the canonical path for a dependency.
Resolves dependency path to its canonical form on the filesystem. Can prepare versions on-demand if needed.
§Arguments
core- The resolution core with manifest and cachedep- The resource dependencyversion_service- Version service to get/prepare worktree paths
§Returns
The canonical absolute path to the resource