#[non_exhaustive]pub struct HttpRequest {
pub method: Method,
pub url: Url,
pub headers: HeaderMap,
pub body: Option<Bytes>,
pub timeout: Duration,
}Expand description
One attempt’s request, as the send loop builds it.
Only core builds one: the struct is non_exhaustive and has no public
constructor, so a transport reads the fields it is handed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.method: MethodThe HTTP method.
url: UrlThe full URL: the base URL joined with the path, with the query form-urlencoded onto it.
headers: HeaderMapThe headers, signed.
body: Option<Bytes>The body, sent as given.
timeout: DurationHow long the whole exchange may take, the body’s read included: the request’s own timeout, else the client’s. Always set.
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Auto Trait Implementations§
impl !Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
impl UnwindSafe for HttpRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more