pub struct RequestBuilder<'a, C: 'a, E = BytesEncoder, D = RemainingBytesDecoder> { /* private fields */ }Expand description
HTTP request builder.
This is created by calling Client::request method.
Implementations§
Source§impl<'a, C, E, D> RequestBuilder<'a, C, E, D>
impl<'a, C, E, D> RequestBuilder<'a, C, E, D>
Sourcepub fn delete(self) -> impl Future<Item = Response<D::Item>, Error = Error>
pub fn delete(self) -> impl Future<Item = Response<D::Item>, Error = Error>
Executes DELETE request.
Sourcepub fn put(
self,
body: E::Item,
) -> impl Future<Item = Response<D::Item>, Error = Error>
pub fn put( self, body: E::Item, ) -> impl Future<Item = Response<D::Item>, Error = Error>
Executes PUT request.
Sourcepub fn post(
self,
body: E::Item,
) -> impl Future<Item = Response<D::Item>, Error = Error>
pub fn post( self, body: E::Item, ) -> impl Future<Item = Response<D::Item>, Error = Error>
Executes POST request.
Sourcepub fn header_field<N, V>(self, name: N, value: V) -> Self
pub fn header_field<N, V>(self, name: N, value: V) -> Self
Adds a field to the tail of the HTTP header of the request.
Sourcepub fn encoder<T>(self, encoder: T) -> RequestBuilder<'a, C, T, D>
pub fn encoder<T>(self, encoder: T) -> RequestBuilder<'a, C, T, D>
Sets the encoder for serializing the body of the HTTP request.
This is only meaningful at the case the method of the request is PUT or POST.
Sourcepub fn decoder<T>(self, decoder: T) -> RequestBuilder<'a, C, E, T>
pub fn decoder<T>(self, decoder: T) -> RequestBuilder<'a, C, E, T>
Sets the decoder for deserializing the body of the HTTP response replied from the server.
The decoder is unused if the method of the request is HEAD.
Trait Implementations§
Auto Trait Implementations§
impl<'a, C, E, D> Freeze for RequestBuilder<'a, C, E, D>
impl<'a, C, E, D> RefUnwindSafe for RequestBuilder<'a, C, E, D>
impl<'a, C, E, D> Send for RequestBuilder<'a, C, E, D>
impl<'a, C, E, D> Sync for RequestBuilder<'a, C, E, D>
impl<'a, C, E, D> Unpin for RequestBuilder<'a, C, E, D>
impl<'a, C, E = BytesEncoder, D = RemainingBytesDecoder> !UnwindSafe for RequestBuilder<'a, C, E, D>
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