Skip to main content

conduit_cli/core/
events.rs

1#[derive(Debug, Clone)]
2pub enum CoreEvent {
3    Info(String),
4    Warning(String),
5    Installed { slug: String, title: String },
6    AddedAsDependency { slug: String },
7    AlreadyInstalled { slug: String },
8    LinkedFile { filename: String },
9    Purged { slug: String },
10    TaskStarted(String),
11    TaskFinished,
12}
13
14#[derive(Debug, Clone)]
15pub struct DownloadProgress {
16    pub bytes_downloaded: u64,
17    pub total_bytes: Option<u64>,
18    pub filename: String,
19}
20
21pub trait CoreCallbacks {
22    fn on_event(&mut self, _event: CoreEvent) {}
23    fn on_download_progress(&mut self, _progress: DownloadProgress) {}
24}