1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 10:27:42 +02:00

sync with latest actix

This commit is contained in:
Nikolay Kim
2018-02-12 12:17:30 -08:00
parent 30bdf9cb5e
commit 8c1b5fa945
16 changed files with 65 additions and 103 deletions

View File

@ -17,9 +17,8 @@ pub struct CreateUser {
pub name: String,
}
impl ResponseType for CreateUser {
type Item = models::User;
type Error = Error;
impl Message for CreateUser {
type Result = Result<models::User, Error>;
}
impl Actor for DbExecutor {
@ -27,7 +26,7 @@ impl Actor for DbExecutor {
}
impl Handler<CreateUser> for DbExecutor {
type Result = MessageResult<CreateUser>;
type Result = Result<models::User, Error>;
fn handle(&mut self, msg: CreateUser, _: &mut Self::Context) -> Self::Result {
use self::schema::users::dsl::*;

View File

@ -31,7 +31,7 @@ use db::{CreateUser, DbExecutor};
/// State with DbExecutor address
struct State {
db: SyncAddress<DbExecutor>,
db: Addr<Syn<DbExecutor>>,
}
/// Async request handler