Commit Graph

13 Commits

Author SHA1 Message Date
Sergio Benitez 44f5f1998d New HTTP types: ContentType, Status. Responder/Handler/ErrorHandler changed.
This is a complete rework of `Responder`s and of the http backend in
general. This gets Rocket one step closer to HTTP library independence,
enabling many future features such as transparent async I/O, automatic
HEAD request parsing, pre/post hooks, and more.

Summary of changes:

  * `Responder::response` no longer takes in `FreshHyperResponse`.
    Instead, it returns a new `Response` type.
  * The new `Response` type now encapsulates a full HTTP response. As a
    result, `Responder`s now return it.
  * The `Handler` type now returns an `Outcome` directly.
  * The `ErrorHandler` returns a `Result`. It can no longer forward,
    which made no sense previously.
  * `Stream` accepts a chunked size parameter.
  * `StatusCode` removed in favor of new `Status` type.
  * `ContentType` significantly modified.
  * New, lightweight `Header` type that plays nicely with `Response`.
2016-12-15 00:47:31 -08:00
Sergio Benitez d24d5534f4 Return a 404 when a file isn't found. 2016-11-02 17:47:00 +01:00
Sergio Benitez c98d047038 Add URI::percent_decoding helper method. Safeguard Pathbuf FromSegments implementation. 2016-11-02 16:55:56 +01:00
Sergio Benitez 4b6c72e33f Use move builder pattern to launch Rocket apps. 2016-10-03 19:48:33 -07:00
Sergio Benitez 7b1dc5a1a4 Remove Rocket::new(). Use 'ignite' everywhere. 2016-10-03 19:37:49 -07:00
Sergio Benitez 4e03bb6107 Add NamedFile response type. 2016-09-12 01:51:02 -07:00
Sergio Benitez 46f73ed57c Renamed macros to codegen. 2016-09-08 20:38:58 -07:00
Sergio Benitez 32bf3e1737 Add more files to static_files example. 2016-09-08 00:02:35 -07:00
Sergio Benitez b755e53f63 Add trailing params. 2016-09-08 00:02:17 -07:00
Sergio Benitez 4d301eebbd Complete overhaul complete. 2016-09-04 04:06:28 -07:00
Sergio Benitez 025c9243c0 Now using a Cargo workspace for (much!) faster builds. Added a temporary query
params example.
2016-08-10 17:50:08 -07:00
Sergio Benitez cddc92f870 Now support Result responses.
Experimented with the new impl specialization features of Rust. They work! But
they're not quite there yet. Specifically, I was able to specialize on
`Responder`, but when trying to remove the macro in `FromParam`, it didn't work.
See https://github.com/rust-lang/rust/issues/31844.
2016-03-22 17:16:17 -07:00
Sergio Benitez 877b37c903 Polished examples directory. Fixed `File` response bug. 2016-03-22 16:27:12 -07:00