mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
Merge branch 'master' into guide
This commit is contained in:
commit
c04e0fdec4
@ -31,6 +31,14 @@ Actix web is a simple, pragmatic, extremely fast, web framework for Rust.
|
||||
|
||||
## Example
|
||||
|
||||
At the moment all examples uses actix-web master.
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
actix = "0.5"
|
||||
actix-web = { git="https://github.com/actix/actix-web.git" }
|
||||
```
|
||||
|
||||
```rust
|
||||
extern crate actix_web;
|
||||
use actix_web::{server, App, Path};
|
||||
|
@ -5,7 +5,7 @@ authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
workspace = "../.."
|
||||
|
||||
[dependencies]
|
||||
futures = "*"
|
||||
futures = "0.1"
|
||||
env_logger = "0.5"
|
||||
actix = "0.5"
|
||||
actix-web = { path="../.." }
|
||||
|
@ -5,7 +5,7 @@ authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
workspace = "../.."
|
||||
|
||||
[dependencies]
|
||||
futures = "*"
|
||||
futures = "0.1"
|
||||
env_logger = "0.5"
|
||||
actix = "0.5"
|
||||
actix-web = { path = "../../" }
|
||||
|
@ -17,7 +17,7 @@ contains the following:
|
||||
```toml
|
||||
[dependencies]
|
||||
actix = "0.5"
|
||||
actix-web = "0.4"
|
||||
actix-web = { git="https://github.com/actix/actix-web.git" }
|
||||
```
|
||||
|
||||
In order to implement a web server, we first need to create a request handler.
|
||||
|
@ -78,6 +78,19 @@ pub struct Pause {
|
||||
time: Option<Duration>,
|
||||
}
|
||||
|
||||
impl Pause {
|
||||
/// Create message with pause duration parameter
|
||||
pub fn new(time: Duration) -> Pause {
|
||||
Pause{time: Some(time)}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Pause {
|
||||
fn default() -> Pause {
|
||||
Pause{time: None}
|
||||
}
|
||||
}
|
||||
|
||||
impl Message for Pause {
|
||||
type Result = ();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user