use crate::matcher::{Match, MatchReceiver}; use crate::keyboard::KeyboardSender; use crate::config::Configs; pub struct Engine where S: KeyboardSender { sender: S, configs: Configs, } impl Engine where S: KeyboardSender{ pub fn new(sender: S, configs: Configs) -> Engine where S: KeyboardSender { Engine{sender, configs } } } impl MatchReceiver for Engine where S: KeyboardSender{ fn on_match(&self, m: &Match) { self.sender.delete_string(m.trigger.len() as i32); self.sender.send_string(m.replace.as_str()); } }