pub struct VersionResolutionService { /* private fields */ }Expand description
Service for version resolution and worktree management.
Provides high-level orchestration for version constraint resolution, SHA resolution, and worktree preparation for Git-backed dependencies.
Implementations§
Source§impl VersionResolutionService
impl VersionResolutionService
Sourcepub fn new(cache: Cache) -> Self
pub fn new(cache: Cache) -> Self
Create a new version resolution service with default concurrency.
Sourcepub fn with_concurrency(cache: Cache, max_concurrency: usize) -> Self
pub fn with_concurrency(cache: Cache, max_concurrency: usize) -> Self
Create a new version resolution service with explicit concurrency limit.
Sourcepub async fn pre_sync_sources(
&self,
core: &ResolutionCore,
deps: &[(String, ResourceDependency)],
progress: Option<Arc<MultiPhaseProgress>>,
) -> Result<()>
pub async fn pre_sync_sources( &self, core: &ResolutionCore, deps: &[(String, ResourceDependency)], progress: Option<Arc<MultiPhaseProgress>>, ) -> Result<()>
Pre-sync all source repositories needed for dependencies.
This performs all Git network operations upfront:
- Clone/fetch source repositories
- Resolve version constraints to commit SHAs
- Create worktrees for resolved commits
§Arguments
core- The resolution core with cache and source managerdeps- All dependencies that need sources syncedprogress- Optional progress tracker for UI updates
Sourcepub fn get_prepared_version(
&self,
group_key: &str,
) -> Option<PreparedSourceVersion>
pub fn get_prepared_version( &self, group_key: &str, ) -> Option<PreparedSourceVersion>
Sourcepub fn prepared_versions(&self) -> &Arc<DashMap<String, PreparedVersionState>>
pub fn prepared_versions(&self) -> &Arc<DashMap<String, PreparedVersionState>>
Get the prepared versions map (raw state).
Returns a reference to the DashMap of prepared source version states.
Most callers should use prepared_versions_ready() instead.
Sourcepub fn prepared_versions_arc(
&self,
) -> Arc<DashMap<String, PreparedVersionState>>
pub fn prepared_versions_arc( &self, ) -> Arc<DashMap<String, PreparedVersionState>>
Get a clone of the prepared versions map Arc (raw state).
Returns a cloned Arc to the DashMap of prepared source version states.
Most callers should use prepared_versions_ready_arc() instead.
Sourcepub fn prepared_versions_ready(
&self,
) -> Arc<DashMap<String, PreparedSourceVersion>>
pub fn prepared_versions_ready( &self, ) -> Arc<DashMap<String, PreparedSourceVersion>>
Get a snapshot of only the Ready prepared versions.
Creates a new DashMap containing only versions that are Ready (not Preparing). This is safe for use by other code that doesn’t need to participate in the synchronization protocol.
Sourcepub fn prepared_versions_ready_arc(
&self,
) -> Arc<DashMap<String, PreparedSourceVersion>>
pub fn prepared_versions_ready_arc( &self, ) -> Arc<DashMap<String, PreparedSourceVersion>>
Get a snapshot Arc of only the Ready prepared versions.
Alias for prepared_versions_ready() for compatibility.
Sourcepub async fn get_or_prepare_version(
&self,
core: &ResolutionCore,
source_name: &str,
version: Option<&str>,
) -> Result<PreparedSourceVersion>
pub async fn get_or_prepare_version( &self, core: &ResolutionCore, source_name: &str, version: Option<&str>, ) -> Result<PreparedSourceVersion>
Get or prepare a version, coordinating concurrent requests.
This method ensures that only one task prepares a given version at a time. Other tasks requesting the same version will wait for the first task to complete. This prevents the race condition where multiple tasks simultaneously try to prepare the same version.
§Arguments
core- The resolution core with cache and source managersource_name- Name of the source repositoryversion- Optional version constraint (None = HEAD)
§Returns
The prepared version info with worktree path and resolved commit
Sourcepub async fn prepare_additional_version(
&self,
core: &ResolutionCore,
source_name: &str,
version: Option<&str>,
) -> Result<()>
pub async fn prepare_additional_version( &self, core: &ResolutionCore, source_name: &str, version: Option<&str>, ) -> Result<()>
Prepare an additional version on-demand without clearing existing ones.
This is a convenience wrapper around get_or_prepare_version that discards the result.
Prefer using get_or_prepare_version directly when you need the prepared version info.
§Arguments
core- The resolution core with cache and source managersource_name- Name of the source repositoryversion- Optional version constraint (None = HEAD)
Sourcepub async fn get_available_versions(
_core: &ResolutionCore,
repo_path: &Path,
) -> Result<Vec<String>>
pub async fn get_available_versions( _core: &ResolutionCore, repo_path: &Path, ) -> Result<Vec<String>>
Auto Trait Implementations§
impl Freeze for VersionResolutionService
impl !RefUnwindSafe for VersionResolutionService
impl Send for VersionResolutionService
impl Sync for VersionResolutionService
impl Unpin for VersionResolutionService
impl !UnwindSafe for VersionResolutionService
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