pub struct HttpRequest { /* private fields */ }Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn builder() -> HttpRequestBuilder<SetMethod>
pub fn builder() -> HttpRequestBuilder<SetMethod>
Create a new request using builder.
Sourcepub fn from_parts(body: BoxBody<Bytes, Error>, parts: Parts) -> HttpRequest
pub fn from_parts(body: BoxBody<Bytes, Error>, parts: Parts) -> HttpRequest
Create a new request from hyper parts.
Sourcepub fn from_parts_with_params(
body: BoxBody<Bytes, Error>,
parts: Parts,
params: HashMap<String, String>,
) -> HttpRequest
pub fn from_parts_with_params( body: BoxBody<Bytes, Error>, parts: Parts, params: HashMap<String, String>, ) -> HttpRequest
Create a new request from hyper parts with params.
Sourcepub fn body(self) -> BoxBody<Bytes, Error>
pub fn body(self) -> BoxBody<Bytes, Error>
Returns the boxed body.
Used for moving body between requests/responses.
This consumes the HttpRequest
Sourcepub fn body_as_stream(self) -> BodyDataStream<BoxBody<Bytes, Error>>
pub fn body_as_stream(self) -> BodyDataStream<BoxBody<Bytes, Error>>
Returns the body data stream.
This consumes the HttpRequest
Sourcepub async fn body_as_bytes(self) -> Result<Bytes>
pub async fn body_as_bytes(self) -> Result<Bytes>
Returns the body as bytes.
This consumes the HttpRequest
Sourcepub fn headers(&self) -> &HeaderMap<HeaderValue>
pub fn headers(&self) -> &HeaderMap<HeaderValue>
Returns all headers.
Trait Implementations§
Source§impl Debug for HttpRequest
impl Debug for HttpRequest
Source§impl From<HttpRequest> for Request<BoxBody<Bytes, Error>>
impl From<HttpRequest> for Request<BoxBody<Bytes, Error>>
Source§fn from(req: HttpRequest) -> Self
fn from(req: HttpRequest) -> Self
Converts to this type from the input type.
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