pub struct GrpcConfig {
pub listen: SocketAddr,
pub proto: Vec<String>,
pub max_recv_message_size: usize,
pub max_send_message_size: usize,
pub timeout: Option<Duration>,
pub max_concurrent_streams: Option<u32>,
pub keepalive: Option<KeepaliveConfig>,
pub tls: Option<TlsConfig>,
pub compression: bool,
}Expand description
gRPC plugin configuration.
[grpc]
listen = "0.0.0.0:50051"
proto = ["proto/service.proto"]
max_recv_message_size = "4mb"
max_send_message_size = "4mb"
timeout = "30s"
max_concurrent_streams = 200
[grpc.keepalive]
interval = "60s"
timeout = "20s"
compression = true
[grpc.tls]
cert = "/path/to/cert.pem"
key = "/path/to/key.pem"Fields§
§listen: SocketAddr§proto: Vec<String>Proto files for gRPC reflection. Imports are resolved automatically. When empty, reflection is disabled.
max_recv_message_size: usizeMaximum incoming message size. Accepts: “4mb”, “512kb”, or raw bytes as integer. Default: 4 MiB.
max_send_message_size: usizeMaximum outgoing message size. Accepts: “4mb”, “512kb”, or raw bytes as integer. Default: 4 MiB.
timeout: Option<Duration>Server-wide RPC timeout. Default: none (no timeout).
max_concurrent_streams: Option<u32>Maximum HTTP/2 concurrent streams per connection.
keepalive: Option<KeepaliveConfig>HTTP/2 keepalive configuration.
tls: Option<TlsConfig>TLS configuration. If set, the server uses TLS (rustls).
compression: boolEnable gzip compression for gRPC messages. Default: false.
Trait Implementations§
Source§impl Clone for GrpcConfig
impl Clone for GrpcConfig
Source§fn clone(&self) -> GrpcConfig
fn clone(&self) -> GrpcConfig
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 GrpcConfig
impl Debug for GrpcConfig
Source§impl Default for GrpcConfig
impl Default for GrpcConfig
Source§impl<'de> Deserialize<'de> for GrpcConfigwhere
GrpcConfig: Default,
impl<'de> Deserialize<'de> for GrpcConfigwhere
GrpcConfig: 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
Auto Trait Implementations§
impl Freeze for GrpcConfig
impl RefUnwindSafe for GrpcConfig
impl Send for GrpcConfig
impl Sync for GrpcConfig
impl Unpin for GrpcConfig
impl UnsafeUnpin for GrpcConfig
impl UnwindSafe for GrpcConfig
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
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>
Wrap the input message
T in a tonic::Request