Enum hyper::net::HttpListener [] [src]

pub enum HttpListener {
    Http(TcpListener),
    Https(TcpListener, Arc<SslContext>),
}

A NetworkListener for HttpStreams.

Variants

Http

Http variant.

Https

Https variant. The two paths point to the certificate and key PEM files, in that order.

Methods

impl HttpListener

fn http<To: ToSocketAddrs>(addr: To) -> Result<HttpListener>

Start listening to an address over HTTP.

fn https<To: ToSocketAddrs>(addr: To, cert: &Path, key: &Path) -> Result<HttpListener>

Start listening to an address over HTTPS.

fn https_with_context<To: ToSocketAddrs>(addr: To, ssl_context: SslContext) -> Result<HttpListener>

Start listening to an address of HTTPS using the given SslContext

Trait Implementations

impl Clone for HttpListener

fn clone(&self) -> HttpListener

fn clone_from(&mut self, source: &Self)

impl NetworkListener for HttpListener

type Stream = HttpStream

fn accept(&mut self) -> Result<HttpStream>

fn local_addr(&mut self) -> Result<SocketAddr>

fn incoming(&mut self) -> NetworkConnections<Self>