Commit Graph

80 Commits

Author SHA1 Message Date
Sergio Benitez
f5ec470a7d Use the RawStr type for raw parameter strings.
This is a breaking change.

The `&str` type no longer implements `FromParam`. The `&RawStr` type
should be used in its place.
2017-03-31 00:18:58 -07:00
Sergio Benitez
0c44e44641 Use the RawStr type for all form raw strings.
This is a breaking change.

This commit introduces `RawStr` to forms. In particular, after this
commit, the `&str` type no longer implements `FromFormValue`, and so it
cannot be used as a field in forms. Instad, the `&RawStr` can be used.

The `FormItems` iterator now returns an `(&RawStr, &RawStr)` pair.
2017-03-30 23:06:53 -07:00
Sergio Benitez
f57d984e2e New version: 0.2.4. 2017-03-30 19:56:12 -07:00
Sergio Benitez
13359d4f50 Reformulate ContentType as a wrapper around MediaType. 2017-03-23 22:41:42 -07:00
Sergio Benitez
605e8fdc0e Update Tera to 0.8. 2017-03-23 15:28:49 -07:00
Sergio Benitez
09550b6e7c New version: 0.2.3. 2017-03-22 19:47:52 -07:00
Ryan Leckey
5086f0eb01 Default generic T in JSON to Value. 2017-03-08 17:53:05 -08:00
Sergio Benitez
fc89d0e96c Move {json,msgpack}/mod.rs to top-level contrib/src. 2017-03-08 15:17:37 -08:00
Josh Holmer
d43678c35e Add MsgPack implementation to contrib. 2017-03-08 15:12:00 -08:00
Sergio Benitez
6be902162d New version: 0.2.2. 2017-02-26 18:31:15 -08:00
Sergio Benitez
d99de8e05b New version: 0.2.1. 2017-02-24 13:57:33 -08:00
Sergio Benitez
46403b8d0a Iterate through Tera error chain for better errors. 2017-02-17 00:23:41 -08:00
Sergio Benitez
6184d94619 Expose docstring for JSON Responder impl. 2017-02-16 18:06:09 -08:00
Sergio Benitez
a496d1dbc4 Fix typos in JSON docs. 2017-02-09 00:18:47 -08:00
Sergio Benitez
c7db553286 New version: 0.2.0. 2017-02-06 05:35:19 -08:00
Sergio Benitez
266c62fb22 Implement FromFormValue for contrib UUID. 2017-02-03 17:09:22 -08:00
Sergio Benitez
aefa2f1494 Use pub(crate) to enforce doc(hidden). 2017-02-03 02:17:06 -08:00
Sergio Benitez
84abac7f2b Unignore template test. Upstream fix landed. 2017-02-02 18:48:34 -08:00
Sergio Benitez
2b65be32e0 Ignore render example due to broken upstream crate. 2017-02-02 15:39:30 -08:00
Sergio Benitez
5dff45086a Update to tera 0.7. 2017-02-02 15:18:23 -08:00
Sergio Benitez
ecc62beeac Update uuid in contrib to 0.4. 2017-02-02 14:51:04 -08:00
Sergio Benitez
cc22836867 Precisely route formats. Make 'content_type' an 'Option' in 'Request'.
This commit changes the routing algorithm. In particular, it enforces
precise matching of formats. With this change, a route with a specified
format only matches requests that have the same format specified. A
route with no format specified matches any request's format. This is
contrast to the previous behavior, where a route without a specified
format would match requests regardless of their format or whether one
was specified.

This commit also changes the following:
  * The return type of the 'content_type' method of 'Request' is now
    'Option<ContentType>'.
  * The 'ContentType' request guard forwards when the request has no
    specified ContentType.
  * The 'add_header' and 'replace_header' methods take the header
    argument generically.

Closes #120.
2017-02-01 03:12:24 -08:00
Sergio Benitez
5fabb43a1b Update to serde 0.9, handlebars 0.25. Move from map! to json! macro.
Resolves #154.
2017-01-31 17:15:42 -08:00
Sergio Benitez
5f04beaafc Use pegged Tera. 2017-01-28 21:52:36 -08:00
Sergio Benitez
8fd19cce4f Use upstream Tera. Emit warning on conflicting templates. 2017-01-26 12:47:20 -08:00
Sergio Benitez
c61e740572 Allow any Serialize type in RHS of map macro. 2017-01-26 11:56:06 -08:00
Sergio Benitez
0a0b64b9b6 New version: 0.1.6. 2017-01-26 11:26:50 -08:00
Sergio Benitez
b164da1a01 Rename JSON::unwrap() to JSON::into_inner(). 2017-01-15 03:00:46 -08:00
Sergio Benitez
08278e8f0e New version: 0.1.5. 2017-01-14 08:45:03 -08:00
Sergio Benitez
77ae330212 Minor style changes to UUID contrib. 2017-01-14 08:20:15 -08:00
Lori Holden
8f39d3399e Add UUID type to contrib. 2017-01-14 08:08:01 -08:00
Sergio Benitez
6fd0503cea Expose SerdeError. 2017-01-12 23:07:01 -08:00
Sergio Benitez
3c07cf96df Overhaul templating contrib library: use register callback.
This commit improves and changes the templating library in the following ways:

  * Templates are now registered/loaded at initialization.
  * No synchronization is required to read templates.
  * All templates are properly loaded (fixes #122).
  * Tera templates are given the proper name: `index`, not `index.html.tera`.
  * Rendering tests added for both templating engines.

There is one breaking change:

  * Tera templates are given the proper name: `index`, not `index.html.tera`.
2017-01-12 02:52:23 -08:00
Sergio Benitez
5db5e9f688 Update handlebars to 0.24. 2017-01-10 15:06:00 -08:00
Sergio Benitez
855d9b7b00 New version: 0.1.4. 2017-01-04 11:18:49 -06:00
Sergio Benitez
6fdc6f025f New version: 0.1.3. 2016-12-31 01:31:11 -06:00
Sergio Benitez
d610e0adff Update Tera dependency to 0.6. 2016-12-29 21:26:22 -06:00
Sergio Benitez
f43f77dbfc Improve Template docs and implement Display. 2016-12-29 13:20:30 -06:00
Marcus Ball
a33e225e71 Properly resolve nested template names on Windows. 2016-12-28 23:04:18 -06:00
Joel Roller
8deac6dba9 Add '.tera' extension to default Tera escapes. 2016-12-28 21:11:56 -06:00
Eric D. Reichert
13cac7db45 Fix URL to config guide in templates/mod.rs. 2016-12-26 19:05:06 -06:00
Sergio Benitez
fb7a756cf1 New version: 0.1.2. 2016-12-24 14:15:00 -08:00
Sergio Benitez
89f42a614d Properly resolve nested template names in contrib.
Fixes #42.
2016-12-24 14:03:56 -08:00
Sergio Benitez
14f79c3733 New version: 0.1.1. NamedFile hotfix. 2016-12-23 12:30:44 -08:00
Sergio Benitez
a94fcf41db New version: 0.1.0. First public release! 2016-12-23 05:03:07 -08:00
Sergio Benitez
22a058d2d5 Add Cargo metadata to contrib and codegen crates. 2016-12-23 04:20:46 -08:00
Sergio Benitez
d56ea65f27 Fix versions for packaging. 2016-12-23 03:55:59 -08:00
Sergio Benitez
e76ba7d219 Document the JSON responder, default template dir. 2016-12-23 02:38:30 -08:00
Sergio Benitez
76073718c7 New version: 0.1.0 release candidate. 2016-12-22 00:05:05 -08:00
Sergio Benitez
2dc1ba29f0 Adds tests for JSON example. Emit warning from JSON FromData.
This also includes a tiny change to the `mk-docs` script to build a
blank index at the root of the docs.
2016-12-21 22:56:58 -08:00