Trait hyper::net::NetworkListener [−][src]
pub trait NetworkListener: Clone {
type Stream: NetworkStream + Send + Clone;
fn accept(&mut self) -> Result<Self::Stream>;
fn local_addr(&mut self) -> Result<SocketAddr>;
fn incoming(&mut self) -> NetworkConnections<'_, Self>ⓘNotable traits for NetworkConnections<'a, N>impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> type Item = Result<N::Stream>;
{ ... }
fn set_read_timeout(&mut self, _: Option<Duration>) { ... }
fn set_write_timeout(&mut self, _: Option<Duration>) { ... }
}
Expand description
An abstraction to listen for connections on a certain port.
Associated Types
type Stream: NetworkStream + Send + Clone
type Stream: NetworkStream + Send + Clone
The stream produced for each connection.
Required methods
fn local_addr(&mut self) -> Result<SocketAddr>
fn local_addr(&mut self) -> Result<SocketAddr>
Get the address this Listener ended up listening on.
Provided methods
fn incoming(&mut self) -> NetworkConnections<'_, Self>ⓘNotable traits for NetworkConnections<'a, N>impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> type Item = Result<N::Stream>;
fn incoming(&mut self) -> NetworkConnections<'_, Self>ⓘNotable traits for NetworkConnections<'a, N>impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> type Item = Result<N::Stream>;
Notable traits for NetworkConnections<'a, N>
impl<'a, N: NetworkListener + 'a> Iterator for NetworkConnections<'a, N> type Item = Result<N::Stream>;
Returns an iterator over incoming connections.
fn set_read_timeout(&mut self, _: Option<Duration>)
fn set_read_timeout(&mut self, _: Option<Duration>)
Sets the read timeout for all streams that are accepted
fn set_write_timeout(&mut self, _: Option<Duration>)
fn set_write_timeout(&mut self, _: Option<Duration>)
Sets the write timeout for all streams that are accepted