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) -> Selfwhere
P: ConnectionPool + Debug + Clone + Send + 'static,
pub fn new<P>(conn_pool: P) -> Selfwhere
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.