mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-28 01:52:57 +01:00
fix guide
This commit is contained in:
parent
d573cf2d97
commit
7eb310f8ce
@ -24,11 +24,13 @@ impl Actor for DbExecutor {
|
|||||||
This is definition of our actor. Now we need to define *create user* message and response.
|
This is definition of our actor. Now we need to define *create user* message and response.
|
||||||
|
|
||||||
```rust,ignore
|
```rust,ignore
|
||||||
#[derive(Message)]
|
|
||||||
#[rtype(User, Error)]
|
|
||||||
struct CreateUser {
|
struct CreateUser {
|
||||||
name: String,
|
name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Message for CreateUser {
|
||||||
|
type Result = Result<User, Error>;
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
We can send `CreateUser` message to `DbExecutor` actor, and as result we get
|
We can send `CreateUser` message to `DbExecutor` actor, and as result we get
|
||||||
|
Loading…
Reference in New Issue
Block a user