Request

Struct Request 

Source
pub struct Request<'req, B>
where B: RequestBody,
{ /* private fields */ }
Expand description

A read only HTTP request type

Implementations§

Source§

impl<'req> Request<'req, ()>

Source

pub fn new(method: Method, path: &'req str) -> DefaultRequestBuilder<'req, ()>

Create a new http request.

Source

pub fn get(path: &'req str) -> DefaultRequestBuilder<'req, ()>

Create a new GET http request.

Source

pub fn post(path: &'req str) -> DefaultRequestBuilder<'req, ()>

Create a new POST http request.

Source

pub fn put(path: &'req str) -> DefaultRequestBuilder<'req, ()>

Create a new PUT http request.

Source

pub fn delete(path: &'req str) -> DefaultRequestBuilder<'req, ()>

Create a new DELETE http request.

Source

pub fn head(path: &'req str) -> DefaultRequestBuilder<'req, ()>

Create a new HEAD http request.

Source§

impl<'req, B> Request<'req, B>
where B: RequestBody,

Source

pub async fn write_header<C>(&self, c: &mut C) -> Result<(), Error>
where C: Write,

Write request header to the I/O stream

Trait Implementations§

Source§

impl Default for Request<'_, ()>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'req, B> Freeze for Request<'req, B>
where B: Freeze,

§

impl<'req, B> RefUnwindSafe for Request<'req, B>
where B: RefUnwindSafe,

§

impl<'req, B> Send for Request<'req, B>
where B: Send,

§

impl<'req, B> Sync for Request<'req, B>
where B: Sync,

§

impl<'req, B> Unpin for Request<'req, B>
where B: Unpin,

§

impl<'req, B> UnwindSafe for Request<'req, B>
where B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V