ketcindyinstaller/
package.rs1use std::path::PathBuf;
2
3#[derive(Debug, PartialEq, Clone, Copy, strum::Display)]
4pub(crate) enum PackageKind {
5 KeTCindy,
6 Cinderella,
7 R,
8 Maxima,
9}
10
11#[derive(Clone)]
12pub(crate) enum PackageState {
13 Initialized,
14 Fetching,
15 Fetched {
16 versions: Vec<String>,
17 selected_index: Option<usize>,
18 },
19 Downloading {
20 progress: f32,
21 },
22 Downloaded {
23 path: PathBuf,
24 },
25 Installing,
26 Installed,
27 Error(String),
28}
29
30#[derive(Clone)]
31pub(crate) struct Package {
32 pub(crate) kind: PackageKind,
33 pub(crate) state: PackageState,
34}
35
36impl Package {
37 pub(crate) fn new(kind: PackageKind) -> Self {
38 Self {
39 kind: kind,
40 state: PackageState::Initialized,
41 }
42 }
43}