Giter Club home page Giter Club logo

Comments (7)

hsluoyz avatar hsluoyz commented on May 26, 2024

@hackerchai

from examples.

hackerchai avatar hackerchai commented on May 26, 2024

@eagleshine you should use actor: web::Data<Addr<CasbinActor<CachedEnforcer>>>,

from examples.

eagleshine avatar eagleshine commented on May 26, 2024

Looks like the text is changed by github, corrected as below:
error[E0277]: the trait bound CasbinActor<CachedEnforcer>: Actor is not satisfied
--> actix-middleware-example/src/api/user.rs:34:12
|
34 | actor: web::Data<Addr<CasbinActor < CachedEnforcer >>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait Actor is not implemented for CasbinActor<CachedEnforcer>
|
|

from examples.

0xethsign avatar 0xethsign commented on May 26, 2024

This issue is still there. Doesn't look like a old dependency problem. I cloned the repo, as is, set up the .env. secret.key and the db, and still this error occurred.
This maybe because Actor is not implemented for CasbinActor<T> where T: CachedEnforcer in actix-casbin

Screenshot from 2021-06-06 15-59-15

from examples.

0xethsign avatar 0xethsign commented on May 26, 2024

This issue is still there. Doesn't look like a old dependency problem. I cloned the repo, as is, set up the .env. secret.key and the db, and still this error occurred.
This maybe because Actor is not implemented for CasbinActor<T> where T: CachedEnforcer in actix-casbin

Screenshot from 2021-06-06 15-59-15

@hackerchai can you check this?

from examples.

0xethsign avatar 0xethsign commented on May 26, 2024

@eagleshine It is a dependency problem caused by the dependendabot. Because we're still waiting for actix-web 4.x stable, we have to use the old versions of actix-web and actix-rt
use this Cargo.toml -

[dependencies]
http = "0.2.1"
actix =  "0.10.0"
actix-web = "3.0.2"
actix-service = "1.0.6"
actix-rt = "1.1.1"
actix-cors = "0.4.0"
futures = "0.3.5"
failure = "0.1.8"
serde = "1.0.116"
serde_derive = "1.0.116"
serde_json = "1.0.57"
derive_more = "0.99.10"
chrono = { version = "0.4.18", features = ["serde"] }
diesel = { version = "1.4.5", features = ["postgres","r2d2", "chrono"] }
diesel_migrations = "1.4.0"
dotenv = "0.15.0"
env_logger = "0.8.1"
log = "0.4.11"
jsonwebtoken = "7.2.0"
bcrypt = "0.9.0"
csv = "1.1.3"
walkdir = "2.3.1"
actix-casbin= {version = "0.4.2", default-features = false, features = [ "runtime-async-std" ]}
actix-casbin-auth = {version = "0.4.4", default-features = false, features = [ "runtime-async-std" ]}
diesel-adapter = { version = "0.8.1", default-features = false, features = ["postgres","runtime-async-std"] }
uuid = {version = "0.8.1", features = ["v4"] }

from examples.

0xethsign avatar 0xethsign commented on May 26, 2024

@hsluoyz this issue can be closed.

from examples.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.