Struct uiuifree_elastic::TransportBuilder
source · [−]pub struct TransportBuilder { /* private fields */ }Expand description
Builds a HTTP transport to make API calls to Elasticsearch
Implementations
sourceimpl TransportBuilder
impl TransportBuilder
sourcepub fn new<P>(conn_pool: P) -> TransportBuilderwhere
P: 'static + ConnectionPool + Debug + Clone + Send,
pub fn new<P>(conn_pool: P) -> TransportBuilderwhere
P: 'static + ConnectionPool + Debug + Clone + Send,
Creates a new instance of TransportBuilder. Accepts a ConnectionPool from which Connections to Elasticsearch will be retrieved.
sourcepub fn proxy(
self,
url: Url,
username: Option<&str>,
password: Option<&str>
) -> TransportBuilder
pub fn proxy(
self,
url: Url,
username: Option<&str>,
password: Option<&str>
) -> TransportBuilder
Configures a proxy.
An optional username and password will be used to set the
Proxy-Authorization header using Basic Authentication.
sourcepub fn disable_proxy(self) -> TransportBuilder
pub fn disable_proxy(self) -> TransportBuilder
Whether to disable proxies, including system proxies.
NOTE: System proxies are enabled by default.
sourcepub fn auth(self, credentials: Credentials) -> TransportBuilder
pub fn auth(self, credentials: Credentials) -> TransportBuilder
Credentials for the client to use for authentication to Elasticsearch
sourcepub fn cert_validation(
self,
validation: CertificateValidation
) -> TransportBuilder
pub fn cert_validation(
self,
validation: CertificateValidation
) -> TransportBuilder
Validation applied to the certificate provided to establish a HTTPS connection. By default, full validation is applied. When using a self-signed certificate, different validation can be applied.
sourcepub fn header(self, key: HeaderName, value: HeaderValue) -> TransportBuilder
pub fn header(self, key: HeaderName, value: HeaderValue) -> TransportBuilder
Adds a HTTP header that will be added to all client API calls.
A default HTTP header can be overridden on a per API call basis.
sourcepub fn headers(self, headers: HeaderMap<HeaderValue>) -> TransportBuilder
pub fn headers(self, headers: HeaderMap<HeaderValue>) -> TransportBuilder
Adds HTTP headers that will be added to all client API calls.
Default HTTP headers can be overridden on a per API call basis.
sourcepub fn enable_meta_header(self, enable: bool) -> TransportBuilder
pub fn enable_meta_header(self, enable: bool) -> TransportBuilder
Whether to send a x-elastic-client-meta header that describes the runtime environment.
This header contains information that is similar to what could be found in User-Agent. Using a separate
header allows applications to use User-Agent for their own needs, e.g. to identify application version
or other environment information. Defaults to true.
sourcepub fn timeout(self, timeout: Duration) -> TransportBuilder
pub fn timeout(self, timeout: Duration) -> TransportBuilder
Sets a global request timeout for the client.
The timeout is applied from when the request starts connecting until the response body has finished. Default is no timeout.
Trait Implementations
sourceimpl Default for TransportBuilder
impl Default for TransportBuilder
sourcefn default() -> TransportBuilder
fn default() -> TransportBuilder
Creates a default implementation using the default implementation of SingleNodeConnectionPool.
Auto Trait Implementations
impl !RefUnwindSafe for TransportBuilder
impl Send for TransportBuilder
impl Sync for TransportBuilder
impl Unpin for TransportBuilder
impl !UnwindSafe for TransportBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more