Problem passing an async function item as parameter in Rust
I found the answer here: How to bind lifetimes of Futures to fn arguments in Rust
The problem as I understand it is this:
From https://rust-lang.github.io/async-book/03_async_await/01_chapter.html:

Unlike traditional functions, async fns which take references or other non-'static arguments return a Future which is bounded by the lifetime of the arguments

So I had to force the Fut lifetime to be shorter than the input parameters lifetime.
The syntax won't let me simply force this by using Higher Ranked Lifetime bounds (as explained in the answer linked above) so I had to use the pattern proposed there: generate a meta trait linking lifetimes as this:
trait XFn<'a, T, S> {
    type Output: Future<Output = ()> + 'a;
    fn call(&self, this: T, services: S) -> Self::Output;
  }
  
  impl<'a, T: 'a, S: 'a, F, Fut> XFn<'a, T, S> for F
  where
    F: 'static + Copy + FnOnce(T, S) -> Fut,
    Fut: Future<Output = ()> + 'a,
  {
    type Output = Fut;
    fn call(&self, this: T, services: S) -> Fut {
        self(this, services)
    }
  }

Then I can use this trait to constraints lifetime on arguments and Future like this:
fn record_callback<F>(callback: F)
    where 
            for<'a> F: XFn<'a, &'a mut FirstTestComponent, &'a mut Services> + 'static + Copy,
    {
    }



[Edit: Updated provided code and compiler error to be easely reproduced]
I'm trying to pass an async function item as parameter to an other function in Rust but it won't compile, providing a cryptic error.
Here is the code I'm trying to compile.
Structure definition (implemented in one crate)
pub struct FirstTestComponent {
    table: Vec<String>,
    counter: usize,
}

impl FirstTestComponent {
    fn render(&mut self) {
        // Some other irrelevant code
        record_callback(
            FirstTestComponent::add_component,
        );
    }
}

pub struct Services {}

impl FirstTestComponent {

    async fn add_component(&mut self, _: &mut Services) {

        let counter = self.counter;
        self.table.push(counter.to_string());
        self.counter += 1;
    }
}   


pub fn record_callback<F, Fut>(callback: F)
    where 
        F: 'static + Copy + FnOnce(&mut FirstTestComponent, &mut Services) -> Fut,
        Fut: core::future::Future<Output = ()>  + 'static
        {
        }

fn main() {

}

When compiling this code, I get the following error:
error[E0308]: mismatched types
  --> src/main.rs:9:9
   |
9  | /         record_callback(
10 | |             FirstTestComponent::add_component,
11 | |         );
   | |_________^ one type is more general than the other
   |
   = note: expected trait `for<'r, 's> <for<'r, 's> fn(&'r mut FirstTestComponent, &'s mut Services) -> impl for<'r, 's> std::future::Future<Output = ()> {FirstTestComponent::add_component} as std::ops::FnOnce<(&'r mut FirstTestComponent, &'s mut Services)>>`
              found trait `for<'r, 's> <for<'r, 's> fn(&'r mut FirstTestComponent, &'s mut Services) -> impl for<'r, 's> std::future::Future<Output = ()> {FirstTestComponent::add_component} as std::ops::FnOnce<(&'r mut FirstTestComponent, &'s mut Services)>>`
note: the lifetime requirement is introduced here
  --> src/main.rs:30:79
   |
30 |         F: 'static + Copy + FnOnce(&mut FirstTestComponent, &mut Services) -> Fut,
   |                                                                               ^^^


literally saying that something is different than itself...
I guess there is some error linked to the lifetime hidden in the error message but I can't figure it out.
What could cause this error ? What is wrong with what I've implemented ?
