mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 16:02:59 +01:00
update doc strings
This commit is contained in:
parent
3cf54bc0fd
commit
92fe2e96de
@ -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>,
|
||||||
|
11
src/de.rs
11
src/de.rs
@ -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
|
||||||
/// }
|
/// }
|
||||||
|
@ -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>,
|
||||||
|
Loading…
Reference in New Issue
Block a user