#[non_exhaustive]pub struct ClientOptions {Show 14 fields
pub target_url: Url,
pub client_name: String,
pub client_version: String,
pub identity: String,
pub tls_cfg: Option<TlsConfig>,
pub retry_config: RetryConfig,
pub override_origin: Option<Uri>,
pub keep_alive: Option<ClientKeepAliveConfig>,
pub headers: Option<HashMap<String, String>>,
pub binary_headers: Option<HashMap<String, Vec<u8>>>,
pub api_key: Option<String>,
pub http_connect_proxy: Option<HttpConnectProxyOptions>,
pub disable_error_code_metric_tags: bool,
pub skip_get_system_info: bool,
}
Expand description
Options for the connection to the temporal server. Construct with ClientOptionsBuilder
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.target_url: Url
The URL of the Temporal server to connect to
client_name: String
The name of the SDK being implemented on top of core. Is set as client-name
header in
all RPC calls
client_version: String
The version of the SDK being implemented on top of core. Is set as client-version
header
in all RPC calls. The server decides if the client is supported based on this.
identity: String
A human-readable string that can identify this process. Defaults to empty string.
tls_cfg: Option<TlsConfig>
If specified, use TLS as configured by the TlsConfig struct. If this is set core will attempt to use TLS when connecting to the Temporal server. Lang SDK is expected to pass any certs or keys as bytes, loading them from disk itself if needed.
retry_config: RetryConfig
Retry configuration for the server client. Default is RetryConfig::default
override_origin: Option<Uri>
If set, override the origin used when connecting. May be useful in rare situations where tls
verification needs to use a different name from what should be set as the :authority
header. If TlsConfig::domain is set, and this is not, this will be set to
https://<domain>
, effectively making the :authority
header consistent with the domain
override.
keep_alive: Option<ClientKeepAliveConfig>
If set (which it is by default), HTTP2 gRPC keep alive will be enabled.
headers: Option<HashMap<String, String>>
HTTP headers to include on every RPC call.
These must be valid gRPC metadata keys, and must not be binary metadata keys (ending in `-bin). To set binary headers, use ClientOptions::binary_headers. Invalid header keys or values will cause an error to be returned when connecting.
binary_headers: Option<HashMap<String, Vec<u8>>>
HTTP headers to include on every RPC call as binary gRPC metadata (encoded as base64).
These must be valid binary gRPC metadata keys (and end with a -bin
suffix). Invalid
header keys will cause an error to be returned when connecting.
api_key: Option<String>
API key which is set as the “Authorization” header with “Bearer “ prepended. This will only be applied if the headers don’t already have an “Authorization” header.
http_connect_proxy: Option<HttpConnectProxyOptions>
HTTP CONNECT proxy to use for this client.
If set true, error code labels will not be included on request failure metrics.
skip_get_system_info: bool
If set true, get_system_info will not be called upon connection
Implementations§
Source§impl ClientOptions
impl ClientOptions
Sourcepub async fn connect(
&self,
namespace: impl Into<String>,
metrics_meter: Option<TemporalMeter>,
) -> Result<RetryClient<Client>, ClientInitError>
pub async fn connect( &self, namespace: impl Into<String>, metrics_meter: Option<TemporalMeter>, ) -> Result<RetryClient<Client>, ClientInitError>
Attempt to establish a connection to the Temporal server in a specific namespace. The returned client is bound to that namespace.
Sourcepub async fn connect_no_namespace(
&self,
metrics_meter: Option<TemporalMeter>,
) -> Result<RetryClient<ConfiguredClient<TemporalServiceClientWithMetrics>>, ClientInitError>
pub async fn connect_no_namespace( &self, metrics_meter: Option<TemporalMeter>, ) -> Result<RetryClient<ConfiguredClient<TemporalServiceClientWithMetrics>>, ClientInitError>
Attempt to establish a connection to the Temporal server and return a gRPC client which is intercepted with retry, default headers functionality, and metrics if provided.
See RetryClient for more
Sourcepub async fn connect_no_namespace_with_service_override(
&self,
metrics_meter: Option<TemporalMeter>,
service_override: Option<CallbackBasedGrpcService>,
) -> Result<RetryClient<ConfiguredClient<TemporalServiceClientWithMetrics>>, ClientInitError>
pub async fn connect_no_namespace_with_service_override( &self, metrics_meter: Option<TemporalMeter>, service_override: Option<CallbackBasedGrpcService>, ) -> Result<RetryClient<ConfiguredClient<TemporalServiceClientWithMetrics>>, ClientInitError>
Attempt to establish a connection to the Temporal server and return a gRPC client which is intercepted with retry, default headers functionality, and metrics if provided. If a service_override is present, network-specific options are ignored and the callback is invoked for each gRPC call.
See RetryClient for more
Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Source§fn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !Freeze for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnwindSafe for ClientOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request