automata/fsevent/watch

Types

Subscription specification handed to diff/3.

opaque so the only way to construct a value is through the smart builder below, and so future fields (e.g. a path filter expressed as a list of normalised prefixes) can be added without a public API change. The watch holds a set of Op values that the caller is interested in; events whose op set has empty intersection with the watch are dropped before they reach the result list.

pub opaque type Watch

Values

pub fn unwatch_op(watch watch: Watch, op op: ast.Op) -> Watch

Remove a single op from watch’s mask. Idempotent.

pub fn watch() -> Watch

Default watch: subscribed to every op (Create, Write, Remove, Rename, Chmod).

pub fn watch_all_ops() -> Watch

Watch every op.

pub fn watch_is_silent(watch watch: Watch) -> Bool

True when watch’s op mask is empty.

pub fn watch_no_ops() -> Watch

Watch no op. The differ will return an empty list for any input.

pub fn watch_observes(watch watch: Watch, op op: ast.Op) -> Bool

True when watch is interested in op.

pub fn watch_op(watch watch: Watch, op op: ast.Op) -> Watch

Add a single op to watch’s mask. Idempotent.

pub fn watch_op_mask(watch watch: Watch) -> set.Set(ast.Op)

Recover the watch’s op mask.

pub fn with_ops(
  watch watch: Watch,
  ops ops: set.Set(ast.Op),
) -> Watch

Replace the op mask with the given set.

Search Document