pub struct ServerConfig {
pub endpoint: String,
pub tls_setting: TlsServerConfig,
pub http2_only: bool,
pub max_frame_size: Option<u32>,
pub max_concurrent_streams: Option<u32>,
pub max_header_list_size: Option<u32>,
pub read_buffer_size: Option<usize>,
pub write_buffer_size: Option<usize>,
pub keepalive: KeepaliveServerParameters,
pub auth: AuthenticationConfig,
}Fields§
§endpoint: StringEndpoint is the address to listen on.
tls_setting: TlsServerConfigConfigures the protocol to use TLS.
http2_only: boolUse HTTP 2 only.
max_frame_size: Option<u32>Maximum size (in MiB) of messages accepted by the server.
max_concurrent_streams: Option<u32>MaxConcurrentStreams sets the limit on the number of concurrent streams to each ServerTransport.
max_header_list_size: Option<u32>Max header list size
read_buffer_size: Option<usize>ReadBufferSize for gRPC server.
write_buffer_size: Option<usize>WriteBufferSize for gRPC server.
keepalive: KeepaliveServerParametersKeepalive anchor for all the settings related to keepalive.
auth: AuthenticationConfigAuth for this receiver.
Implementations§
Source§impl ServerConfig
Convert ServerConfig to IncomingServerConfig
This function takes a ServerConfig and a service and returns a ServerFuture.
The ServerFuture is a boxed future that returns a Result<(), tonic::transport::Error>.
The ServerFuture is created by creating a new TcpIncoming and then creating a new Server.
impl ServerConfig
Convert ServerConfig to IncomingServerConfig This function takes a ServerConfig and a service and returns a ServerFuture. The ServerFuture is a boxed future that returns a Result<(), tonic::transport::Error>. The ServerFuture is created by creating a new TcpIncoming and then creating a new Server.
pub fn with_endpoint(endpoint: &str) -> Self
pub fn with_tls_settings(self, tls_setting: TLSSetting) -> Self
pub fn with_http2_only(self, http2_only: bool) -> Self
pub fn with_max_frame_size(self, max_frame_size: Option<u32>) -> Self
pub fn with_max_concurrent_streams( self, max_concurrent_streams: Option<u32>, ) -> Self
pub fn with_max_header_list_size( self, max_header_list_size: Option<u32>, ) -> Self
pub fn with_read_buffer_size(self, read_buffer_size: Option<usize>) -> Self
pub fn with_write_buffer_size(self, write_buffer_size: Option<usize>) -> Self
pub fn with_keepalive(self, keepalive: KeepaliveServerParameters) -> Self
pub fn with_auth(self, auth: AuthenticationConfig) -> Self
pub fn to_server_future<S>( &self, svc: &[S], ) -> Result<Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>, ConfigError>
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Configuration for ServerConfig
impl Configuration for ServerConfig
Source§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
Default values for ServerConfig
impl Default for ServerConfig
Default values for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
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>,
Source§impl Display for ServerConfig
Display implementation for ServerConfig
This is used to print the ServerConfig in a human-readable format.
impl Display for ServerConfig
Display implementation for ServerConfig This is used to print the ServerConfig in a human-readable format.
Source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
Source§fn eq(&self, other: &ServerConfig) -> bool
fn eq(&self, other: &ServerConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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,
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>
T in a tonic::Request