Actix 2.0 - Factory trait not satisfied error

I'm trying to port my project to Actix 2.0 and I'm getting one last build error that I've been trying to figure out for a few hours and I'm completely stuck:

error[E0277]: the trait bound `fn(actix_web::request::HttpRequest, actix_web::types::payload::Payload) -> std::result::Result<actix_http::response::Response, actix_http::error::Error> {app::ws_json_route}: actix_web::handler::Factory<_, _, _>` is not satisfied
  --> exopticon/src/app.rs:76:72
   |
76 |                 .service(web::resource("/ws_json").route(web::get().to(ws_json_route)))
   |                                                                        ^^^^^^^^^^^^^ the trait `actix_web::handler::Factory<_, _, _>` is not implemented for `fn(actix_web::request::HttpRequest, actix_web::types::payload::Payload) -> std::result::Result<actix_http::response::Response, actix_http::error::Error> {app::ws_json_route}`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `exopticon`.

I've seen "trait is not satisfied" errors before but usually the error has some details about the trait, for example that a given trait takes a &mut but I provided a &. But this trait just seems to be actix_web::handler::Factory<_, _, _>?

Here's the line causing the error:

Here's the implementation of the websocket actor:

And here's a full build log:

And here's a similar example that uses the same crates:
https://github.com/actix/examples/blob/master/websocket/src/main.rs

Anyone know what's going on? Thanks in advance!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.