Struct saphir::server::ListenerBuilder
source · pub struct ListenerBuilder { /* private fields */ }
Implementations§
source§impl ListenerBuilder
impl ListenerBuilder
pub fn new() -> Self
pub fn interface(self, s: &str) -> Self
pub fn request_timeout<T: Into<Option<u64>>>(self, timeout_ms: T) -> Self
pub fn server_name(self, name: &str) -> Self
pub fn request_body_max_bytes<I: Into<Option<usize>>>(self, size: I) -> Self
sourcepub fn shutdown<F: Future<Output = ()> + Unpin + Send + 'static>(
self,
signal: F,
graceful: bool
) -> Self
pub fn shutdown<F: Future<Output = ()> + Unpin + Send + 'static>( self, signal: F, graceful: bool ) -> Self
Set a shutdown signal to terminate the server.
If graceful
is set to true
, the server will wait for all ongoing
request to be completed before shutting down but will stop accepting
new requests.
sourcepub fn set_ssl_certificates(self, cert_path: &str, key_path: &str) -> Self
Available on crate feature https
only.
pub fn set_ssl_certificates(self, cert_path: &str, key_path: &str) -> Self
https
only.Using Feature https
Set the listener ssl certificates files. The cert needs to be PEM encoded while the key can be either RSA or PKCS8
sourcepub fn set_ssl_config(
self,
cert_config: SslConfig,
key_config: SslConfig
) -> Self
Available on crate feature https
only.
pub fn set_ssl_config( self, cert_config: SslConfig, key_config: SslConfig ) -> Self
https
only.Using Feature https
Set the listener ssl config. The cert needs to be PEM encoded while the key can be either RSA or PKCS8. The file path can be used or the file content directly where all \n and space have been removed.
Trait Implementations§
source§impl Default for ListenerBuilder
impl Default for ListenerBuilder
source§fn default() -> ListenerBuilder
fn default() -> ListenerBuilder
Returns the “default value” for a type. Read more