casbin-rs / casbin-grpc

Casbin-gRPC provides gRPC interface for Casbin authorization which is implemented with Rust.
https://github.com/casbin/casbin-server
Apache License 2.0
7 stars 4 forks source link

proto::casbin_server::Casbin` is not satisfied #15

Closed makorne closed 1 year ago

makorne commented 1 year ago
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let addr: String = "[::1]:50051".parse().unwrap();
    let casbin = CasbinGRPC::default();

    println!("Server listening on: {}", addr);
    Server::builder()
        .add_service(CasbinServer::new(casbin))
        .serve(addr.parse().unwrap())
        .await?;

    Ok(())
}
error[E0277]: the trait bound `CasbinGRPC: proto::casbin_server::Casbin` is not satisfied
    --> src/main.rs:29:40
     |
29   |         .add_service(CasbinServer::new(casbin))
     |                      ----------------- ^^^^^^ the trait `proto::casbin_server::Casbin` is not implemented for `CasbinGRPC`
     |                      |
     |                      required by a bound introduced by this call
     |
note: required by a bound in `proto::casbin_server::CasbinServer::<T>::new`
    --> src/proto.rs:1164:13
     |
1164 |     impl<T: Casbin> CasbinServer<T> {
     |             ^^^^^^ required by this bound in `proto::casbin_server::CasbinServer::<T>::new`
1165 |         pub fn new(inner: T) -> Self {
     |                --- required by a bound in this
casbin-bot commented 1 year ago

@hackerchai @PsiACE