1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use std::path::Path;
use async_trait::async_trait;
use crate::package::Package;
use crate::version::Versioned;
#[async_trait]
pub trait PackageManager {
async fn read_package<T: AsRef<Path> + Send + Sync, V: Versioned + Send + Sync + 'static>(
&self,
crate_path: T,
) -> std::io::Result<Vec<Package<V>>>;
async fn run_build<T: AsRef<Path> + Send + Sync>(
&self,
crate_path: T,
build_args: Vec<String>,
) -> std::io::Result<()>;
async fn run_publish<T: AsRef<Path> + Send + Sync>(
&self,
crate_path: T,
publish_args: Vec<String>,
dry_run: bool,
) -> std::io::Result<()>;
async fn apply_version<T: AsRef<Path> + Send + Sync>(
&self,
crate_path: T,
version: &str,
) -> std::io::Result<()>;
async fn apply_dependency_version<T: AsRef<Path> + Send + Sync>(
&self,
crate_path: T,
name: &str,
version: &str,
) -> std::io::Result<()>;
}