1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-10-21 17:33:59 +00:00

update doc strings

This commit is contained in:
Nikolay Kim 2018-03-29 15:00:18 -07:00
parent 3cf54bc0fd
commit 92fe2e96de
3 changed files with 7 additions and 8 deletions

View file

@ -35,7 +35,7 @@ impl Frame {
} }
} }
/// Http actor execution context /// Execution context for http actors
pub struct HttpContext<A, S=()> where A: Actor<Context=HttpContext<A, S>>, pub struct HttpContext<A, S=()> where A: Actor<Context=HttpContext<A, S>>,
{ {
inner: ContextImpl<A>, inner: ContextImpl<A>,

View file

@ -24,16 +24,15 @@ use httprequest::HttpRequest;
/// # use actix_web::*; /// # use actix_web::*;
/// use actix_web::Path; /// use actix_web::Path;
/// ///
/// /// Application state /// /// extract path info from "/{username}/{count}/?index.html" url
/// struct State {} /// /// {username} - deserializes to a String
/// /// /// {count} - - deserializes to a u32
/// /// extract path info using serde /// fn index(info: Path<(String, u32)>) -> Result<String> {
/// fn index(info: Path<(String, u32), State>) -> Result<String> {
/// Ok(format!("Welcome {}! {}", info.0, info.1)) /// Ok(format!("Welcome {}! {}", info.0, info.1))
/// } /// }
/// ///
/// fn main() { /// fn main() {
/// let app = Application::with_state(State{}).resource( /// let app = Application::new().resource(
/// "/{username}/{count}/?index.html", // <- define path parameters /// "/{username}/{count}/?index.html", // <- define path parameters
/// |r| r.method(Method::GET).with(index)); // <- use `with` extractor /// |r| r.method(Method::GET).with(index)); // <- use `with` extractor
/// } /// }

View file

@ -18,7 +18,7 @@ use ws::frame::Frame;
use ws::proto::{OpCode, CloseCode}; use ws::proto::{OpCode, CloseCode};
/// `WebSockets` actor execution context /// Execution context for `WebSockets` actors
pub struct WebsocketContext<A, S=()> where A: Actor<Context=WebsocketContext<A, S>>, pub struct WebsocketContext<A, S=()> where A: Actor<Context=WebsocketContext<A, S>>,
{ {
inner: ContextImpl<A>, inner: ContextImpl<A>,