pub struct GrpcClientConfig {
pub target: String,
pub tls: Option<TlsConfig>,
pub timeout: Duration,
pub connect_timeout: Duration,
pub keepalive_interval: Option<Duration>,
pub keepalive_timeout: Option<Duration>,
pub max_message_size: usize,
pub max_send_message_size: usize,
pub resilience_policy: Option<Policy>,
}Expand description
Configuration for a gRPC client channel.
Fields§
§target: StringTarget address for the gRPC server (for example localhost:50051).
tls: Option<TlsConfig>Optional shared TLS configuration. When omitted, the channel uses plaintext.
timeout: DurationDefault timeout for unary RPCs.
connect_timeout: DurationTimeout for establishing a connection.
keepalive_interval: Option<Duration>Keepalive interval (time between pings when no active streams).
keepalive_timeout: Option<Duration>Keepalive timeout (how long to wait for ping ack before closing).
max_message_size: usizeMaximum message size for receiving (in bytes).
max_send_message_size: usizeMaximum message size for sending (in bytes).
resilience_policy: Option<Policy>Optional transport resilience policy.
Implementations§
Source§impl GrpcClientConfig
impl GrpcClientConfig
Sourcepub fn new(target: impl Into<String>) -> Self
pub fn new(target: impl Into<String>) -> Self
Create a new GrpcClientConfig with the given target.
Sourcepub fn with_tls(self, tls: TlsConfig) -> Self
pub fn with_tls(self, tls: TlsConfig) -> Self
Enable TLS with shared security configuration and default modern roots.
Sourcepub fn with_resilience_policy(self, policy: Policy) -> Self
pub fn with_resilience_policy(self, policy: Policy) -> Self
Set the transport resilience policy.
Trait Implementations§
Source§impl Clone for GrpcClientConfig
impl Clone for GrpcClientConfig
Source§fn clone(&self) -> GrpcClientConfig
fn clone(&self) -> GrpcClientConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GrpcClientConfig
impl Debug for GrpcClientConfig
Source§impl Default for GrpcClientConfig
impl Default for GrpcClientConfig
Source§impl<'de> Deserialize<'de> for GrpcClientConfigwhere
GrpcClientConfig: Default,
impl<'de> Deserialize<'de> for GrpcClientConfigwhere
GrpcClientConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<GrpcClientConfig> for DiscoveryChannelConfig
impl From<GrpcClientConfig> for DiscoveryChannelConfig
Source§fn from(grpc: GrpcClientConfig) -> Self
fn from(grpc: GrpcClientConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for GrpcClientConfig
impl !UnwindSafe for GrpcClientConfig
impl Freeze for GrpcClientConfig
impl Send for GrpcClientConfig
impl Sync for GrpcClientConfig
impl Unpin for GrpcClientConfig
impl UnsafeUnpin for GrpcClientConfig
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Wrap the input message
T in a tonic::Request