From d14991ec9625e04eb14b24bd37bf794a6e988cc3 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Wed, 28 Mar 2018 21:49:50 -0700 Subject: [PATCH] update doc strings --- src/lib.rs | 6 +++--- src/route.rs | 3 ++- src/test.rs | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 7881a66e0..d9fc19f26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -140,7 +140,7 @@ pub use application::Application; pub use httpmessage::HttpMessage; pub use httprequest::HttpRequest; pub use httpresponse::HttpResponse; -pub use handler::{Either, Reply, Responder, NormalizePath, AsyncResponder, FutureResponse}; +pub use handler::{Either, Responder, NormalizePath, AsyncResponder, FutureResponse}; pub use route::Route; pub use resource::Resource; pub use context::HttpContext; @@ -185,12 +185,12 @@ pub mod dev { pub use body::BodyStream; pub use context::Drain; pub use info::ConnectionInfo; - pub use handler::Handler; + pub use handler::{Handler, Reply}; pub use with::WithHandler; pub use json::JsonBody; pub use router::{Router, Pattern}; pub use param::{FromParam, Params}; pub use extractor::HttpRequestExtractor; - pub use httpmessage::{UrlEncoded, MessageBody}; + pub use httpmessage::{UrlEncodedFut, MessageBody}; pub use httpresponse::HttpResponseBuilder; } diff --git a/src/route.rs b/src/route.rs index bacf12fc6..4213c70d3 100644 --- a/src/route.rs +++ b/src/route.rs @@ -163,7 +163,7 @@ impl Route { /// count: u32, /// } /// - /// /// extract path info using serde + /// /// extract path and query information using serde /// fn index(p: Path, q: Query) -> Result { /// Ok(format!("Welcome {}!", p.username)) /// } @@ -183,6 +183,7 @@ impl Route { self.h(with2(handler)) } + /// Set handler function, function has to accept three request extractors. pub fn with3(&mut self, handler: F) where F: Fn(T1, T2, T3) -> R + 'static, R: Responder + 'static, diff --git a/src/test.rs b/src/test.rs index b43f8cf07..97ddba409 100644 --- a/src/test.rs +++ b/src/test.rs @@ -267,6 +267,10 @@ impl Drop for TestServer { } } +/// An `TestServer` builder +/// +/// This type can be used to construct an instance of `TestServer` through a +/// builder-like pattern. pub struct TestServerBuilder { state: Box S + Sync + Send + 'static>, #[cfg(feature="alpn")]