tek/input/src/lib.rs
2025-01-12 01:07:01 +01:00

34 lines
986 B
Rust

#![feature(associated_type_defaults)]
//mod component; pub use self::component::*;
mod input; pub use self::input::*;
mod handle; pub use self::handle::*;
mod command; pub use self::command::*;
mod event_map; pub use self::event_map::*;
mod edn_cmd; pub use self::edn_cmd::*;
pub(crate) use ::tek_edn::EdnItem;
/// Standard error trait.
pub(crate) use std::error::Error;
/// Standard result type.
pub(crate) type Usually<T> = Result<T, Box<dyn Error>>;
/// Standard optional result type.
pub(crate) type Perhaps<T> = Result<Option<T>, Box<dyn Error>>;
#[cfg(test)] #[test] fn test_stub_input () -> Usually<()> {
use crate::*;
struct TestInput(bool);
enum TestEvent { Test1 }
impl Input for TestInput {
type Event = TestEvent;
type Handled = ();
fn event (&self) -> &Self::Event {
&TestEvent::Test1
}
fn is_done (&self) -> bool {
self.0
}
fn done (&self) {}
}
Ok(())
}