How can i use async move closure in a unasync call back?

this's a click call back function for a fltk button,I want to execute a database query on the click of a button.

    //button click even
    ui.but.set_callback(async move |_| {
        let txt = "Some long text!Some long text!Some long text!Some long text!Some long text!\n";
        log.buffer().unwrap().append(txt);
        my_db::sqlserver_mod2::sql2().await.unwrap();
    });

I got an error:

[E0308] mismatched types. 
[Note] expected `()`, found opaque type

How can i use async move closure in a unasync call back?



Read more here: https://stackoverflow.com/questions/68043903/how-can-i-use-async-move-closure-in-a-unasync-call-back

Content Attribution

This content was originally published by Tofu Bait at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: