mod constructors;
mod helpers;
mod methods;
mod traits;
use notify::{Event, RecommendedWatcher};
use std::path::PathBuf;
use std::sync::mpsc::Receiver;
#[derive(Debug, Clone)]
pub struct GitWatchConfig {
pub debounce_ms: u64,
}
impl Default for GitWatchConfig {
fn default() -> Self {
Self { debounce_ms: 100 }
}
}
impl GitWatchConfig {
pub fn new() -> Self {
Self::default()
}
pub fn debounce_ms(mut self, ms: u64) -> Self {
self.debounce_ms = ms;
self
}
}
pub struct GitWatcher {
pub(crate) watcher: RecommendedWatcher,
pub(crate) rx: Receiver<Result<Event, notify::Error>>,
pub(crate) config: GitWatchConfig,
pub(crate) repo_path: Option<PathBuf>,
pub(crate) has_pending_changes: bool,
}