Struct hyper::server::Server
[−]
[src]
pub struct Server<A> { /* fields omitted */ }
A Server that can accept incoming network requests.
Methods
impl<A: Accept> Server<A>
[src]
fn new(accepter: A, addr: SocketAddr) -> Server<A>
Creates a new Server from a Stream of Ios.
The addr is the socket address the accepter is listening on.
fn keep_alive(self, val: bool) -> Server<A>
Enables or disables HTTP keep-alive.
Default is true.
impl Server<Incoming>
[src]
fn http(addr: &SocketAddr, handle: &Handle) -> Result<Server<Incoming>>
Creates a new HTTP server config listening on the provided address.
impl<A: Accept> Server<A>
[src]
fn handle<H>(self, factory: H, handle: &Handle) -> Result<SocketAddr> where H: NewService<Request=Request, Response=Response, Error=Error> + Send + 'static
Binds to a socket and starts handling connections.
impl Server<()>
[src]
fn standalone<F>(closure: F) -> Result<(Listening, ServerLoop)> where F: FnOnce(&Handle) -> Result<SocketAddr>
Create a server that owns its event loop.
The returned ServerLoop
can be used to run the loop forever in the
thread. The returned Listening
can be sent to another thread, and
used to shutdown the ServerLoop
.