Skip to main content

event_should_propagate

Function event_should_propagate 

Source
pub const fn event_should_propagate(kind: &EventKind) -> bool
Expand description

Returns whether a notify event represents a real change.

We deliberately ignore [EventKind::Access] and [EventKind::Other] (mount/unmount on macOS, access-time bumps on Linux); those don’t change file content and rebuilding for them is wasted work.

§Examples

use notify::{EventKind, event::ModifyKind};
use ssg::event_watch::event_should_propagate;
assert!(event_should_propagate(&EventKind::Modify(ModifyKind::Any)));
assert!(!event_should_propagate(&EventKind::Other));