Using self method in default implementation is not supported
stevenroose opened this issue · comments
Steven Roose commented
I can't find an issue for this, but it seems that this example is not supported:
use async_trait::async_trait;
#[async_trait]
pub trait Test {
async fn normal(&self) -> bool;
async fn with_default(&self) -> bool {
self.normal()
}
}
David Tolnay commented
For calling one async function from another async function, you need to use await
(in general, not only inside async traits):
async fn with_default(&self) -> bool {
self.normal().await
}
Steven Roose commented
Is it correct that that makes the futures returned no longer Send
?