cobble_core/minecraft/launch/detached_launch/
mod.rs1#[cfg(unix)]
2mod unix;
3#[cfg(windows)]
4mod windows;
5
6#[cfg(unix)]
7pub use unix::GameProcessHandle;
8
9#[cfg(windows)]
10pub use windows::GameProcessHandle;
11
12use crate::error::LaunchResult;
13use async_trait::async_trait;
14use std::process::Command;
15
16#[async_trait]
18pub trait GameProcess {
19 fn launch(command: Command) -> LaunchResult<Self>
21 where
22 Self: Sized;
23 async fn stop(&self) -> LaunchResult<()>;
25 async fn wait(&self) -> LaunchResult<()>;
27 async fn is_stopped(&self) -> LaunchResult<bool>;
29 fn is_stopped_blocking(&self) -> LaunchResult<bool>;
31}