pub struct ClientOptions {
pub max_json_payload_size: usize,
pub max_identifier_length: usize,
pub tls: Option<TlsConfig>,
pub connect_timeout: Option<Duration>,
pub max_grpc_message_size: Option<usize>,
pub keepalive_interval: Option<Duration>,
pub keepalive_timeout: Option<Duration>,
}Expand description
Configuration options for TaskHubGrpcClient.
All fields have sensible defaults. Use ClientOptions::default() or the
builder methods to customise.
§Examples
use dapr_durabletask::client::{ClientOptions, TlsConfig};
use std::time::Duration;
let opts = ClientOptions::new()
.with_tls(TlsConfig::default())
.with_connect_timeout(Duration::from_secs(5))
.with_max_grpc_message_size(16 * 1024 * 1024);Fields§
§max_json_payload_size: usizeMaximum JSON payload size in bytes for deserialisation.
max_identifier_length: usizeMaximum allowed length (in bytes) for identifiers such as orchestrator names, instance IDs, and event names.
tls: Option<TlsConfig>TLS configuration. When None the connection is plaintext.
connect_timeout: Option<Duration>Timeout for establishing the initial TCP connection to the sidecar.
max_grpc_message_size: Option<usize>Maximum size in bytes for inbound gRPC messages. Defaults to tonic’s built-in 4 MiB limit when not set.
keepalive_interval: Option<Duration>Duration between TCP keepalive probes sent to the sidecar.
keepalive_timeout: Option<Duration>Duration to wait for a keepalive acknowledgement before closing the connection.
Implementations§
Source§impl ClientOptions
impl ClientOptions
Sourcepub fn with_max_json_payload_size(self, limit: usize) -> Self
pub fn with_max_json_payload_size(self, limit: usize) -> Self
Set the maximum JSON payload size in bytes.
Sourcepub fn with_max_identifier_length(self, limit: usize) -> Self
pub fn with_max_identifier_length(self, limit: usize) -> Self
Set the maximum identifier length in bytes.
Sourcepub fn with_tls(self, tls: TlsConfig) -> Self
pub fn with_tls(self, tls: TlsConfig) -> Self
Enable TLS with the given configuration.
Pass TlsConfig::default() to use system CA certificates.
Sourcepub fn with_connect_timeout(self, timeout: Duration) -> Self
pub fn with_connect_timeout(self, timeout: Duration) -> Self
Set the timeout for the initial TCP connection.
Sourcepub fn with_max_grpc_message_size(self, size: usize) -> Self
pub fn with_max_grpc_message_size(self, size: usize) -> Self
Set the maximum inbound gRPC message size in bytes.
Sourcepub fn with_keepalive_interval(self, interval: Duration) -> Self
pub fn with_keepalive_interval(self, interval: Duration) -> Self
Set the interval between TCP keepalive probes.
Sourcepub fn with_keepalive_timeout(self, timeout: Duration) -> Self
pub fn with_keepalive_timeout(self, timeout: Duration) -> Self
Set the timeout for a keepalive acknowledgement.
Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Source§fn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientOptions
impl Debug for ClientOptions
Auto Trait Implementations§
impl Freeze for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnsafeUnpin 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