pub trait HttpRequestExt {
// Required methods
fn follow_redirects(self, follow: RedirectPolicy) -> Self;
fn timeout(self, timeout: Duration) -> Self;
// Provided methods
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
where Self: Sized { ... }
fn when_some<T>(
self,
option: Option<T>,
then: impl FnOnce(Self, T) -> Self,
) -> Self
where Self: Sized { ... }
}Required Methods§
Sourcefn follow_redirects(self, follow: RedirectPolicy) -> Self
fn follow_redirects(self, follow: RedirectPolicy) -> Self
Whether or not to follow redirects
Sourcefn timeout(self, timeout: Duration) -> Self
fn timeout(self, timeout: Duration) -> Self
Requests a deadline for the complete HTTP request, including its response body.
The deadline is attached as RequestTimeout metadata. Concrete HTTP client
adapters must read this metadata and enforce the deadline around their full
request/response operation.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".