Commit Graph

129 Commits

Author SHA1 Message Date
Sergio Benitez 5447f81f77 Remove RequestOutcome, ResponseOutcome in favor of Outcome. Remove Failure response type. 2016-10-25 11:17:49 +02:00
Sergio Benitez 2f04027c5f Document the testing module. 2016-10-25 10:16:34 +02:00
Sergio Benitez 11b6158276 Refine request module API docs. 2016-10-24 10:09:50 +02:00
Sergio Benitez e70fcd78b9 Properly escape ticks for markdown in Form docs. 2016-10-21 09:06:40 -07:00
Sergio Benitez 2da43e24f7 Document most of the request module. 2016-10-21 02:56:57 -07:00
Sergio Benitez 81f45608a1 Document outcome module. 2016-10-19 00:30:02 -07:00
Sergio Benitez 2a0535e1f7 Document the config module. 2016-10-18 12:04:56 -07:00
Sergio Benitez 5a1a303c59 Document the http module. 2016-10-17 19:29:58 -07:00
Sergio Benitez 762b38efe9 Add fragment support to URI type. 2016-10-17 17:21:29 -07:00
Sergio Benitez a145a11848 Add tests to the hello_world, helllo_ranks, and hello_person examples. 2016-10-17 15:14:57 -07:00
Sergio Benitez 33f0274f62 Remove unused Rocket::config method. 2016-10-16 03:21:34 -07:00
Sergio Benitez bc5ecb31df Implement a small testing framework in the 'testing' module. 2016-10-16 03:16:16 -07:00
Sergio Benitez 3008820494 Seperate request dispatch into hyper and non-hyper parts. 2016-10-16 00:03:08 -07:00
Sergio Benitez 471239c567 Protect the session_key from external libs. Clean-up config docs. 2016-10-15 18:58:57 -07:00
Sergio Benitez cf9f746ee2 Remove question_mark feature: it's been stabalized! 2016-10-14 19:07:22 -07:00
Sergio Benitez 1323e7a420 Add `config::get()`, for global config access. Use it for `Template`. 2016-10-14 18:57:36 -07:00
Sergio Benitez 722f613686 Use Outcome as the result of all fallible conversions. 2016-10-13 18:39:23 -07:00
Sergio Benitez b4305cb430 Use 'Content-Type' for format routing. Simplify 'raw_upload' example. 2016-10-12 19:08:19 -07:00
Sergio Benitez 2f35b23514 Remove non-streaming requests. Use streaming requests everywhere.
This commit includes the following important API changes:

  * The `form` route parameter has been removed.
  * The `data` route parameter has been added.
  * Forms are not handled via the `data` parameter and `Form` type.
  * Removed the `data` parameter from `Request`.
  * Added `FromData` conversion trate and default implementation.
  * Added `DataOutcome` enum, which is the return type of `from_data`.
  * 'FromData' is now used to automatically derive the `data` parameter.
  * Moved `form` into `request` module.
  * Removed `Failure::new` in favor of direct value construction.

This commit includes the following important package additions:

  * Added a 'raw_upload' example.
  * `manual_routes` example uses `Data` parameter.
  * Now building and running tests with `--all-features` flag.
  * All exmaples have been updated to latest API.
  * Now using upstream Tera.

This commit includes the following important fixes:

  * Any valid ident is now allowed in single-parameter route parameters.
  * Lifetimes are now properly stripped in code generation.
  * `FromForm` derive now works on empty structs.
2016-10-12 00:14:42 -07:00
Sergio Benitez d8db812856 Implement streaming requests. 2016-10-09 04:29:02 -07:00
Sergio Benitez 07204a25dd Remove Rocket::from_hyp in favor of Rocket::new. 2016-10-08 21:37:28 -07:00
Sergio Benitez a7b180c911 Remove Empty response. 2016-10-08 20:57:39 -07:00
Sergio Benitez 619b1d787e Rename Response::new to complete. Add Response::failure using newly added Failure response. 2016-10-08 20:53:04 -07:00
Sergio Benitez 0144b70fac Cleanup documentation related code. 2016-10-08 04:42:22 -07:00
Sergio Benitez e30e4e6c7f Make 'http' public. 2016-10-08 04:29:20 -07:00
Sergio Benitez c4b817ae0b Cleanup dispatch messages and comments. 2016-10-07 23:37:29 -07:00
Sergio Benitez 8c0d11feab Completely new raw API.
Summary of changes:

  * Request no longer has a lifetime parameter.
  * Handler type now includes a `Data` parameter.
  * Response is now an enum that is either `Complete` or `Forward`.
  * Outcome enum is now one of: Success, Failure, Forward.
  * Outcome::Foward for Responses must include StatusCode.
  * Responders are now final: they cannot forward to requests. (!!)
  * Responsers may only forward to catchers. (!!)
  * Response no longer provides wrapping methods.
  * Route is now cloneable.

This change is fundamental to enabling streaming requests.
2016-10-07 23:20:49 -07:00
Sergio Benitez 59623d936f Add a default template for every known error code. 2016-10-07 21:31:52 -07:00
Sergio Benitez 37e6a367b8 Move the form module under request and outcome to top-level. 2016-10-07 19:27:50 -07:00
Sergio Benitez be3530bb44 Make Outcome generic on its encapsulated type. 2016-10-07 19:09:05 -07:00
Sergio Benitez 6578de4615 Always inline appropriate Request methods. 2016-10-06 21:04:35 -07:00
Sergio Benitez 39f7f2d32b Remove unneeded lifetime in Request.
Previously, a Request's only lifetime parameter referred to itself. This
causes many issues and is simply wrong. Instead, use `transmute` to make
the lifetime `static`. As long the contents inside Request don't move or
change, the references are valid. We keep the lifetime as a phantom in
`Request` for future use.
2016-10-06 20:57:17 -07:00
Sergio Benitez bcb9bd860b Allow different lifetimes in handler Request reference and its contents. 2016-10-06 20:38:13 -07:00
Sergio Benitez 639a78a8d6 Add a bad_request response type. Use it when form's aren't utf8. 2016-10-06 00:16:15 -07:00
Sergio Benitez 650d079b58 Make the `uri` parameter in Request private. 2016-10-06 00:08:00 -07:00
Sergio Benitez d4f9525b22 Allow error handlers to take 0, 1, or 2 parameters.
fixes #13
2016-10-04 15:05:25 -07:00
Sergio Benitez 63d31e8082 Simplify a branch in check_config macro. 2016-10-04 15:05:25 -07:00
Sergio Benitez 2ad508ed96 Test config and environments.
resolves #11
2016-10-04 15:05:25 -07:00
Sergio Benitez 463df9d1df New version: 0.0.10. 2016-10-04 15:05:16 -07: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 d631dfd300 Use ignite in README example. Check ROCKET_ENV without Rocket.toml being present. 2016-10-03 19:21:21 -07:00
Sergio Benitez 647efe15d1 Move uri module into http namespace. 2016-10-03 17:25:27 -07:00
Sergio Benitez 74ec26db95 Namespace HTTP-related type under `http`. 2016-10-03 17:09:13 -07:00
Sergio Benitez 17b88d0a6b Implement configuration and environments. 2016-10-03 03:39:56 -07:00
Sergio Benitez 39c979db4c Add library and usage information to main API doc. 2016-10-02 17:52:04 -07:00
Sergio Benitez 7dc6e432b8 Change wordering of ContentType structure docs. 2016-09-30 20:31:32 -07:00
Sergio Benitez 320f2e0efa Document Request. 2016-09-30 20:22:06 -07:00
Sergio Benitez 9e402dfd07 Revert visibility change in ContentType constructor. 2016-09-30 20:10:49 -07:00
Sergio Benitez 57f79ca867 Document ContentType. 2016-09-30 20:04:43 -07:00