Struct hyper::server::ServerExperimental
[-]
[+]
[src]
pub struct Server<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 Server<HttpListener>
fn http(ip: IpAddr, port: Port) -> Server
Creates a new server that will handle HttpStream
s.
fn many(pairs: Vec<(IpAddr, Port)>) -> Server
Creates a server that can listen to many (ip, port) pairs.
impl<L: NetworkListener<S, A>, S: NetworkStream, A: NetworkAcceptor<S>> Server<L>
fn listen_network<H, S, A, L>(self, handler: H) -> HttpResult<Listening<A>> where H: Handler<A, S>, S: NetworkStream, A: NetworkAcceptor<S>, L: NetworkListener<S, A>
Binds to a socket, and starts handling connections.
This method has unbound type parameters, so can be used when you want to use something other than the provided HttpStream, HttpAcceptor, and HttpListener.
fn listen<H: Handler<HttpAcceptor, HttpStream>>(self, handler: H) -> HttpResult<Listening<HttpAcceptor>>
Binds to a socket and starts handling connections.