DefaultRequestBuilder

Struct DefaultRequestBuilder 

Source
pub struct DefaultRequestBuilder<'req, B>(/* private fields */)
where
    B: RequestBody;

Trait Implementations§

Source§

impl<'req, B> RequestBuilder<'req, B> for DefaultRequestBuilder<'req, B>
where B: RequestBody,

Source§

type WithBody<T: RequestBody> = DefaultRequestBuilder<'req, T>

Source§

fn headers(self, headers: &'req [(&'req str, &'req str)]) -> Self

Set optional headers on the request.
Source§

fn path(self, path: &'req str) -> Self

Set the path of the HTTP request.
Source§

fn body<T: RequestBody>(self, body: T) -> Self::WithBody<T>

Set the data to send in the HTTP request body.
Source§

fn host(self, host: &'req str) -> Self

Set the host header.
Source§

fn content_type(self, content_type: ContentType) -> Self

Set the content type header for the request.
Source§

fn accept(self, content_type: ContentType) -> Self

Set the accept header for the request.
Source§

fn basic_auth(self, username: &'req str, password: &'req str) -> Self

Set the basic authentication header for the request.
Source§

fn build(self) -> Request<'req, B>

Return an immutable request.

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<'req, B> UnwindSafe for DefaultRequestBuilder<'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