pub struct FileMetadata {
pub modified_time: SystemTime,
pub size: u64,
pub content_hash: u64,
}Expand description
Metadata about a file for conflict detection
Uses modification time, size, and content hash for comprehensive change detection. The hash provides additional protection against edge cases where timestamp and size might be identical but content differs.
Fields§
§modified_time: SystemTimeLast modified time of the file
size: u64File size in bytes for additional verification
content_hash: u64Content hash for detecting changes even when timestamp/size are identical
Implementations§
Source§impl FileMetadata
impl FileMetadata
Sourcepub fn from_file(path: &Path) -> Result<Self>
pub fn from_file(path: &Path) -> Result<Self>
Create FileMetadata from a file on disk
Computes content hash by reading and hashing the entire file. For typical kanban files (< 1MB), this adds minimal overhead (1-5ms).
Sourcepub fn has_changed(&self, path: &Path) -> Result<bool>
pub fn has_changed(&self, path: &Path) -> Result<bool>
Check if file has changed since this metadata was captured
Trait Implementations§
Source§impl Clone for FileMetadata
impl Clone for FileMetadata
Source§fn clone(&self) -> FileMetadata
fn clone(&self) -> FileMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FileMetadata
Source§impl Debug for FileMetadata
impl Debug for FileMetadata
impl Eq for FileMetadata
Source§impl PartialEq for FileMetadata
impl PartialEq for FileMetadata
Source§fn eq(&self, other: &FileMetadata) -> bool
fn eq(&self, other: &FileMetadata) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FileMetadata
Auto Trait Implementations§
impl Freeze for FileMetadata
impl RefUnwindSafe for FileMetadata
impl Send for FileMetadata
impl Sync for FileMetadata
impl Unpin for FileMetadata
impl UnsafeUnpin for FileMetadata
impl UnwindSafe for FileMetadata
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