pub struct HttpClientConfig {
pub default_headers: HeaderMap,
pub redirect_policy: RedirectPolicy,
pub https_only: bool,
pub referer: bool,
pub proxies: Vec<ProxyConfig>,
pub no_proxy: bool,
pub extra_root_certificates: HashSet<String>,
}Expand description
Rules for how to make a reqwest::blocking::Client.
Fields§
§default_headers: HeaderMapThe headers to send by default.
redirect_policy: RedirectPolicyThe redirect policy.
Somewhat nuanced so check RedirectPolicy’s docs.
https_only: boolThe value passed to reqwest::blocking::ClientBuilder::https_only.
Defaults to false.
referer: boolThe value passed to reqwest::blocking::ClientBuilder::referer.
Defaults to false and frankly there’s no legitimate reason for the header to exist or for you to turn it on.
proxies: Vec<ProxyConfig>Proxies to use.
All proxies supported by reqwest should always be supported, but if I missed anything let me know.
no_proxy: boolThe value passed to reqwest::blocking::ClientBuilder::no_proxy.
Defaults to false.
extra_root_certificates: HashSet<String>Extra PEM encoded TLS certificates to trust.
See reqwest::blocking::ClientBuilder::add_root_certificate and reqwest::tls::Certificate::from_pem for details.
Defaults to an empty list.
Implementations§
Source§impl HttpClientConfig
impl HttpClientConfig
Sourcepub fn make(&self) -> Result<Client>
pub fn make(&self) -> Result<Client>
Makes a reqwest::blocking::Client.
§Errors
If a call to ProxyConfig::make returns an error, that error is returned.
If the call to reqwest::blocking::ClientBuilder::build returns an error, that error is returned.
Trait Implementations§
Source§impl Clone for HttpClientConfig
impl Clone for HttpClientConfig
Source§fn clone(&self) -> HttpClientConfig
fn clone(&self) -> HttpClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HttpClientConfig
impl Debug for HttpClientConfig
Source§impl Default for HttpClientConfig
impl Default for HttpClientConfig
Source§fn default() -> HttpClientConfig
fn default() -> HttpClientConfig
Source§impl<'de> Deserialize<'de> for HttpClientConfig
impl<'de> Deserialize<'de> for HttpClientConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for HttpClientConfig
impl PartialEq for HttpClientConfig
Source§impl Serialize for HttpClientConfig
impl Serialize for HttpClientConfig
impl Eq for HttpClientConfig
impl StructuralPartialEq for HttpClientConfig
Auto Trait Implementations§
impl Freeze for HttpClientConfig
impl RefUnwindSafe for HttpClientConfig
impl Send for HttpClientConfig
impl Sync for HttpClientConfig
impl Unpin for HttpClientConfig
impl UnwindSafe for HttpClientConfig
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more