Note that Form cannot require data ordering

URL encoded forms are always unordered key=value pairs.  Similarly to
Query, note that trying to decode it into something like a tuple will
fail at runtime.
This commit is contained in:
Jonas Malaco 2021-06-23 11:28:52 -03:00
parent 8846808804
commit 68303e483f
1 changed files with 4 additions and 0 deletions

View File

@ -80,6 +80,10 @@ use crate::{
/// })
/// }
/// ```
///
/// # Panics
/// URL encoded forms consist of unordered `key=value` pairs, therefore they cannot be decoded into
/// any type which depends upon data ordering (eg. tuples). Trying to do so will result in a panic.
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug)]
pub struct Form<T>(pub T);