pub async fn bind(self) -> Result<Bound, Error> {
        let tls_key = self.server_tls_key.ok_or(Error::NoTlsKey)?;
        let tls_certs = self.server_tls_certs.ok_or(Error::NoTlsCerts)?;

        // Ensure the TLS key and certificate files load properly before binding the socket and
        // spawning the server.
        let _ = load_tls(&tls_key, &tls_certs).await?;

        let tcp = TcpListener::bind(&self.server_addr)
            .await
            .map_err(|e| Error::Bind(self.server_addr, e))?;
        let local_addr = tcp.local_addr().map_err(Error::LocalAddr)?;
        Ok(Bound {
            local_addr,
            tcp,
            tls_key,
            tls_certs,
        })
    }
/// Attempts to load credentials and bind the server socket
Attempts to load credentials and bind the server socket
Attempts to load credentials and bind the server socket
pub async fn bind(self) -> Result<Bound, Error> {
        let tls_key = self.server_tls_key.ok_or(Error::NoTlsKey)?;
        let tls_certs = self.server_tls_certs.ok_or(Error::NoTlsCerts)?;
        // Ensure the TLS key and certificate files load properly before binding the socket and
        // spawning the server.
        let _ = load_tls(&tls_key, &tls_certs).await?;
        let tcp = TcpListener::bind(&self.server_addr)
            .await
            .map_err(|e| Error::Bind(self.server_addr, e))?;
        let local_addr = tcp.local_addr().map_err(Error::LocalAddr)?;
        Ok(Bound {
            local_addr,
            tcp,
            tls_key,
            tls_certs,
        })
    }
pub async fn bind ( self ) -> Result < Bound , Error > { let tls_key = self . server_tls_key . ok_or ( Error :: NoTlsKey ) ? ; let tls_certs = self . server_tls_certs . ok_or ( Error :: NoTlsCerts ) ? ; // Ensure the TLS key and certificate files load properly before binding the socket and // spawning the server. let _ = load_tls ( & tls_key , & tls_certs ) . await ? ; let tcp = TcpListener :: bind ( & self . server_addr ) . await . map_err ( | e | Error :: Bind ( self . server_addr , e ) ) ? ; let local_addr = tcp . local_addr ( ) . map_err ( Error :: LocalAddr ) ? ; Ok ( Bound { local_addr , tcp , tls_key , tls_certs , } ) }
Attempts to load credentials and bind the server socket
Attempts to load credentials and bind the server socket
self
self