pub trait FileMetadata:
Send
+ Sync
+ 'static {
// Required methods
fn file_type(&self) -> Option<FileType>;
fn size(&self) -> Option<u64>;
fn accessed(&self) -> Option<SystemTime>;
fn modified(&self) -> Option<SystemTime>;
fn created(&self) -> Option<SystemTime>;
}Expand description
Portable accessors for owned file status returned by crate::FileStat::file_stat. Each backend chooses its representation, so native results need no eager field conversion and simulations need no OS resources.
None means a field was not supplied or cannot be represented. Fields can reflect different instants during concurrent modification; metadata is an observation, not an atomic snapshot or synchronization operation. Native fields remain available through the concrete result type.
Required Methods§
Sourcefn size(&self) -> Option<u64>
fn size(&self) -> Option<u64>
Logical length in bytes for regular files. Other file types follow the platform’s meaning; this is not allocated disk space.
Sourcefn accessed(&self) -> Option<SystemTime>
fn accessed(&self) -> Option<SystemTime>
Last access time. Filesystem policies can suppress or defer updates.
Sourcefn modified(&self) -> Option<SystemTime>
fn modified(&self) -> Option<SystemTime>
Last content modification time.
Sourcefn created(&self) -> Option<SystemTime>
fn created(&self) -> Option<SystemTime>
Creation time. Never substituted with Unix status-change time.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".