pub enum FsEvent {
DirLoaded {
id: NodeId,
entries: Vec<DirEntryInfo>,
},
DirFailed {
id: NodeId,
error: FsError,
},
Changed(Vec<PathBuf>),
MutationFailed(FsError),
FileLoaded {
buffer: BufferId,
path: PathBuf,
contents: Vec<u8>,
},
FileSaved {
buffer: BufferId,
version: u64,
},
FileFailed {
buffer: BufferId,
error: FsError,
},
PreviewLoaded {
request: PreviewRequestId,
path: PathBuf,
start_line: usize,
text: String,
},
PreviewFailed {
request: PreviewRequestId,
path: PathBuf,
error: FsError,
},
PathResolved {
request: LocationRequestId,
path: PathBuf,
},
PathResolveFailed {
request: LocationRequestId,
path: PathBuf,
error: FsError,
},
}Expand description
Results sent back from the filesystem worker into the state loop.
Exhaustive for the same reason as FsRequest.
Variants§
DirLoaded
DirFailed
Changed(Vec<PathBuf>)
A watched directory changed on disk and should be re-read. Paths, not ids, because the watcher knows nothing about the tree’s identity scheme.
Successful mutations report themselves this way too, so there is exactly one path that brings disk state back into the tree whether or not a watcher is running.
MutationFailed(FsError)
A create/rename/delete failed. Success needs no event — it arrives as Changed.
FileLoaded
A file was read for a buffer being opened. Bytes, not text: decoding is the
editor’s decision, and core stays out of it.
FileSaved
A buffer was written to disk at revision version.
FileFailed
A read or write for a specific buffer failed. Distinct from Self::MutationFailed
because it has a buffer to report against, not just a path.