pub enum FileEvent {
Created(PathBuf),
Modified(PathBuf),
Deleted(PathBuf),
Renamed {
from: PathBuf,
to: PathBuf,
},
Accessed(PathBuf),
Other {
kind: String,
paths: Vec<PathBuf>,
},
}Expand description
文件系统事件
Variants§
Created(PathBuf)
文件/目录创建
Modified(PathBuf)
文件修改
Deleted(PathBuf)
文件/目录删除
Renamed
文件/目录重命名(旧路径,新路径)
Accessed(PathBuf)
访问(读取)
Other
其他事件
Implementations§
Source§impl FileEvent
impl FileEvent
Sourcepub fn from_notify(event: NotifyEvent) -> Option<Self>
pub fn from_notify(event: NotifyEvent) -> Option<Self>
从 notify 事件转换
Sourcepub fn is_created(&self) -> bool
pub fn is_created(&self) -> bool
检查是否是创建事件
Sourcepub fn is_modified(&self) -> bool
pub fn is_modified(&self) -> bool
检查是否是修改事件
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
检查是否是删除事件
Sourcepub fn is_renamed(&self) -> bool
pub fn is_renamed(&self) -> bool
检查是否是重命名事件
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileEvent
impl RefUnwindSafe for FileEvent
impl Send for FileEvent
impl Sync for FileEvent
impl Unpin for FileEvent
impl UnwindSafe for FileEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more