pub enum FileOperationEvent {
Created {
path: PathBuf,
size: u64,
timestamp: SystemTime,
},
Modified {
path: PathBuf,
old_hash: String,
new_hash: String,
timestamp: SystemTime,
},
Deleted {
path: PathBuf,
timestamp: SystemTime,
},
Renamed {
old_path: PathBuf,
new_path: PathBuf,
timestamp: SystemTime,
},
Moved {
old_path: PathBuf,
new_path: PathBuf,
timestamp: SystemTime,
},
Read {
path: PathBuf,
timestamp: SystemTime,
},
}Expand description
File operation event types
Represents different types of file system operations that can trigger hooks. Each variant includes relevant metadata for the operation.
§Variants
Created- File was createdModified- File was modifiedDeleted- File was deletedRenamed- File was renamedMoved- File was moved to a different directoryRead- File was read
Variants§
Created
File was created
§Fields
path- Path to the created filesize- Size of the file in bytestimestamp- Time when the file was created
Fields
§
timestamp: SystemTimeTimestamp of the operation
Modified
File was modified
§Fields
path- Path to the modified fileold_hash- Hash of the file before modificationnew_hash- Hash of the file after modificationtimestamp- Time when the file was modified
Fields
§
timestamp: SystemTimeTimestamp of the operation
Deleted
Renamed
File was renamed
§Fields
old_path- Original path of the filenew_path- New path of the filetimestamp- Time when the file was renamed
Fields
§
timestamp: SystemTimeTimestamp of the operation
Moved
File was moved to a different directory
§Fields
old_path- Original path of the filenew_path- New path of the filetimestamp- Time when the file was moved
Fields
§
timestamp: SystemTimeTimestamp of the operation
Read
Trait Implementations§
Source§impl Clone for FileOperationEvent
impl Clone for FileOperationEvent
Source§fn clone(&self) -> FileOperationEvent
fn clone(&self) -> FileOperationEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileOperationEvent
impl Debug for FileOperationEvent
Source§impl<'de> Deserialize<'de> for FileOperationEvent
impl<'de> Deserialize<'de> for FileOperationEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FileOperationEvent
impl RefUnwindSafe for FileOperationEvent
impl Send for FileOperationEvent
impl Sync for FileOperationEvent
impl Unpin for FileOperationEvent
impl UnwindSafe for FileOperationEvent
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