pub trait File:
AsyncRead
+ AsyncSeek
+ Unpin
+ Send
+ Sync {
type Metadata: Metadata;
type MetadataFuture<'a>: Future<Output = Result<Self::Metadata>> + Send
where Self: 'a;
// Required method
fn metadata(&self) -> Self::MetadataFuture<'_>;
}Expand description
Trait for an opened file.
Must support async reading and seeking (for HTTP range requests).
In-memory backends can use std::io::Cursor to satisfy the AsyncSeek requirement.
Required Associated Types§
Sourcetype MetadataFuture<'a>: Future<Output = Result<Self::Metadata>> + Send
where
Self: 'a
type MetadataFuture<'a>: Future<Output = Result<Self::Metadata>> + Send where Self: 'a
Future returned by File::metadata.
Required Methods§
Sourcefn metadata(&self) -> Self::MetadataFuture<'_>
fn metadata(&self) -> Self::MetadataFuture<'_>
Returns metadata for this opened file.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.