automata/fsevent/ast
Types
Kind of file-system entry held in a snapshot.
File, Directory, and Symlink are the only cases the differ
distinguishes. Differences other than kind (size, mtime, mode,
content hash) are interpreted as Write or Chmod; a change of
kind (file replaced by a directory, etc.) is reported as
Remove followed by Create for the new kind.
pub type EntryKind {
File
Directory
Symlink
}
Constructors
-
File -
Directory -
Symlink
Construction-time errors raised by the smart constructors in
automata/fsevent and friends.
Each variant carries enough structured context that an LLM or a human operator can understand the rejection without parsing prose.
pub type FseventError {
EmptyPath
PathContainsDotSegment(path: String, segment: String)
PathContainsNullByte(path: String)
DuplicatePath(path: String)
NegativeEntryField(field: String, actual: Int)
EntryFieldOverflow(field: String, actual: Int)
EmptyOptionalField(field: String)
EmptyOps
RenamedFromWithoutRenameOp(path: String)
}
Constructors
-
EmptyPathpath.normalizewas given an empty string. -
PathContainsDotSegment(path: String, segment: String)A path segment is the literal
.or... The differ does not resolve relative segments and refuses ambiguous input. -
PathContainsNullByte(path: String)A path contains a
\u{0000}byte; rejected to keep keys safe for use asDictkeys and string-rendered identifiers. -
DuplicatePath(path: String)Snapshot.from_entriesorSnapshot.add_entrysaw two entries with the same normalised path. -
NegativeEntryField(field: String, actual: Int)An
Entryfield was given a negative integer where a non-negative one is required. -
EntryFieldOverflow(field: String, actual: Int)An
Entrynumeric field exceededmax_safe_int(the limit JS can represent without precision loss). -
EmptyOptionalField(field: String)An optional
Entryfield (content_hash, file_id) was provided as an empty string. UseNoneinstead. -
EmptyOpsWatchEvent.multi_opwas called with an empty op set. -
RenamedFromWithoutRenameOp(path: String)WatchEvent.multi_opwas given arenamed_fromvalue but its op set does not includeRename.
File-system operation observed between two snapshots.
Mirrors Go fsnotify’s Op constants: a single high-level event may
carry several Op values at once (for example a freshly created
non-empty file is reported as Create together with Write). Kept
as a regular sum (not opaque) so callers can pattern-match on each
op individually and exhaustively.
pub type Op {
Create
Write
Remove
Rename
Chmod
}
Constructors
-
Create -
Write -
Remove -
Rename -
Chmod