Rocket/site/guide
Sergio Benitez 337e8843a4 Use 'Option', 'Result' directly in 'uri!' query.
Prior to this commit, the conversion 'T -> Option<T>' was applied in
both the path and query parts of a URI in the 'uri' macro via the
'FromUriParam' trait with no implementation for 'Option<T>' directly.
This meant that it was impossible to directly render an 'Option<T>'.
This was exactly desired for the path part, where rendering a 'None'
would yield an incorrect URI, but the restriction was too strict for the
query part, where a 'None' is entirely valid. This commit makes changes
the conversion so that it only applied to path parts and adds the
identity conversions for 'Option<T>' and 'Result<T, E>' for query parts.

The side effect is a breaking change: due to conflicting impls, the 'T'
to 'Option<T>' conversion was removed for query parts. Thus, all 'uri!'
query route arguments of type 'Option' or 'Result' must now be wrapped
in 'Some' or 'Ok'. Due to new 'Option<T> <-> Result<T, E>' conversions,
either 'Some' _and_ 'Ok' work in both contexts.

Closes #1420.
2020-11-01 10:30:30 -08:00
..
0-introduction.md Fix typo in guide intro: 'offerring' -> 'offering'. 2018-11-14 03:42:02 -08:00
1-quickstart.md Point all docs and doc links to 'master' branch. 2020-10-21 04:54:24 -07:00
2-getting-started.md Rework docs for stable and async support. 2020-07-21 16:15:13 -07:00
3-overview.md Point all docs and doc links to 'master' branch. 2020-10-21 04:54:24 -07:00
4-requests.md Remove unnecessary 'RawStr.as_str()' in guide. 2020-10-30 02:49:00 -07:00
5-responses.md Use 'Option', 'Result' directly in 'uri!' query. 2020-11-01 10:30:30 -08:00
6-state.md Use 'spawn_blocking' in '#[database]'. 2020-09-10 03:34:26 -07:00
7-fairings.md Take '&mut Data' in 'on_request' fairings. 2020-10-20 20:22:32 -07:00
8-testing.md Keep an op-log for sync 'CookieJar'. 2020-10-14 21:37:16 -07:00
9-configuration.md Mimic Rocket's config in custom providers example. 2020-10-30 03:08:26 -07:00
10-pastebin.md Add missing explicit lifetime parameter to `PasteId<'_>` in pastebin guide. 2020-10-11 12:45:07 -07:00
11-conclusion.md Update 'Riot' to 'Element'. 2020-07-22 13:03:35 -07:00
index.md Point all docs and doc links to 'master' branch. 2020-10-21 04:54:24 -07:00