DependencyResolver

Struct DependencyResolver 

Source
pub struct DependencyResolver { /* private fields */ }
Expand description

Main dependency resolver with service-based architecture.

This orchestrates multiple specialized services to handle different aspects of the dependency resolution process while maintaining compatibility with existing interfaces.

Implementations§

Source§

impl DependencyResolver

Source

pub async fn new(manifest: Manifest, cache: Cache) -> Result<Self>

Create a new dependency resolver.

§Arguments
  • manifest - Project manifest with dependencies
  • cache - Cache for Git operations and worktrees
§Errors

Returns an error if source manager cannot be created

Source

pub async fn new_with_context( manifest: Manifest, cache: Cache, operation_context: Option<Arc<OperationContext>>, ) -> Result<Self>

Create a new dependency resolver with operation context.

§Arguments
  • manifest - Project manifest with dependencies
  • cache - Cache for Git operations and worktrees
  • operation_context - Optional context for warning deduplication
§Errors

Returns an error if source manager cannot be created

Source

pub async fn new_with_global(manifest: Manifest, cache: Cache) -> Result<Self>

Create a new resolver with global configuration support.

This loads both manifest sources and global sources from ~/.agpm/config.toml.

§Arguments
  • manifest - Project manifest with dependencies
  • cache - Cache for Git operations and worktrees
§Errors

Returns an error if global configuration cannot be loaded

Source

pub async fn with_cache(manifest: Manifest, cache: Cache) -> Result<Self>

Creates a new dependency resolver with custom cache directory.

§Arguments
  • cache - Cache for Git operations and worktrees
§Errors

Returns an error if source manager cannot be created

Source

pub async fn new_with_global_context( manifest: Manifest, cache: Cache, _operation_context: Option<Arc<OperationContext>>, ) -> Result<Self>

Create a new resolver with global configuration and operation context.

This loads both manifest sources and global sources from ~/.agpm/config.toml.

§Arguments
  • manifest - Project manifest with dependencies
  • cache - Cache for Git operations and worktrees
  • operation_context - Optional context for warning deduplication
§Errors

Returns an error if global configuration cannot be loaded

Source

pub fn core(&self) -> &ResolutionCore

Get a reference to the resolution core.

Source

pub async fn resolve(&mut self) -> Result<LockFile>

Resolve all dependencies and generate a complete lockfile.

This is the main resolution method.

§Errors

Returns an error if any step of resolution fails

Source

pub async fn resolve_with_options( &mut self, enable_transitive: bool, ) -> Result<LockFile>

Resolve dependencies with transitive resolution option.

§Arguments
  • enable_transitive - Whether to resolve transitive dependencies
§Errors

Returns an error if resolution fails

Source

pub async fn pre_sync_sources( &mut self, deps: &[(String, ResourceDependency)], ) -> Result<()>

Pre-sync sources for the given dependencies.

This performs Git operations to ensure all required sources are available before the main resolution process begins.

§Arguments
  • deps - List of (name, dependency) pairs to sync sources for
§Errors

Returns an error if source synchronization fails

Source

pub async fn update( &mut self, existing: &LockFile, deps_to_update: Option<Vec<String>>, ) -> Result<LockFile>

Update dependencies with existing lockfile and specific dependencies to update.

§Arguments
  • existing - Existing lockfile to update
  • deps_to_update - Optional specific dependency names to update (None = all)
§Errors

Returns an error if update process fails

Source

pub async fn get_available_versions( &self, repo_path: &Path, ) -> Result<Vec<String>>

Get available versions for a repository.

§Arguments
  • repo_path - Path to the Git repository
§Returns

List of available version strings (tags and branches)

Source

pub async fn verify(&self, _lockfile: &LockFile) -> Result<()>

Verify that existing lockfile is still valid.

§Arguments
  • _lockfile - Existing lockfile to verify
§Errors

Returns an error if verification fails

Source

pub fn operation_context(&self) -> Option<&Arc<OperationContext>>

Get current operation context if available.

Source

pub fn set_operation_context(&mut self, context: Arc<OperationContext>)

Set the operation context for warning deduplication.

§Arguments
  • context - The operation context to use

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,