Skip to main content

ConnectionOptionsBuilder

Struct ConnectionOptionsBuilder 

Source
pub struct ConnectionOptionsBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> ConnectionOptionsBuilder<S>

Source

pub fn build(self) -> ConnectionOptions
where S: IsComplete,

Finish building and return the requested object

Source

pub fn identity( self, value: impl Into<String>, ) -> ConnectionOptionsBuilder<SetIdentity<S>>
where S::Identity: IsUnset,

Optional (Some / Option setters). Default: "".

A human-readable string that can identify this process. Defaults to empty string.

Source

pub fn maybe_identity( self, value: Option<impl Into<String>>, ) -> ConnectionOptionsBuilder<SetIdentity<S>>
where S::Identity: IsUnset,

Optional (Some / Option setters). Default: "".

A human-readable string that can identify this process. Defaults to empty string.

Source

pub fn metrics_meter( self, value: TemporalMeter, ) -> ConnectionOptionsBuilder<SetMetricsMeter<S>>

Optional (Some / Option setters).

When set, this client will record metrics using the provided meter. The meter can be obtained from temporalio_common::telemetry::TelemetryInstance::get_temporal_metric_meter.

Source

pub fn maybe_metrics_meter( self, value: Option<TemporalMeter>, ) -> ConnectionOptionsBuilder<SetMetricsMeter<S>>

Optional (Some / Option setters).

When set, this client will record metrics using the provided meter. The meter can be obtained from temporalio_common::telemetry::TelemetryInstance::get_temporal_metric_meter.

Source

pub fn tls_options( self, value: TlsOptions, ) -> ConnectionOptionsBuilder<SetTlsOptions<S>>
where S::TlsOptions: IsUnset,

Optional (Some / Option setters).

If specified, use TLS as configured by the TlsOptions 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.

Source

pub fn maybe_tls_options( self, value: Option<TlsOptions>, ) -> ConnectionOptionsBuilder<SetTlsOptions<S>>
where S::TlsOptions: IsUnset,

Optional (Some / Option setters).

If specified, use TLS as configured by the TlsOptions 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.

Source

pub fn override_origin( self, value: Uri, ) -> ConnectionOptionsBuilder<SetOverrideOrigin<S>>

Optional (Some / Option setters).

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 TlsOptions::domain is set, and this is not, this will be set to https://<domain>, effectively making the :authority header consistent with the domain override.

Source

pub fn maybe_override_origin( self, value: Option<Uri>, ) -> ConnectionOptionsBuilder<SetOverrideOrigin<S>>

Optional (Some / Option setters).

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 TlsOptions::domain is set, and this is not, this will be set to https://<domain>, effectively making the :authority header consistent with the domain override.

Source

pub fn api_key( self, value: impl Into<String>, ) -> ConnectionOptionsBuilder<SetApiKey<S>>
where S::ApiKey: IsUnset,

Optional (Some / Option setters).

An API key to use for auth. If set, TLS will be enabled by default, but without any mTLS specific settings.

Source

pub fn maybe_api_key( self, value: Option<impl Into<String>>, ) -> ConnectionOptionsBuilder<SetApiKey<S>>
where S::ApiKey: IsUnset,

Optional (Some / Option setters).

An API key to use for auth. If set, TLS will be enabled by default, but without any mTLS specific settings.

Source

pub fn retry_options( self, value: RetryOptions, ) -> ConnectionOptionsBuilder<SetRetryOptions<S>>

Optional (Some / Option setters). Default: <RetryOptions as Default>::default().

Retry configuration for the server client. Default is RetryOptions::default

Source

pub fn maybe_retry_options( self, value: Option<RetryOptions>, ) -> ConnectionOptionsBuilder<SetRetryOptions<S>>

Optional (Some / Option setters). Default: <RetryOptions as Default>::default().

Retry configuration for the server client. Default is RetryOptions::default

Source

pub fn keep_alive( self, value: Option<ClientKeepAliveOptions>, ) -> ConnectionOptionsBuilder<SetKeepAlive<S>>
where S::KeepAlive: IsUnset,

Optional (Some / Option setters). Default: Some(ClientKeepAliveOptions::default()).

If set, HTTP2 gRPC keep alive will be enabled. To enable with default settings, use .keep_alive(Some(ClientKeepAliveConfig::default())).

Source

pub fn maybe_keep_alive( self, value: Option<Option<ClientKeepAliveOptions>>, ) -> ConnectionOptionsBuilder<SetKeepAlive<S>>
where S::KeepAlive: IsUnset,

Optional (Some / Option setters). Default: Some(ClientKeepAliveOptions::default()).

If set, HTTP2 gRPC keep alive will be enabled. To enable with default settings, use .keep_alive(Some(ClientKeepAliveConfig::default())).

Source

pub fn headers( self, value: HashMap<String, String>, ) -> ConnectionOptionsBuilder<SetHeaders<S>>
where S::Headers: IsUnset,

Optional (Some / Option setters).

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 ConnectionOptions::binary_headers. Invalid header keys or values will cause an error to be returned when connecting.

Source

pub fn maybe_headers( self, value: Option<HashMap<String, String>>, ) -> ConnectionOptionsBuilder<SetHeaders<S>>
where S::Headers: IsUnset,

Optional (Some / Option setters).

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 ConnectionOptions::binary_headers. Invalid header keys or values will cause an error to be returned when connecting.

Source

pub fn binary_headers( self, value: HashMap<String, Vec<u8>>, ) -> ConnectionOptionsBuilder<SetBinaryHeaders<S>>

Optional (Some / Option setters).

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.

Source

pub fn maybe_binary_headers( self, value: Option<HashMap<String, Vec<u8>>>, ) -> ConnectionOptionsBuilder<SetBinaryHeaders<S>>

Optional (Some / Option setters).

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.

Source

pub fn http_connect_proxy( self, value: HttpConnectProxyOptions, ) -> ConnectionOptionsBuilder<SetHttpConnectProxy<S>>

Optional (Some / Option setters).

HTTP CONNECT proxy to use for this client.

Source

pub fn maybe_http_connect_proxy( self, value: Option<HttpConnectProxyOptions>, ) -> ConnectionOptionsBuilder<SetHttpConnectProxy<S>>

Optional (Some / Option setters).

HTTP CONNECT proxy to use for this client.

Source

pub fn disable_error_code_metric_tags( self, value: bool, ) -> ConnectionOptionsBuilder<SetDisableErrorCodeMetricTags<S>>

Optional (Some / Option setters). Default: false.

If set true, error code labels will not be included on request failure metrics.

Source

pub fn maybe_disable_error_code_metric_tags( self, value: Option<bool>, ) -> ConnectionOptionsBuilder<SetDisableErrorCodeMetricTags<S>>

Optional (Some / Option setters). Default: false.

If set true, error code labels will not be included on request failure metrics.

Source

pub fn service_override( self, value: CallbackBasedGrpcService, ) -> ConnectionOptionsBuilder<SetServiceOverride<S>>

Optional (Some / Option setters).

If set, all gRPC calls will be routed through the provided service.

Source

pub fn maybe_service_override( self, value: Option<CallbackBasedGrpcService>, ) -> ConnectionOptionsBuilder<SetServiceOverride<S>>

Optional (Some / Option setters).

If set, all gRPC calls will be routed through the provided service.

Source

pub fn skip_get_system_info( self, value: bool, ) -> ConnectionOptionsBuilder<SetSkipGetSystemInfo<S>>

Optional (Some / Option setters). Default: false.

If set true, get_system_info will not be called upon connection.

Source

pub fn maybe_skip_get_system_info( self, value: Option<bool>, ) -> ConnectionOptionsBuilder<SetSkipGetSystemInfo<S>>

Optional (Some / Option setters). Default: false.

If set true, get_system_info will not be called upon connection.

Source

pub fn client_name( self, value: impl Into<String>, ) -> ConnectionOptionsBuilder<SetClientName<S>>
where S::ClientName: IsUnset,

Optional (Some / Option setters). Default: "temporal-rust".to_owned().

The name of the SDK being implemented on top of core. Is set as client-name header in all RPC calls

Source

pub fn maybe_client_name( self, value: Option<impl Into<String>>, ) -> ConnectionOptionsBuilder<SetClientName<S>>
where S::ClientName: IsUnset,

Optional (Some / Option setters). Default: "temporal-rust".to_owned().

The name of the SDK being implemented on top of core. Is set as client-name header in all RPC calls

Source

pub fn client_version( self, value: impl Into<String>, ) -> ConnectionOptionsBuilder<SetClientVersion<S>>

Optional (Some / Option setters). Default: VERSION.to_owned().

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.

Source

pub fn maybe_client_version( self, value: Option<impl Into<String>>, ) -> ConnectionOptionsBuilder<SetClientVersion<S>>

Optional (Some / Option setters). Default: VERSION.to_owned().

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,