Trait rocket::http::hyper::net::NetworkListener[][src]

pub trait NetworkListener: Clone {
    type Stream: NetworkStream + Clone + Send;
    pub fn accept(&mut self) -> Result<Self::Stream, Error>;
pub fn local_addr(&mut self) -> Result<SocketAddr, Error>; pub fn incoming(&mut self) -> NetworkConnections<'_, Self>

Notable traits for NetworkConnections<'a, N>

impl<'a, N> Iterator for NetworkConnections<'a, N> where
    N: 'a + NetworkListener
type Item = Result<<N as NetworkListener>::Stream, Error>;
{ ... }
pub fn set_read_timeout(&mut self, Option<Duration>) { ... }
pub fn set_write_timeout(&mut self, Option<Duration>) { ... } }

An abstraction to listen for connections on a certain port.

Associated Types

type Stream: NetworkStream + Clone + Send[src]

The stream produced for each connection.

Loading content...

Required methods

pub fn accept(&mut self) -> Result<Self::Stream, Error>[src]

Returns an iterator of streams.

pub fn local_addr(&mut self) -> Result<SocketAddr, Error>[src]

Get the address this Listener ended up listening on.

Loading content...

Provided methods

pub fn incoming(&mut self) -> NetworkConnections<'_, Self>

Notable traits for NetworkConnections<'a, N>

impl<'a, N> Iterator for NetworkConnections<'a, N> where
    N: 'a + NetworkListener
type Item = Result<<N as NetworkListener>::Stream, Error>;
[src]

Returns an iterator over incoming connections.

pub fn set_read_timeout(&mut self, Option<Duration>)[src]

Sets the read timeout for all streams that are accepted

pub fn set_write_timeout(&mut self, Option<Duration>)[src]

Sets the write timeout for all streams that are accepted

Loading content...

Implementors

impl NetworkListener for HttpListener[src]

type Stream = HttpStream

impl<S> NetworkListener for HttpsListener<S> where
    S: SslServer<HttpStream> + Clone
[src]

type Stream = <S as SslServer<HttpStream>>::Stream

Loading content...