refactor error types

This commit is contained in:
Ferdinand Schober
2024-06-30 19:35:34 +02:00
parent 9cbe1ed8d8
commit 2ac193a5b2
7 changed files with 71 additions and 59 deletions

View File

@@ -27,6 +27,7 @@ pub mod macos;
/// fallback input emulation (logs events)
pub mod dummy;
pub mod error;
#[async_trait]
pub trait InputEmulation: Send {
@@ -41,7 +42,7 @@ pub trait InputEmulation: Send {
async fn destroy(&mut self);
}
pub async fn create() -> Box<dyn InputEmulation> {
pub async fn create(backend: Option<EmulationBackend>) -> Box<dyn InputEmulation> {
#[cfg(windows)]
match windows::WindowsEmulation::new() {
Ok(c) => return Box::new(c),