mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 13:21:38 +00:00
New Imfs event type
This commit is contained in:
parent
1737da9c1f
commit
694b6101ca
3 changed files with 49 additions and 25 deletions
|
|
@ -48,32 +48,17 @@ impl<F: ImfsFetcher> Imfs<F> {
|
|||
}
|
||||
|
||||
pub fn commit_change(&mut self, event: &ImfsEvent) -> FsResult<()> {
|
||||
use notify::DebouncedEvent::*;
|
||||
use ImfsEvent::*;
|
||||
|
||||
log::trace!("Committing Imfs change {:?}", event);
|
||||
|
||||
match event {
|
||||
Create(path) => {
|
||||
Created(path) | Modified(path) => {
|
||||
self.raise_file_changed(path)?;
|
||||
}
|
||||
Write(path) => {
|
||||
self.raise_file_changed(path)?;
|
||||
}
|
||||
Remove(path) => {
|
||||
Removed(path) => {
|
||||
self.raise_file_removed(path)?;
|
||||
}
|
||||
Rename(from_path, to_path) => {
|
||||
self.raise_file_removed(from_path)?;
|
||||
self.raise_file_changed(to_path)?;
|
||||
}
|
||||
Error(err, path) => {
|
||||
log::warn!("Filesystem error detected: {:?} on path {:?}", err, path);
|
||||
}
|
||||
Rescan => {
|
||||
// FIXME: Implement rescanning
|
||||
log::warn!("Unhandled filesystem rescan event");
|
||||
}
|
||||
NoticeWrite(_) | NoticeRemove(_) | Chmod(_) => {}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue