pub struct Builder<B> { /* private fields */ }
Expand description
Configure an RequestModifier
instance
Implementations§
Source§impl<B> Builder<B>
impl<B> Builder<B>
Sourcepub fn add_header<T: ToString, R>(self, name: T, val: R) -> Self
pub fn add_header<T: ToString, R>(self, name: T, val: R) -> Self
Set a header on all requests.
Sourcepub fn set_origin<T>(self, uri: T) -> Selfwhere
Uri: HttpTryFrom<T>,
pub fn set_origin<T>(self, uri: T) -> Selfwhere
Uri: HttpTryFrom<T>,
Set the URI to use as the origin for all requests.
Sourcepub fn add_modifier(
self,
modifier: Box<dyn Fn(Request<B>) -> Request<B> + Send + Sync>,
) -> Self
pub fn add_modifier( self, modifier: Box<dyn Fn(Request<B>) -> Request<B> + Send + Sync>, ) -> Self
Run an arbitrary modifier on all requests
Sourcepub fn build<T>(self, inner: T) -> Result<RequestModifier<T, B>, BuilderError>
pub fn build<T>(self, inner: T) -> Result<RequestModifier<T, B>, BuilderError>
Build the RequestModifier
from the provided settings.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Builder<B>
impl<B> !RefUnwindSafe for Builder<B>
impl<B> Send for Builder<B>
impl<B> Sync for Builder<B>
impl<B> Unpin for Builder<B>
impl<B> !UnwindSafe for Builder<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