Struct hyper::server::Server [] [src]

pub struct Server<'a, H: Handler, L = HttpListener> {
    // some fields omitted
}

A server can listen on a TCP socket.

Once listening, it will create a Request/Response pair for each incoming connection, and hand them to the provided handler.

Methods

impl<'a, H: Handler, L: NetworkListener> Server<'a, H, L>
[src]

fn new(handler: H) -> Server<'a, H, L>

Creates a new server with the provided handler.

impl<'a, H: Handler + 'static> Server<'a, H, HttpListener>
[src]

fn http(handler: H) -> Server<'a, H, HttpListener>

Creates a new server that will handle HttpStreams.

fn https(handler: H, cert: &'a Path, key: &'a Path) -> Server<'a, H, HttpListener>

Creates a new server that will handler HttpStreamss using a TLS connection.

fn https_with_context(handler: H, ssl_context: SslContext) -> Server<'a, H, HttpListener>

Creates a new server that will handler HttpStreamss using a TLS connection defined by an SslContext.

impl<'a, H: Handler + 'static> Server<'a, H, HttpListener>
[src]

fn listen_threads<T: ToSocketAddrs>(self, addr: T, threads: usize) -> Result<Listening>

Binds to a socket, and starts handling connections using a task pool.

fn listen<T: ToSocketAddrs>(self, addr: T) -> Result<Listening>

Binds to a socket and starts handling connections.

impl<'a, H: Handler + 'static, L: NetworkListener<Stream=S> + Send + 'static, S: NetworkStream + Clone + Send> Server<'a, H, L>
[src]

fn with_listener(self, listener: L, threads: usize) -> Result<Listening>

Creates a new server that will handle HttpStreams.

Trait Implementations

impl<'a, H: Debug + Handler, L: Debug> Debug for Server<'a, H, L>
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.