Struct ferrum::Ferrum [] [src]

pub struct Ferrum<H> where
    H: Handler
{ pub handler: H, pub keep_alive: bool, pub timeout: Option<Duration>, pub num_threads: usize, }

The primary entrance point to Ferrum, a struct to instantiate a new server.

Ferrum contains the Handler which takes a Request and produces a Response.

Fields

Ferrum contains a Handler, which it uses to create responses for client requests.

Controls the timeout for keep alive connections.

The default is true.

Server timeout.

The number of request handling threads.

Defaults to num_cpus.

Methods

impl<H> Ferrum<H> where
    H: Handler
[src]

[src]

Instantiate a new instance of Ferrum.

This will create a new Ferrum, the base unit of the server, using the passed in Handler.

[src]

Kick off the server process using the HTTP protocol.

Call this once to begin listening for requests on the server. This consumes the Ferrum instance. This method will block the current thread executing the HTTP server.

[src]

Bind the provided addr and return a server ready to handle connections.