pub struct Client(_);
Implementations§
source§impl Client
impl Client
sourcepub fn new(
user_agent: impl AsRef<str>,
min_tls: Option<Version>,
per: Duration,
num_request: NonZeroU64,
certificates: impl IntoIterator<Item = Certificate>
) -> Result<Client, Error>
pub fn new( user_agent: impl AsRef<str>, min_tls: Option<Version>, per: Duration, num_request: NonZeroU64, certificates: impl IntoIterator<Item = Certificate> ) -> Result<Client, Error>
per
- must not be 0.num_request
- maximum number of requests to be processed for eachper
duration.
The Client created would use at least tls 1.2
sourcepub async fn remote_gettable(
&self,
url: Url
) -> impl Future<Output = Result<bool, Error>>
pub async fn remote_gettable( &self, url: Url ) -> impl Future<Output = Result<bool, Error>>
Check if remote exists using Method::GET
.
sourcepub async fn get_redirected_final_url(
&self,
url: Url
) -> impl Future<Output = Result<Url, Error>>
pub async fn get_redirected_final_url( &self, url: Url ) -> impl Future<Output = Result<Url, Error>>
Attempt to get final redirected url using Method::HEAD
or fallback
to Method::GET
.
sourcepub async fn get_stream(
&self,
url: Url
) -> impl Future<Output = Result<impl Stream<Item = Result<Bytes, Error>>, Error>>
pub async fn get_stream( &self, url: Url ) -> impl Future<Output = Result<impl Stream<Item = Result<Bytes, Error>>, Error>>
Create GET
request to url
and return a stream of the response data.
On status code other than 200, it will return an error.