# HttpClient in maplibre::io::source_client - Rust
On the web platform futures are not thread-safe (i.e. not Send). This means we need to tell async_trait that these bounds should not be placed on the async trait: https://github.com/dtolnay/async-trait/blob/b70720c4c1cc0d810b7446efda44f81310ee7bf2/README.md#non-threadsafe-futures
Keywords: rust, rustlang, rust-lang, HttpClient

# Trait maplibre::io::source_client::HttpClient

source · [−]

    pub trait HttpClient: Clone + Sync + Send + 'static {
        fn fetch<'life0, 'life1, 'async_trait>(
            &'life0 self,
            url: &'life1 str
        ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
        where
            'life0: 'async_trait,
            'life1: 'async_trait,
            Self: 'async_trait;
    }

Expand description

On the web platform futures are not thread-safe (i.e. not Send). This means we need to tell async_trait that these bounds should not be placed on the async trait: https://github.com/dtolnay/async-trait/blob/b70720c4c1cc0d810b7446efda44f81310ee7bf2/README.md#non-threadsafe-futures

Users of this library can decide whether futures from the HTTPClient are thread-safe or not via the future “no-thread-safe-futures”. Tokio futures are thread-safe.

## Required methods

source

#### fn fetch<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,

## Implementors

source

### impl HttpClient for ReqwestHttpClient