pub struct HttpRequestBuilder { /* private fields */ }Expand description
Request builder paired with a circuit-breaker-backed HTTP client.
Implementations§
Source§impl HttpRequestBuilder
impl HttpRequestBuilder
pub fn header(self, key: impl AsRef<str>, value: impl AsRef<str>) -> Self
pub fn headers(self, headers: HeaderMap) -> Self
pub fn bearer_auth(self, token: impl Display) -> Self
pub fn basic_auth( self, username: impl Display, password: Option<impl Display>, ) -> Self
pub fn body(self, body: impl Into<Body>) -> Self
pub fn json(self, json: &impl Serialize) -> Self
pub fn form(self, form: &impl Serialize) -> Self
pub fn query(self, query: &impl Serialize) -> Self
pub fn timeout(self, timeout: Duration) -> Self
pub fn version(self, version: Version) -> Self
pub fn try_clone(&self) -> Option<Self>
pub fn build(self) -> Result<Request>
pub async fn send(self) -> Result<Response>
Auto Trait Implementations§
impl !Freeze for HttpRequestBuilder
impl !RefUnwindSafe for HttpRequestBuilder
impl Send for HttpRequestBuilder
impl Sync for HttpRequestBuilder
impl Unpin for HttpRequestBuilder
impl UnsafeUnpin for HttpRequestBuilder
impl !UnwindSafe for HttpRequestBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more