pub struct ServerConfig { /* private fields */ }Expand description
Server configuration.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn new(addr: SocketAddr) -> Self
pub fn new(addr: SocketAddr) -> Self
Configure using a socket addr using the Http scheme.
Sourcepub fn with_scheme(self, scheme: Scheme) -> Self
pub fn with_scheme(self, scheme: Scheme) -> Self
Set the scheme used by the the server. A Https scheme requires a TLS config factor.
Sourcepub fn with_connection_middleware(
self,
middleware: ConnectionMiddleware,
) -> Self
pub fn with_connection_middleware( self, middleware: ConnectionMiddleware, ) -> Self
Register a function that acts a connection middleware on any accepted connection. The middleware is able to modify every incoming request.
Sourcepub fn with_tls_config(self, tls: impl Into<TlsConfigFactory>) -> Self
pub fn with_tls_config(self, tls: impl Into<TlsConfigFactory>) -> Self
Register a TlsConfigFactory, which is a function that gets invoked when TLS is enabled.
Sourcepub fn with_cancellation_token(self, cancel: CancellationToken) -> Self
pub fn with_cancellation_token(self, cancel: CancellationToken) -> Self
Register a cancellation token that enables graceful shutdown.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerConfig
impl !RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin 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
Mutably borrows from an owned value. Read more