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:
@ -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::*;
|
||||
|
@ -31,7 +31,7 @@ use db::{CreateUser, DbExecutor};
|
||||
|
||||
/// State with DbExecutor address
|
||||
struct State {
|
||||
db: SyncAddress<DbExecutor>,
|
||||
db: Addr<Syn<DbExecutor>>,
|
||||
}
|
||||
|
||||
/// Async request handler
|
||||
|
Reference in New Issue
Block a user