Skip to main content

Prefetch

Trait Prefetch 

Source
pub trait Prefetch<Client: HttpClient> {
    // Required method
    fn prefetch(
        &self,
        url: Url,
    ) -> impl Future<Output = PrefetchResult<Client>> + Send;
}
Expand description

Trait for fetching resource metadata (size, filename, range support) from a URL.

Implementors perform a GET request to gather UrlInfo and the initial response for subsequent downloading.

Required Methods§

Source

fn prefetch( &self, url: Url, ) -> impl Future<Output = PrefetchResult<Client>> + Send

Fetch the resource metadata and the initial response for url.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<Client, BorrowClient> Prefetch<Client> for BorrowClient
where Client: HttpClient, BorrowClient: Borrow<Client> + Sync,