Struct hyper::net::HttpListener
source · pub struct HttpListener { /* private fields */ }
Expand description
A NetworkListener
for HttpStream
s.
Implementations§
source§impl HttpListener
impl HttpListener
sourcepub fn new<To: ToSocketAddrs>(addr: To) -> Result<HttpListener>
pub fn new<To: ToSocketAddrs>(addr: To) -> Result<HttpListener>
Start listening to an address over HTTP.
Trait Implementations§
source§impl AsRawFd for HttpListener
impl AsRawFd for HttpListener
source§impl Clone for HttpListener
impl Clone for HttpListener
source§fn clone(&self) -> HttpListener
fn clone(&self) -> HttpListener
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 moresource§impl From<TcpListener> for HttpListener
impl From<TcpListener> for HttpListener
source§fn from(listener: TcpListener) -> HttpListener
fn from(listener: TcpListener) -> HttpListener
Converts to this type from the input type.
source§impl FromRawFd for HttpListener
impl FromRawFd for HttpListener
source§unsafe fn from_raw_fd(fd: RawFd) -> HttpListener
unsafe fn from_raw_fd(fd: RawFd) -> HttpListener
Constructs a new instance of
Self
from the given raw file
descriptor. Read moresource§impl NetworkListener for HttpListener
impl NetworkListener for HttpListener
§type Stream = HttpStream
type Stream = HttpStream
The stream produced for each connection.
source§fn accept(&mut self) -> Result<HttpStream>
fn accept(&mut self) -> Result<HttpStream>
Returns an iterator of streams.
source§fn local_addr(&mut self) -> Result<SocketAddr>
fn local_addr(&mut self) -> Result<SocketAddr>
Get the address this Listener ended up listening on.
source§fn set_read_timeout(&mut self, duration: Option<Duration>)
fn set_read_timeout(&mut self, duration: Option<Duration>)
Sets the read timeout for all streams that are accepted
source§fn set_write_timeout(&mut self, duration: Option<Duration>)
fn set_write_timeout(&mut self, duration: Option<Duration>)
Sets the write timeout for all streams that are accepted
source§fn incoming(&mut self) -> NetworkConnections<'_, Self> ⓘ
fn incoming(&mut self) -> NetworkConnections<'_, Self> ⓘ
Returns an iterator over incoming connections.