adjust error handling

This commit is contained in:
Ferdinand Schober
2024-07-04 23:31:34 +02:00
committed by Ferdinand Schober
parent 37a8f729ea
commit ef3ebc59bd
11 changed files with 135 additions and 97 deletions

View File

@@ -1,6 +1,8 @@
use async_trait::async_trait;
use input_event::Event;
use crate::error::EmulationError;
use super::{EmulationHandle, InputEmulation};
#[derive(Default)]
@@ -14,8 +16,13 @@ impl DummyEmulation {
#[async_trait]
impl InputEmulation for DummyEmulation {
async fn consume(&mut self, event: Event, client_handle: EmulationHandle) {
async fn consume(
&mut self,
event: Event,
client_handle: EmulationHandle,
) -> Result<(), EmulationError> {
log::info!("received event: ({client_handle}) {event}");
Ok(())
}
async fn create(&mut self, _: EmulationHandle) {}
async fn destroy(&mut self, _: EmulationHandle) {}