Skip to main content

Metadata

Trait Metadata 

Source
pub trait Metadata: Send + 'static {
    // Required methods
    fn is_dir(&self) -> bool;
    fn modified(&self) -> Result<SystemTime>;
    fn len(&self) -> u64;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Available on crate feature fs only.
Expand description

Trait for file metadata.

This is the information ServeDir needs about a file or directory without opening it.

Required Methods§

Source

fn is_dir(&self) -> bool

Returns true if this metadata refers to a directory.

Source

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

Returns the last modification time, if available.

Source

fn len(&self) -> u64

Returns the size of the file in bytes.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true if the file is empty (zero bytes).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Metadata for Metadata

Source§

fn is_dir(&self) -> bool

Source§

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

Source§

fn len(&self) -> u64

Implementors§