#![cfg_attr(target_os = "linux", doc = include_str!("../examples/stdin.rs"))]
#![doc(
html_logo_url = "https://libcala.github.io/logo.svg",
html_favicon_url = "https://libcala.github.io/icon.svg",
html_root_url = "https://docs.rs/smelling_salts"
)]
#![warn(
anonymous_parameters,
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
nonstandard_style,
rust_2018_idioms,
single_use_lifetimes,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unused_extern_crates,
unused_qualifications,
variant_size_differences
)]
mod device;
mod kind;
mod watch;
#[cfg_attr(target_os = "linux", path = "epoll.rs")]
#[cfg_attr(not(target_os = "linux"), path = "mock.rs")]
mod platform;
pub use self::{device::Device, kind::OsDevice, watch::Watch};
trait Interface {
const WATCH_INPUT: u32;
const WATCH_OUTPUT: u32;
fn watch(kind: &kind::DeviceKind, watch: Watch) -> whisk::Channel;
fn unwatch(kind: &kind::DeviceKind);
}
struct Platform;
impl Platform {
fn watch(kind: &kind::DeviceKind, watch: Watch) -> whisk::Channel {
<Platform as Interface>::watch(kind, watch)
}
fn unwatch(kind: &kind::DeviceKind) {
<Platform as Interface>::unwatch(kind);
}
}