pub struct ReqwestBackend { /* private fields */ }Expand description
The production backend: one pooled reqwest client.
Pooled rather than a client per request, because the daemon drains a bounded prefix of a rejected body specifically so pooled connections keep working, and throwing the pool away per request discards that.
Implementations§
Source§impl ReqwestBackend
impl ReqwestBackend
Sourcepub fn new(base_url: &str, timeout: Duration) -> Result<ReqwestBackend, Error>
pub fn new(base_url: &str, timeout: Duration) -> Result<ReqwestBackend, Error>
A backend rooted at base_url.
A bare host is read as https. The endpoint the platform hands back is a
hostname, and defaulting to plain HTTP there would send a bearer token in
clear text on the strength of a missing prefix.
Trait Implementations§
Source§impl Debug for ReqwestBackend
impl Debug for ReqwestBackend
Source§impl HttpBackend for ReqwestBackend
impl HttpBackend for ReqwestBackend
Source§fn send(
&self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Error>> + Send + '_>>
fn send( &self, request: HttpRequest, ) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Error>> + Send + '_>>
Sends one request and collects the whole body, whatever the status. Read more
Source§fn open_stream(
&self,
request: HttpRequest,
idle_timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(HttpResponse, Box<dyn ChunkSource>), Error>> + Send + '_>>
fn open_stream( &self, request: HttpRequest, idle_timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<(HttpResponse, Box<dyn ChunkSource>), Error>> + Send + '_>>
Opens a streaming response, reading the status before any body byte. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for ReqwestBackend
impl !UnwindSafe for ReqwestBackend
impl Freeze for ReqwestBackend
impl Send for ReqwestBackend
impl Sync for ReqwestBackend
impl Unpin for ReqwestBackend
impl UnsafeUnpin for ReqwestBackend
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 moreCreates a shared type from an unshared type.