Skip to main content

GameProcess

Trait GameProcess 

Source
pub trait GameProcess {
    // Required methods
    fn launch(command: Command) -> LaunchResult<Self>
       where Self: Sized;
    fn stop<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = LaunchResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn wait<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = LaunchResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_stopped<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = LaunchResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_stopped_blocking(&self) -> LaunchResult<bool>;
}
Expand description

Trait for game handles to provide the same API on all platforms.

Required Methods§

Source

fn launch(command: Command) -> LaunchResult<Self>
where Self: Sized,

Should launch the game in a detached state.

Source

fn stop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = LaunchResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Should stop the game.

Source

fn wait<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = LaunchResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Should wait until the game has exited.

Source

fn is_stopped<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = LaunchResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Should check whether the game is still running.

Source

fn is_stopped_blocking(&self) -> LaunchResult<bool>

Should check whether the game is still running.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl GameProcess for GameProcessHandle

Available on Unix only.