pub struct SkillWatcher { /* private fields */ }Expand description
Background watcher for a skill directory.
Uses the OS-native FS notification API (kqueue on macOS, inotify on Linux).
Callers snapshot version() at the start of each SM iteration and re-scan
the directory whenever the value has changed — no polling thread needed.
Implementations§
Source§impl SkillWatcher
impl SkillWatcher
Sourcepub fn start(dir: &Path) -> Option<Self>
pub fn start(dir: &Path) -> Option<Self>
Start watching dir. Returns None if the path doesn’t exist or the
OS watcher cannot be created (e.g. unavailable on this platform).
Sourcepub fn version(&self) -> u64
pub fn version(&self) -> u64
Monotonically-increasing counter; increments whenever a .md, .json,
or .py file in the watched directory is created, modified, or removed.
Callers should snapshot this at the start of each loop iteration and compare against the previous snapshot; a change means the skill catalog should be refreshed.
Auto Trait Implementations§
impl Freeze for SkillWatcher
impl RefUnwindSafe for SkillWatcher
impl Send for SkillWatcher
impl Sync for SkillWatcher
impl Unpin for SkillWatcher
impl UnsafeUnpin for SkillWatcher
impl UnwindSafe for SkillWatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more