pub struct HttpFetcher<A: AuthProvider> { /* private fields */ }Expand description
An HTTP(S) fetcher over reqwest + rustls.
Implementations§
Source§impl<A: AuthProvider> HttpFetcher<A>
impl<A: AuthProvider> HttpFetcher<A>
Sourcepub fn new(auth: A) -> Result<Self>
pub fn new(auth: A) -> Result<Self>
Build a fetcher with a default client: rustls, a bounded redirect policy, and connect/request timeouts.
§Errors
Returns Error::Backend if the HTTP client cannot be constructed.
Sourcepub fn with_client(client: Client, auth: A) -> Self
pub fn with_client(client: Client, auth: A) -> Self
Build with a caller-provided client (e.g. custom timeouts/proxy).
Sourcepub fn user_agent(self, ua: impl Into<CompactString>) -> Self
pub fn user_agent(self, ua: impl Into<CompactString>) -> Self
Override the User-Agent.
Trait Implementations§
Source§impl<A: Debug + AuthProvider> Debug for HttpFetcher<A>
impl<A: Debug + AuthProvider> Debug for HttpFetcher<A>
Source§impl<A: AuthProvider> Fetcher for HttpFetcher<A>
impl<A: AuthProvider> Fetcher for HttpFetcher<A>
Source§type FetchFuture<'a> = impl Future<Output = Result<Fetched<'a>, Error>> + Send + 'a
where
Self: 'a
type FetchFuture<'a> = impl Future<Output = Result<Fetched<'a>, Error>> + Send + 'a where Self: 'a
The future returned by
Fetcher::fetch.Source§fn fetch<'a>(
&'a self,
resource: &'a Resource,
opts: FetchOptions<'a>,
) -> Self::FetchFuture<'a>
fn fetch<'a>( &'a self, resource: &'a Resource, opts: FetchOptions<'a>, ) -> Self::FetchFuture<'a>
Fetch
resource.Auto Trait Implementations§
impl<A> !RefUnwindSafe for HttpFetcher<A>
impl<A> !UnwindSafe for HttpFetcher<A>
impl<A> Freeze for HttpFetcher<A>where
A: Freeze,
impl<A> Send for HttpFetcher<A>
impl<A> Sync for HttpFetcher<A>
impl<A> Unpin for HttpFetcher<A>where
A: Unpin,
impl<A> UnsafeUnpin for HttpFetcher<A>where
A: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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