http_range_client/
range_client.rs1use crate::error::Result;
2use async_trait::async_trait;
3use bytes::Bytes;
4use std::str;
5
6#[cfg(not(target_arch = "wasm32"))]
7#[async_trait]
8pub trait AsyncHttpRangeClient {
10 async fn get_range(&self, url: &str, range: &str) -> Result<Bytes>;
12 async fn head_response_header(&self, url: &str, header: &str) -> Result<Option<String>>;
14}
15
16#[cfg(target_arch = "wasm32")]
17#[async_trait(?Send)]
18pub trait AsyncHttpRangeClient {
20 async fn get_range(&self, url: &str, range: &str) -> Result<Bytes>;
22 async fn head_response_header(&self, url: &str, header: &str) -> Result<Option<String>>;
24}
25
26pub trait SyncHttpRangeClient {
28 fn get_range(&self, url: &str, range: &str) -> Result<Bytes>;
30 fn head_response_header(&self, url: &str, header: &str) -> Result<Option<String>>;
32}