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

pub trait NetworkListener: Clone {
    type Stream: NetworkStream + Send + Clone;
    fn accept(&mut self) -> Result<Self::Stream, Error>;
fn local_addr(&mut self) -> Result<SocketAddr, Error>; 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>;
{ ... }
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[src]

The stream produced for each connection.

Required methods

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

Returns an iterator of streams.

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

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> Iterator for NetworkConnections<'a, N> where
    N: 'a + NetworkListener
type Item = Result<<N as NetworkListener>::Stream, Error>;
[src]

Returns an iterator over incoming connections.

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

Sets the read timeout for all streams that are accepted

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

Sets the write timeout for all streams that are accepted

Implementors

impl NetworkListener for HttpListener[src]

type Stream = HttpStream

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

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

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

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

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

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

pub fn accept(&mut self) -> Result<<S as SslServer<HttpStream>>::Stream, Error>[src]

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

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

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