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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceFetchingService
impl RefUnwindSafe for ResourceFetchingService
impl Send for ResourceFetchingService
impl Sync for ResourceFetchingService
impl Unpin for ResourceFetchingService
impl UnwindSafe for ResourceFetchingService
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more