Lifetime parameters or bounds on method create
do not match the trait declaration
#303
-
Hi all, Preface: I have a lot of amateur Rust experience, but there are many areas I'm still rather fuzzy on, The title is the compiler error I get from the following code: async fn create(& self) -> Result<Self::Type, Self::Error> {
let conn = Connection::new(
(self.host.as_str(), self.port),
&self.account,
&self.conn_config,
)?;
SyncWrapper::new(deadpool_runtime::Runtime::Tokio1, move|| conn.login()).await
} I am confused because there are no lifetime bounds on the trait method as far as I see. I even |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Deadpool 0.10 from crates.io still uses the I guess you have used the code from the GitHub repository and used the release from crates.io? That would explain the error message you are getting. To fix that you can either add the async-trait crate to your own app or use the deadpool version from this repository. See: |
Beta Was this translation helpful? Give feedback.
-
No, I just ran |
Beta Was this translation helpful? Give feedback.
Deadpool 0.10 from crates.io still uses the
async-trait
crate. The upcoming release will drop this and use async traits as introduced in rust 1.75.I guess you have used the code from the GitHub repository and used the release from crates.io? That would explain the error message you are getting.
To fix that you can either add the async-trait crate to your own app or use the deadpool version from this repository.
See: