Enum hyper::net::HttpListener
[−]
[src]
pub enum HttpListener { Http(TcpListener), Https(TcpListener, Arc<SslContext>), }
A NetworkListener
for HttpStream
s.
Variants
Http(TcpListener)
Http variant.
Https(TcpListener, Arc<SslContext>)
Https variant. The two paths point to the certificate and key PEM files, in that order.
Methods
impl HttpListener
[src]
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
[src]
fn clone(&self) -> HttpListener
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl NetworkListener for HttpListener
[src]
type Stream = HttpStream
The stream produced for each connection.
fn accept(&mut self) -> Result<HttpStream>
Listens on a socket. Returns an iterator of streams. Read more
fn local_addr(&mut self) -> Result<SocketAddr>
Get the address this Listener ended up listening on.
fn incoming(&mut self) -> NetworkConnections<Self>
Closes the Acceptor, so no more incoming connections will be handled. Returns an iterator over incoming connections. Read more