Closed ileixe closed 8 months ago
Sorry for the slow response. I don't think it should be too hard to add support for this.
In the mean time, I think it does work to do:
use std::future::Future;
use ambassador::delegatable_trait;
use ambassador::Delegate;
pub struct Base {}
#[delegatable_trait]
pub trait Hello {
fn hello(&self) -> impl Future<Output=()>;
}
impl Hello for Base {
async fn hello(&self) {}
}
#[derive(Delegate)]
#[delegate(Hello)]
pub struct Dram {
inner: Base,
}
fn main() {
let d = Dram { inner: Base {} };
d.hello();
}
Hi,
Are there any plans to support async trait like below? I wonder it's easily added or not.
Currently it failed with
Thanks