This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
2024-12-12 01:07:40 -08:00

38 lines
784 B
Rust

use super::*;
mod usage; use usage::Usage;
mod device; use device::Device;
mod internal; use internal::Internal;
pub struct InputManager {
channel:Sender<Query>,
}
impl InputManager {
}
impl Subsystem for InputManager {
fn start(supervisor:Option<Sender<Query>>) -> Result<Sender<Query>, Error>
{
if let Some(supervisor) = supervisor {
let (tx, rx) = channel::bounded::<Query>(24);
let sys_tx = tx.clone();
std::thread::spawn(move || {
Internal::thread(supervisor, sys_tx, rx);
});
Ok(tx)
} else {
Err(Error::new())
}
}
}
impl From<Sender<Query>> for InputManager {
fn from(channel:Sender<Query>) -> Self {
Self { channel }
}
}