async_wrapper

Attribute Macro async_wrapper 

Source
#[async_wrapper]
Expand description

A procedural macro that wraps a function with an asynchronous runtime using spawn_blocking. This macro converts a synchronous function into an asynchronous one and registers it as a Tauri command.

ยงExample

#[async_wrapper]
pub fn example_function(x: i32) -> Result<String, String> {
    Ok(format!("Result: {}", x))
}

After applying the macro, the function will be accessible as an asynchronous Tauri command.