minecraft_java_rs_core/launcher/events.rs
1/// All observable events emitted during a launch session.
2///
3/// Replaces the Node.js EventEmitter pattern. Callers receive a
4/// `tokio::sync::mpsc::Receiver<LaunchEvent>` and the library holds
5/// the matching `Sender`, cloning it into every sub-module that needs
6/// to report progress.
7#[derive(Debug, Clone)]
8pub enum LaunchEvent {
9 /// A batch of files is being downloaded.
10 /// `kind` identifies the category (e.g. "libraries", "assets", "java").
11 Progress {
12 downloaded: u64,
13 total: u64,
14 kind: String,
15 },
16
17 /// Current download speed in bytes per second.
18 Speed(f64),
19
20 /// Estimated seconds remaining for the current download batch.
21 Estimated(f64),
22
23 /// A bundle integrity check is in progress.
24 /// `kind` identifies the category being checked.
25 Check {
26 current: usize,
27 total: usize,
28 kind: String,
29 },
30
31 /// A file is being extracted from an archive. Carries the file name.
32 Extract(String),
33
34 /// A Forge processor is running. Carries the processor class name.
35 Patch(String),
36
37 /// All game files have been downloaded and verified.
38 GameDownloadFinished,
39
40 /// A line of stdout/stderr from the running Minecraft process.
41 Data(String),
42
43 /// The Minecraft process has exited. Carries the exit code.
44 Close(i32),
45
46 /// A non-fatal error message (fatal errors are returned as `Err`).
47 Error(String),
48}