Skip to main content

FileMetadata

Trait FileMetadata 

Source
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§

Source

fn file_type(&self) -> Option<FileType>

The kind of filesystem object.

Source

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.

Source

fn accessed(&self) -> Option<SystemTime>

Last access time. Filesystem policies can suppress or defer updates.

Source

fn modified(&self) -> Option<SystemTime>

Last content modification time.

Source

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".

Implementors§