Skip to main content

FileStat

Trait FileStat 

Source
pub trait FileStat: FileOperation {
    type Metadata: FileMetadata;

    // Required method
    fn file_stat(
        &self,
        file: &Self::File,
        cancellation: &Cancellation,
    ) -> impl Future<Output = OperationResult<Self::Metadata>> + Send;
}
Expand description

Query owned metadata for an already-open file resource.

Required Associated Types§

Source

type Metadata: FileMetadata

Owned metadata representation chosen by this implementation.

Required Methods§

Source

fn file_stat( &self, file: &Self::File, cancellation: &Cancellation, ) -> impl Future<Output = OperationResult<Self::Metadata>> + Send

Query the already-open resource and return owned metadata without moving its cursor. The result is an observation, not an atomic snapshot: await preceding modifications when ordering matters. Path lookup and symlink-following policy belong to resource creation, not this operation.

The future is lazy. Cancellation before dispatch prevents submission; blocking workers check again before execution. Started blocking calls preserve their actual result. Ring cancellation is best effort and waits for original completion. The backend retains the file until access ends, even if the waiting future is dropped.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§