mirror of
https://github.com/actix/actix-web.git
synced 2024-09-09 05:08:32 +00:00
Merge branch 'master' into guide
This commit is contained in:
commit
c04e0fdec4
5 changed files with 24 additions and 3 deletions
|
@ -31,6 +31,14 @@ Actix web is a simple, pragmatic, extremely fast, web framework for Rust.
|
||||||
|
|
||||||
## Example
|
## 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
|
```rust
|
||||||
extern crate actix_web;
|
extern crate actix_web;
|
||||||
use actix_web::{server, App, Path};
|
use actix_web::{server, App, Path};
|
||||||
|
|
|
@ -5,7 +5,7 @@ authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
workspace = "../.."
|
workspace = "../.."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "*"
|
futures = "0.1"
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
actix = "0.5"
|
actix = "0.5"
|
||||||
actix-web = { path="../.." }
|
actix-web = { path="../.." }
|
||||||
|
|
|
@ -5,7 +5,7 @@ authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||||
workspace = "../.."
|
workspace = "../.."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
futures = "*"
|
futures = "0.1"
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
actix = "0.5"
|
actix = "0.5"
|
||||||
actix-web = { path = "../../" }
|
actix-web = { path = "../../" }
|
||||||
|
|
|
@ -17,7 +17,7 @@ contains the following:
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix = "0.5"
|
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.
|
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>,
|
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 {
|
impl Message for Pause {
|
||||||
type Result = ();
|
type Result = ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue