Document default FromParam impls.

This commit is contained in:
Sergio Benitez 2016-12-23 02:39:34 -08:00
parent 2cf7e2c6cd
commit 12302bcadb
2 changed files with 10 additions and 1 deletions

View File

@ -254,6 +254,15 @@ impl<'a, T: FromParam<'a>> FromParam<'a> for Option<T> {
/// the matched segments (via the
/// [Segments](/rocket/http/uri/struct.Segments.html) iterator) into the
/// implementing type.
///
/// # Provided Implementations
///
/// Rocket implements `FromParam` for `PathBuf`. The `PathBuf` implementation
/// constructs a path from the segments iterator. Each segment is
/// percent-decoded. If a segment equals ".." before or after decoding, the
/// previous segment (if any) is omitted. For security purposes, any other
/// segments that begin with "*" or "." are ignored. If a percent-decoded
/// segment results in invalid UTF8, an `Err` is returned with the `Utf8Error`.
pub trait FromSegments<'a>: Sized {
/// The associated error to be returned when parsing fails.
type Error: Debug;

View File

@ -32,7 +32,7 @@
//!
//! The testing methadology is simple:
//!
//! 1. Construct a `Rocket` instance
//! 1. Construct a `Rocket` instance.
//! 2. Construct a request.
//! 3. Dispatch the request using the Rocket instance.
//! 4. Inspect, validate, and verify the response.