Files
swift-inotify/Sources/Inotify/InotifyEvent.swift
T
T. R. Bernstein 3c852a565c Deliver an event enum with the queue overflow as its own case
The stream's element is now the enum InotifyEvent, and the struct that
describes a change to a watched item is FileSystemEvent. A queue
overflow was an event with descriptor -1 and an empty path that every
consumer had to know about; as a case, the compiler makes them handle
it. The enum is also where failed watches of a growing tree will be
reported, since no call site can catch them.
2026-09-19 00:10:35 +02:00

10 lines
419 B
Swift

/// What an ``Inotify`` instance delivers: a change to a watched item, or a
/// condition that affects which changes it can deliver.
public enum InotifyEvent: Sendable, Hashable {
/// A change to a watched file or directory.
case fileSystem(FileSystemEvent)
/// The kernel's event queue was full, so it dropped events. Consumers
/// that must not miss changes should rescan the watched trees.
case queueOverflow
}