Struct zhelezo::Iron [] [src]

pub struct Iron<H> {
    pub handler: Arc<H>,
    pub timeouts: Timeouts,
    pub pool: CpuPool,
    pub protocol: Protocol,
    pub local_address: Option<SocketAddr>,
}

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

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

Fields

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

Server timeouts.

Cpu pool to run synchronus requests on.

Defaults to num_cpus. Note that reading/writing to the client is handled asyncronusly in a single thread.

Protocol of the incoming requests

This is automatically set by the http and https functions, but can be set if you are manually constructing the hyper http instance.

Default host address to use when none is provided

When set, this provides a default host for any requests that don't provide one. When unset, any request without a host specified will fail.

Methods

impl<H: Handler> Iron<H>
[src]

[src]

Instantiate a new instance of Iron.

This will create a new Iron, 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.

Trait Implementations

impl<H: Handler> NewService for Iron<H>
[src]

Requests handled by the service

Responses given by the service

Errors produced by the service

The Service value created by this factory

[src]

Create and return a new service value.