Skip to content

Async functions in templates #593

@ArkhamCookie

Description

@ArkhamCookie

I want to call an async function from my template, but doing so throws the following error:

no field `r#await` on type `impl Future<Output = String>`
to `.await` a `Future`, switch to Rust 2018 or later
set `edition = "2024"` in `Cargo.toml`
for more on editions, read https://doc.rust-lang.org/edition-guiderustc

This would be useful when creating frontend elements that require calling async functions. For example, an async database call.

If there is a way to do this that I am missing, please feel free to correct me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions