pub struct RequestBuilder<B = Bytes> { /* private fields */ }Expand description
Builder for constructing Request instances.
Implementations§
Source§impl<B> RequestBuilder<B>
impl<B> RequestBuilder<B>
Sourcepub fn headers(
self,
headers: impl IntoIterator<Item = (String, String)>,
) -> Self
pub fn headers( self, headers: impl IntoIterator<Item = (String, String)>, ) -> Self
Sets multiple headers.
Sourcepub fn query_pairs(
self,
pairs: impl IntoIterator<Item = (String, String)>,
) -> Self
pub fn query_pairs( self, pairs: impl IntoIterator<Item = (String, String)>, ) -> Self
Appends multiple query parameters to the URL.
Sourcepub fn extension<T: Clone + Send + Sync + 'static>(self, value: T) -> Self
pub fn extension<T: Clone + Send + Sync + 'static>(self, value: T) -> Self
Insert a typed extension value.
Extensions allow middleware to attach arbitrary typed data to requests.
Sourcepub fn extensions(self, extensions: Extensions) -> Self
pub fn extensions(self, extensions: Extensions) -> Self
Set extensions from an existing Extensions container.
This replaces any previously set extensions.
Source§impl RequestBuilder<Bytes>
impl RequestBuilder<Bytes>
Trait Implementations§
Source§impl<B: Clone> Clone for RequestBuilder<B>
impl<B: Clone> Clone for RequestBuilder<B>
Source§fn clone(&self) -> RequestBuilder<B>
fn clone(&self) -> RequestBuilder<B>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<B> Freeze for RequestBuilder<B>where
B: Freeze,
impl<B = Bytes> !RefUnwindSafe for RequestBuilder<B>
impl<B> Send for RequestBuilder<B>where
B: Send,
impl<B> Sync for RequestBuilder<B>where
B: Sync,
impl<B> Unpin for RequestBuilder<B>where
B: Unpin,
impl<B = Bytes> !UnwindSafe for RequestBuilder<B>
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