Struct EasyHttpWebClientBuilder

Source
pub struct EasyHttpWebClientBuilder<C = (), S = ()> { /* private fields */ }
Expand description

Builder that is designed to easily create a super::EasyHttpWebClient from most basic use cases

Implementations§

Source§

impl EasyHttpWebClientBuilder

Source

pub fn new() -> Self

Source

pub fn with_default_transport_connector( self, ) -> EasyHttpWebClientBuilder<TcpConnector, TransportStage>

Source

pub fn with_custom_transport_connector<C>( self, connector: C, ) -> EasyHttpWebClientBuilder<C, TransportStage>

Add a custom transport connector that will be used by this client for the transport layer

Source§

impl EasyHttpWebClientBuilder<TcpConnector, TransportStage>

Source

pub fn with_dns_resolver<T: DnsResolver + Clone>( self, resolver: T, ) -> EasyHttpWebClientBuilder<TcpConnector<T>, TransportStage>

Add a custom DnsResolver that will be used by this client

Source§

impl<T> EasyHttpWebClientBuilder<T, TransportStage>

Source

pub fn with_custom_tls_proxy_connector<L>( self, connector_layer: L, ) -> EasyHttpWebClientBuilder<L::Service, ProxyTunnelStage>
where L: Layer<T>,

Add a custom proxy tls connector that will be used to setup a tls connection to the proxy

Source

pub fn with_tls_proxy_support_using_boringssl( self, ) -> EasyHttpWebClientBuilder<TlsConnector<T, ConnectorKindTunnel>, ProxyTunnelStage>

Support a tls tunnel to the proxy itself using boringssl

Note that a tls proxy is not needed to make a https connection to the final target. It only has an influence on the initial connection to the proxy itself

Source

pub fn with_tls_proxy_support_using_boringssl_config( self, config: Arc<TlsConnectorDataBuilder>, ) -> EasyHttpWebClientBuilder<TlsConnector<T, ConnectorKindTunnel>, ProxyTunnelStage>

Support a tls tunnel to the proxy itself using boringssl and the provided config

Note that a tls proxy is not needed to make a https connection to the final target. It only has an influence on the initial connection to the proxy itself

Source

pub fn with_tls_proxy_support_using_rustls( self, ) -> EasyHttpWebClientBuilder<TlsConnector<T, ConnectorKindTunnel>, ProxyTunnelStage>

Support a tls tunnel to the proxy itself using rustls

Note that a tls proxy is not needed to make a https connection to the final target. It only has an influence on the initial connection to the proxy itself

Source

pub fn with_tls_proxy_support_using_rustls_config( self, config: TlsConnectorData, ) -> EasyHttpWebClientBuilder<TlsConnector<T, ConnectorKindTunnel>, ProxyTunnelStage>

Support a tls tunnel to the proxy itself using rustls and the provided config

Note that a tls proxy is not needed to make a https connection to the final target. It only has an influence on the initial connection to the proxy itself

Source

pub fn without_tls_proxy_support( self, ) -> EasyHttpWebClientBuilder<T, ProxyTunnelStage>

Don’t support a tls tunnel to the proxy itself

Note that a tls proxy is not needed to make a https connection to the final target. It only has an influence on the initial connection to the proxy itself

Source§

impl<T> EasyHttpWebClientBuilder<T, ProxyTunnelStage>

Source

pub fn with_custom_proxy_connector<L>( self, connector_layer: L, ) -> EasyHttpWebClientBuilder<L::Service, ProxyStage>
where L: Layer<T>,

Add a custom proxy connector that will be used by this client

Source

pub fn with_proxy_support( self, ) -> EasyHttpWebClientBuilder<ProxyConnector<Arc<T>>, ProxyStage>

Add support for usage of a http(s) and socks5(h) ProxyAddress to this client

Note that a tls proxy is not needed to make a https connection to the final target. It only has an influence on the initial connection to the proxy itself

Source

pub fn with_http_proxy_support( self, ) -> EasyHttpWebClientBuilder<HttpProxyConnector<T>, ProxyStage>

Add support for usage of a http(s) ProxyAddress to this client

Note that a tls proxy is not needed to make a https connection to the final target. It only has an influence on the initial connection to the proxy itself

Source

pub fn with_socks5_proxy_support( self, ) -> EasyHttpWebClientBuilder<Socks5ProxyConnector<T>, ProxyStage>

Add support for usage of a socks5(h) ProxyAddress to this client

Source

pub fn without_proxy_support(self) -> EasyHttpWebClientBuilder<T, ProxyStage>

Make a client without proxy support

Source§

impl<T> EasyHttpWebClientBuilder<T, ProxyStage>

Source

pub fn with_custom_tls_connector<L>( self, connector_layer: L, ) -> EasyHttpWebClientBuilder<HttpConnector<L::Service, (HttpsAlpnModifier, HttpVersionAdapter)>, HttpStage>
where L: Layer<T>,

Add a custom tls connector that will be used by the client

This will also add the HttpsAlpnModifier request inspector as that one is crucial to make tls alpn work and set the correct TargetHttpVersion

And a HttpVersionAdapter that will adapt the request version to the configured TargetHttpVersion

If you don’t want any of these inspector you can use Self::with_advanced_jit_req_inspector to configure your own request inspectors or Self::without_jit_req_inspector to remove all the default request inspectors

Source

pub fn with_tls_support_using_boringssl( self, config: Option<Arc<TlsConnectorDataBuilder>>, ) -> EasyHttpWebClientBuilder<HttpConnector<TlsConnector<T>, (HttpsAlpnModifier, HttpVersionAdapter)>, HttpStage>

Support https connections by using boringssl for tls

This will also add the HttpsAlpnModifier request inspector as that one is crucial to make tls alpn work and set the correct TargetHttpVersion

And a HttpVersionAdapter that will adapt the request version to the configured TargetHttpVersion

If you don’t want any of these inspector you can use Self::with_advanced_jit_req_inspector to configure your own request inspectors or Self::without_jit_req_inspector to remove all the default request inspectors

Source

pub fn with_tls_support_using_rustls( self, config: Option<TlsConnectorData>, ) -> EasyHttpWebClientBuilder<HttpConnector<TlsConnector<T>, (HttpsAlpnModifier, HttpVersionAdapter)>, HttpStage>

Support https connections by using ruslts for tls

This will also add the HttpsAlpnModifier request inspector as that one is crucial to make tls alpn work and set the correct TargetHttpVersion

And a HttpVersionAdapter that will adapt the request version to the configured TargetHttpVersion

If you don’t want any of these inspector you can use Self::with_advanced_jit_req_inspector to configure your own request inspectors or Self::without_jit_req_inspector to remove all the default request inspectors

Source

pub fn without_tls_support( self, ) -> EasyHttpWebClientBuilder<HttpConnector<T, HttpVersionAdapter>, HttpStage>

Dont support https on this connector

This will also add the HttpVersionAdapter that will adapt the request version to the configured TargetHttpVersion

If you don’t want any of these inspector you can use Self::with_advanced_jit_req_inspector to configure your own request inspectors or Self::without_jit_req_inspector to remove all the default request inspectors

Source§

impl<T, I1, I2> EasyHttpWebClientBuilder<HttpConnector<T, I1, I2>, HttpStage>

Source

pub fn with_advanced_jit_req_inspector<I>( self, http_req_inspector: I, ) -> EasyHttpWebClientBuilder<HttpConnector<T, I, I2>, HttpStage>

Add a http request inspector that will run just after the inner http connector has connected but before the http handshake happens

This function doesn’t add any default request inspectors

Source

pub fn without_jit_req_inspector( self, ) -> EasyHttpWebClientBuilder<HttpConnector<T, (), I2>, HttpStage>

Removes the currently configured request inspector(s)

By default most methods add some request inspectors, this can be used to remove them

Source

pub fn with_jit_req_inspector<I>( self, http_req_inspector: I, ) -> EasyHttpWebClientBuilder<HttpConnector<T, (HttpsAlpnModifier, HttpVersionAdapter, I), I2>, HttpStage>

Add a http request inspector that will run just after the inner http connector has connected but before the http handshake happens

This will also add the HttpsAlpnModifier request inspector as that one is crucial to make tls alpn work and set the correct TargetHttpVersion

And a HttpVersionAdapter that will adapt the request version to the configured TargetHttpVersion

If you don’t want any of these inspector you can use Self::with_advanced_jit_req_inspector to configure your own request inspectors without any defaults

Source

pub fn with_svc_req_inspector<I>( self, http_req_inspector: I, ) -> EasyHttpWebClientBuilder<HttpConnector<T, I1, I>, HttpStage>

Add a http request inspector that will run just before doing the actual http request

Source§

impl<T> EasyHttpWebClientBuilder<T, HttpStage>

Source

pub fn with_connection_pool<C>( self, config: HttpPooledConnectorConfig, ) -> Result<EasyHttpWebClientBuilder<PooledConnector<T, LruDropPool<C, BasicHttpConId>, BasicHttpConnIdentifier>, PoolStage>, OpaqueError>

Use the default connection pool for this super::EasyHttpWebClient

This will create a LruDropPool using the provided limits and will use BasicHttpConnIdentifier to group connection on protocol and authority, which should cover most common use cases

Use wait_for_pool_timeout to limit how long we wait for the pool to give us a connection

If you need a different pool or custom way to group connection you can use EasyHttpWebClientBuilder::with_custom_connection_pool() to provide you own.

Source

pub fn with_custom_connection_pool<P, R>( self, pool: P, req_to_conn_id: R, wait_for_pool_timeout: Option<Duration>, ) -> EasyHttpWebClientBuilder<PooledConnector<T, P, R>, PoolStage>

Configure this client to use the provided Pool and ReqToConnId

Use wait_for_pool_timeout to limit how long we wait for the pool to give us a connection

Source§

impl<T, S> EasyHttpWebClientBuilder<T, S>

Source

pub fn build<Body, ModifiedBody, ConnResponse>( self, ) -> EasyHttpWebClient<Body, T::Response>
where Body: Body<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static, ModifiedBody: Body<Data: Send + 'static, Error: Into<BoxError>> + Unpin + Send + 'static, T: Service<Request<Body>, Response = EstablishedClientConnection<ConnResponse, Request<ModifiedBody>>, Error = BoxError>,

Build a super::EasyHttpWebClient using the provided config

Trait Implementations§

Source§

impl<C: Default, S: Default> Default for EasyHttpWebClientBuilder<C, S>

Source§

fn default() -> EasyHttpWebClientBuilder<C, S>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<C, S> Freeze for EasyHttpWebClientBuilder<C, S>
where C: Freeze,

§

impl<C, S> RefUnwindSafe for EasyHttpWebClientBuilder<C, S>

§

impl<C, S> Send for EasyHttpWebClientBuilder<C, S>
where C: Send, S: Send,

§

impl<C, S> Sync for EasyHttpWebClientBuilder<C, S>
where C: Sync, S: Sync,

§

impl<C, S> Unpin for EasyHttpWebClientBuilder<C, S>
where C: Unpin, S: Unpin,

§

impl<C, S> UnwindSafe for EasyHttpWebClientBuilder<C, S>
where C: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
§

impl<T, U> RamaInto<U> for T
where U: RamaFrom<T>,

§

fn rama_into(self) -> U

§

impl<T, U> RamaInto<U> for T
where U: RamaFrom<T>,

§

fn rama_into(self) -> U

§

impl<T, U> RamaTryInto<U> for T
where U: RamaTryFrom<T>,

§

type Error = <U as RamaTryFrom<T>>::Error

§

fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>

§

impl<T, U> RamaTryInto<U> for T
where U: RamaTryFrom<T>,

§

type Error = <U as RamaTryFrom<T>>::Error

§

fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,