Module iron::modifiers [] [src]

Defines a series of convenience modifiers for editing Responses

Modifiers can be used to edit Responses through the owning method set or the mutating set_mut, both of which are defined in the Set trait.

Instead of having a combinatorial explosion of Response methods and constructors, this provides a series of modifiers that can be used through the Set trait.

For instance, instead of Response::redirect constructing a redirect response, we provide a Redirect modifier, so you can just do:


let url = Url::parse("http://doc.rust-lang.org").unwrap();
Response::with((status::Found, Redirect(url)));

This is more extensible as it allows you to combine arbitrary modifiers without having a massive number of Response constructors.

For more information about the modifier system, see rust-modifier.

Structs

Header

A modifier for changing headers on requests and responses.

Redirect

A modifier for creating redirect responses.