automata/fsevent/entry

Types

One file-system entry observed at a single point in time.

opaque so the only way to construct a value is through the validating smart constructors entry_file, entry_directory, entry_symlink. They reject negative integers, integers above the JS-safe range, and empty optional strings before a snapshot is built. Differences detected later by the differ therefore reflect the inputs the caller intended, not silently truncated data.

mtime is unit-less: pick seconds, milliseconds, microseconds, nanoseconds, or anything else, and use the same unit consistently across snapshots that you intend to compare. The differ only ever checks prev.mtime != curr.mtime. Values must fit within max_safe_int (JS Number.MAX_SAFE_INTEGER) so the same equality check produces the same answer on both the BEAM and JS targets.

pub opaque type Entry

Values

pub fn entry_content_hash(
  entry entry: Entry,
) -> option.Option(String)
pub fn entry_directory(
  path path: path.NormalizedPath,
  mtime mtime: Int,
  mode mode: Int,
  file_id file_id: option.Option(String),
) -> Result(Entry, ast.FseventError)

Build a Directory entry. Directories have no meaningful size (the differ never compares size for directories), so the field is stored as 0.

pub fn entry_file(
  path path: path.NormalizedPath,
  size size: Int,
  mtime mtime: Int,
  mode mode: Int,
  content_hash content_hash: option.Option(String),
  file_id file_id: option.Option(String),
) -> Result(Entry, ast.FseventError)

Build a File entry. content_hash and file_id are optional; if provided as Some(_), an empty string is rejected.

pub fn entry_file_id(entry entry: Entry) -> option.Option(String)
pub fn entry_kind(entry entry: Entry) -> ast.EntryKind
pub fn entry_mode(entry entry: Entry) -> Int
pub fn entry_mtime(entry entry: Entry) -> Int
pub fn entry_path(entry entry: Entry) -> path.NormalizedPath
pub fn entry_size(entry entry: Entry) -> Int
pub fn entry_symlink(
  path path: path.NormalizedPath,
  mtime mtime: Int,
  mode mode: Int,
  file_id file_id: option.Option(String),
) -> Result(Entry, ast.FseventError)

Build a Symlink entry. Like directories, symlinks carry no meaningful size for diffing purposes.

Search Document