async fn fn_name () {
async { || {
}}
}
type CallbackType = Pin<Box<dyn Future<Output = (bool, Option<Box<dyn Fn() -> ()>>)>>>
struct Functions {
func: Vec<Pin<Box<CallbackType>>>
}
impl Functions {
fn add (&mut self, callback: fn() -> CallbackType) {
self.func.push(Box::pin(callback));
}
}
let f = Functions{...};
f.add(fn_name)
now when I call the name
function its showing expected struct
Pin, found opaque type
this error.