Device

Trait Device 

Source
pub trait Device: Send {
    type Platform: Platform;

    // Required methods
    fn launch(&self) -> impl Future<Output = Result<()>> + Send;
    fn run(
        &self,
        artifact: Artifact,
        options: RunOptions,
    ) -> impl Future<Output = Result<Running, FailToRun>> + Send;
    fn platform(&self) -> Self::Platform;
}
Expand description

Trait representing a device (e.g., emulator, simulator, physical device)

Required Associated Types§

Source

type Platform: Platform

Associated platform type for the device.

Required Methods§

Source

fn launch(&self) -> impl Future<Output = Result<()>> + Send

Launch the device emulator or simulator.

If the device is a physical device, this should do nothing.

Source

fn run( &self, artifact: Artifact, options: RunOptions, ) -> impl Future<Output = Result<Running, FailToRun>> + Send

Run the given artifact on the device with the specified options.

Source

fn platform(&self) -> Self::Platform

Get the platform this device belongs to.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§