pub fn spawn<S, B>(self, service: S, drain: drain::Watch) -> SpawnedServer
    where
        S: Service<hyper::Request<hyper::Body>, Response = hyper::Response<B>>
            + Clone
            + Send
            + 'static,
        S::Error: std::error::Error + Send + Sync,
        S::Future: Send,
        B: hyper::body::HttpBody + Send + 'static,
        B::Data: Send,
        B::Error: std::error::Error + Send + Sync,
    {
        let Self {
            local_addr,
            tcp,
            tls_key,
            tls_certs,
        } = self;

        let task = tokio::spawn(
            accept_loop(tcp, drain, service, tls_key, tls_certs)
                .instrument(info_span!("server", port = %local_addr.port())),
        );

        SpawnedServer { local_addr, task }
    }
/// Bind an HTTPS server to the configured address with the provided service
///
/// The server terminates gracefully when the provided `drain` handle is signaled.
///
/// TLS credentials are read from the configured paths _for each connection_ to support
/// certificate rotation. As such, it is not recommended to expose this server to the open
/// internet or to clients that open many short-lived connections. It is primarily intended for
/// kubernetes admission controllers.
Bind an HTTPS server to the configured address with the provided service
The server terminates gracefully when the provided `drain` handle is signaled.

TLS credentials are read from the configured paths _for each connection_ to support
certificate rotation. As such, it is not recommended to expose this server to the open
internet or to clients that open many short-lived connections. It is primarily intended for
kubernetes admission controllers.
Bind an HTTPS server to the configured address with the provided service The server terminates gracefully when the provided ` drain ` handle is signaled . TLS credentials are read from the configured paths _for each connection_ to support certificate rotation . As such it is not recommended to expose this server to the open internet or to clients that open many short - lived connections . It is primarily intended for kubernetes admission controllers .
pub fn spawn<S, B>(self, service: S, drain: drain::Watch) -> SpawnedServer
    where
        S: Service<hyper::Request<hyper::Body>, Response = hyper::Response<B>>
            + Clone
            + Send
            + 'static,
        S::Error: std::error::Error + Send + Sync,
        S::Future: Send,
        B: hyper::body::HttpBody + Send + 'static,
        B::Data: Send,
        B::Error: std::error::Error + Send + Sync,
    {
        let Self {
            local_addr,
            tcp,
            tls_key,
            tls_certs,
        } = self;
        let task = tokio::spawn(
            accept_loop(tcp, drain, service, tls_key, tls_certs)
                .instrument(info_span!("server", port = %local_addr.port())),
        );
        SpawnedServer { local_addr, task }
    }
pub fn spawn < S , B > ( self , service : S , drain : drain :: Watch ) -> SpawnedServer where S : Service < hyper :: Request < hyper :: Body > , Response = hyper :: Response < B > > + Clone + Send + ' static , S :: Error : std :: error :: Error + Send + Sync , S :: Future : Send , B : hyper :: body :: HttpBody + Send + ' static , B :: Data : Send , B :: Error : std :: error :: Error + Send + Sync , { let Self { local_addr , tcp , tls_key , tls_certs , } = self ; let task = tokio :: spawn ( accept_loop ( tcp , drain , service , tls_key , tls_certs ) . instrument ( info_span ! ( " " port local_addr port ( ) ) ) , ) ; SpawnedServer { local_addr , task } }
Bind an HTTPS server to the configured address with the provided service
The server terminates gracefully when the provided `drain` handle is signaled.
Bind an HTTPS server to the configured address with the provided service The server terminates gracefully when the provided ` drain ` handle is signaled .
self
service
S
drain
drain::Watch
self
service
S
drain
drain::Watch