use std::time::Duration;
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
pub enum RecursiveMode {
Recursive,
NonRecursive,
}
impl RecursiveMode {
pub(crate) fn is_recursive(&self) -> bool {
match *self {
RecursiveMode::Recursive => true,
RecursiveMode::NonRecursive => false,
}
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct Config {
poll_interval: Duration,
compare_contents: bool,
}
impl Config {
pub fn with_poll_interval(mut self, dur: Duration) -> Self {
self.poll_interval = dur;
self
}
pub fn poll_interval(&self) -> Duration {
self.poll_interval
}
pub fn with_compare_contents(mut self, compare_contents: bool) -> Self {
self.compare_contents = compare_contents;
self
}
pub fn compare_contents(&self) -> bool {
self.compare_contents
}
}
impl Default for Config {
fn default() -> Self {
Self {
poll_interval: Duration::from_secs(30),
compare_contents: false
}
}
}