pub use detector::{Detector, State};
pub use error::{Error, ErrorKind};
pub use interface_snapshot::InterfaceSnapshot;
pub use platform::Platform;
pub use watcher::{
r#impl::{Watcher, WatcherHandler},
types::{FileData, Snapshot},
};
mod detector;
mod error;
mod interface_snapshot;
mod platform;
mod watcher;
pub async fn make_watcher<T>(
platform: &str,
poll_interval: u64,
handler: T,
) -> Result<Watcher<T>, Error>
where
T: WatcherHandler,
{
let pval = Platform::from_string(platform)?;
let retval = Watcher::new(pval, poll_interval, handler).await?;
Ok(retval)
}