conduit_cli/core/
events.rs1#[derive(Debug, Clone)]
2pub enum LogLevel {
3 Info,
4 Warning,
5 Error,
6 Chat,
7 Command,
8}
9
10#[derive(Debug, Clone)]
11pub enum CoreEvent {
12 Info(String),
13 Success(String),
14 Warning(String),
15 Error(String),
16 SecurityWarning(String),
17 Installed { slug: String, title: String },
18 AddedAsDependency { slug: String },
19 AlreadyInstalled { slug: String },
20 LinkedFile { filename: String },
21 Purged { slug: String },
22 ChatModeStarted { sender: String },
23 ChatModeStopped,
24 ChatMessageSent { sender: String, message: String },
25 ChatPromptRequested { sender: String },
26 ServerLogEvent { level: LogLevel, message: String, timestamp: String },
27 ServerStopEvent(String),
28 WorldPreparationStarted,
29 WorldPreparationProgress { percentage: u8 },
30 WorldPreparationFinished,
31 StartingServer,
32 TaskStarted(String),
33 TaskFinished,
34}
35
36#[derive(Debug, Clone)]
37pub struct DownloadProgress {
38 pub bytes_downloaded: u64,
39 pub total_bytes: Option<u64>,
40 pub filename: String,
41}
42
43pub trait CoreCallbacks {
44 fn on_event(&mut self, _event: CoreEvent) {}
45 fn on_download_progress(&mut self, _progress: DownloadProgress) {}
46}