pub struct HttpServerConfig {
pub ip: String,
pub port: u16,
pub tls_config: Option<ServerConfig>,
}Fields§
§ip: String§port: u16§tls_config: Option<ServerConfig>Implementations§
Source§impl HttpServerConfig
impl HttpServerConfig
pub fn new(ip: impl Into<String>, port: u16) -> Self
Sourcepub fn tls(
self,
tls_server_cert_path: impl AsRef<Path>,
tls_server_key_path: impl AsRef<Path>,
) -> Self
pub fn tls( self, tls_server_cert_path: impl AsRef<Path>, tls_server_key_path: impl AsRef<Path>, ) -> Self
Enables TLS for incoming connections using the provided server certificate and private key in .pem format and
configures the TLS context and sets supported ALPN protocols to allow HTTP/2 and HTTP/1.1.
Auto Trait Implementations§
impl Freeze for HttpServerConfig
impl !RefUnwindSafe for HttpServerConfig
impl Send for HttpServerConfig
impl Sync for HttpServerConfig
impl Unpin for HttpServerConfig
impl UnsafeUnpin for HttpServerConfig
impl !UnwindSafe for HttpServerConfig
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