Function elm_solve_deps::solver::solve_deps_with [−][src]
pub fn solve_deps_with<Fetch, L, Versions>(
project_elm_json: &ProjectConfig,
use_test: bool,
additional_constraints: &[(Pkg, Constraint)],
fetch_elm_json: Fetch,
list_available_versions: L
) -> Result<AppDependencies, PubGrubError<Pkg, SemVer>> where
Fetch: Fn(&Pkg, SemVer) -> Result<PackageConfig, Box<dyn Error>>,
L: Fn(&Pkg) -> Result<Versions, Box<dyn Error>>,
Versions: Iterator<Item = SemVer>,
Expand description
Advanced configurable function to solve dependencies of an elm project.
Set use_test
to true to include test dependencies in the resolution.
Additional dependencies can be specified for convenience when they are not specified directly in the project config, as follows.
let extra = &[(
Pkg::new("jfmengels", "elm-review"),
Constraint(Range::between( (2,6,1), (3,0,0) )),
)];
You are required to provide two functions,
namely fetch_elm_json
and list_available_versions
,
implementing the following pseudo trait bounds:
ⓘ
fetch_elm_json: Fn(&Pkg, SemVer) -> Result<PackageConfig, Error>
list_available_versions: Fn(&Pkg) -> Result<Iterator<SemVer>, Error>
It is up to you to figure out where to look for those config elm.json
and how to provide the list of existing versions.
Remark that the order in the versions iterator returned will correspond
to the prioritization for picking versions.
This means prioritizing newest or oldest versions is just a .reverse()
on your part.