Skip to main content

wdl_modules/resolver/
scope.rs

1//! Dependency scope types for the resolver.
2
3/// Whether a dependency is declared directly by the consumer or
4/// reached transitively through another dependency.
5#[derive(Clone, Copy, Debug, Eq, PartialEq)]
6pub enum DependencyScope {
7    /// Declared in the consumer's own `module.json`.
8    TopLevel,
9    /// Reached through a transitive dependency chain.
10    Transitive,
11}
12
13/// Whether to resolve mutable selectors against the remote or replay
14/// a locked commit.
15#[cfg(feature = "git-resolver")]
16#[derive(Clone, Copy, Debug, Eq, PartialEq)]
17pub enum ResolutionMode<'a> {
18    /// Resolve mutable selectors against the remote. Used by
19    /// `resolve_tree` when computing a fresh dependency graph.
20    Fresh,
21    /// Replay the locked commit from the lockfile. Used by
22    /// `materialize` when reproducing a previously-locked dependency.
23    Locked {
24        /// The lockfile path that contains the dependency entry.
25        lockfile_scope: &'a [crate::dependency::DependencyName],
26    },
27}