Struct elasticsearch::http::transport::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) -> Self where
P: ConnectionPool + Debug + Clone + Send + 'static,
pub fn new<P>(conn_pool: P) -> Self where
P: ConnectionPool + Debug + Clone + Send + 'static,
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>
) -> Self
pub fn proxy(
self,
url: Url,
username: Option<&str>,
password: Option<&str>
) -> Self
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) -> Self
pub fn disable_proxy(self) -> Self
Whether to disable proxies, including system proxies.
NOTE: System proxies are enabled by default.
sourcepub fn auth(self, credentials: Credentials) -> Self
pub fn auth(self, credentials: Credentials) -> Self
Credentials for the client to use for authentication to Elasticsearch
sourcepub fn cert_validation(self, validation: CertificateValidation) -> Self
pub fn cert_validation(self, validation: CertificateValidation) -> Self
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) -> Self
pub fn header(self, key: HeaderName, value: HeaderValue) -> Self
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) -> Self
pub fn headers(self, headers: HeaderMap) -> Self
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) -> Self
pub fn enable_meta_header(self, enable: bool) -> Self
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
.
Trait Implementations
sourceimpl Default for TransportBuilder
impl Default for TransportBuilder
sourcefn default() -> Self
fn default() -> Self
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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