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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
//! ref: composer/src/Composer/Downloader/DownloaderInterface.php
use shirabe_external_packages::react::promise::promise_interface::PromiseInterface;
use crate::package::package_interface::PackageInterface;
pub trait DownloaderInterface {
fn get_installation_source(&self) -> String;
fn download(
&self,
package: &dyn PackageInterface,
path: &str,
prev_package: Option<&dyn PackageInterface>,
output: bool,
) -> anyhow::Result<Box<dyn PromiseInterface>>;
fn prepare(
&self,
r#type: &str,
package: &dyn PackageInterface,
path: &str,
prev_package: Option<&dyn PackageInterface>,
) -> anyhow::Result<Box<dyn PromiseInterface>>;
fn install(
&self,
package: &dyn PackageInterface,
path: &str,
output: bool,
) -> anyhow::Result<Box<dyn PromiseInterface>>;
fn update(
&self,
initial: &dyn PackageInterface,
target: &dyn PackageInterface,
path: &str,
) -> anyhow::Result<Box<dyn PromiseInterface>>;
fn remove(
&self,
package: &dyn PackageInterface,
path: &str,
output: bool,
) -> anyhow::Result<Box<dyn PromiseInterface>>;
fn cleanup(
&self,
r#type: &str,
package: &dyn PackageInterface,
path: &str,
prev_package: Option<&dyn PackageInterface>,
) -> anyhow::Result<Box<dyn PromiseInterface>>;
}
|