Trait kube_client::client::ConfigExt

source ·
pub trait ConfigExt: Sealed {
    // Required methods
    fn base_uri_layer(&self) -> BaseUriLayer;
    fn auth_layer(&self) -> Result<Option<AuthLayer>>;
    fn extra_headers_layer(&self) -> Result<ExtraHeadersLayer>;
    fn openssl_https_connector(&self) -> Result<HttpsConnector<HttpConnector>>;
    fn openssl_https_connector_with_connector<H>(
        &self,
        connector: H,
    ) -> Result<HttpsConnector<H>>
       where H: Service<Uri> + Send,
             H::Error: Into<Box<dyn Error + Send + Sync>>,
             H::Future: Send + 'static,
             H::Response: Read + Write + Connection + Unpin;
    fn openssl_ssl_connector_builder(&self) -> Result<SslConnectorBuilder>;
}
Expand description

Extensions to Config for custom Client.

See Client::new for an example.

This trait is sealed and cannot be implemented.

Required Methods§

source

fn base_uri_layer(&self) -> BaseUriLayer

Layer to set the base URI of requests to the configured server.

source

fn auth_layer(&self) -> Result<Option<AuthLayer>>

Optional layer to set up Authorization header depending on the config.

source

fn extra_headers_layer(&self) -> Result<ExtraHeadersLayer>

Layer to add non-authn HTTP headers depending on the config.

source

fn openssl_https_connector(&self) -> Result<HttpsConnector<HttpConnector>>

Create [hyper_openssl::HttpsConnector] based on config.

§Example
let config = Config::infer().await?;
let https = config.openssl_https_connector()?;
source

fn openssl_https_connector_with_connector<H>( &self, connector: H, ) -> Result<HttpsConnector<H>>
where H: Service<Uri> + Send, H::Error: Into<Box<dyn Error + Send + Sync>>, H::Future: Send + 'static, H::Response: Read + Write + Connection + Unpin,

Create [hyper_openssl::HttpsConnector] based on config and connector.

§Example
let mut http = HttpConnector::new();
http.enforce_http(false);
let config = Config::infer().await?;
let https = config.openssl_https_connector_with_connector(http)?;
source

fn openssl_ssl_connector_builder(&self) -> Result<SslConnectorBuilder>

Create openssl::ssl::SslConnectorBuilder based on config.

§Example
let config = Config::infer().await?;
let https = {
    let mut http = HttpConnector::new();
    http.enforce_http(false);
    let ssl = config.openssl_ssl_connector_builder()?;
    hyper_openssl::client::legacy::HttpsConnector::with_connector(http, ssl)?
};

Object Safety§

This trait is not object safe.

Implementors§