Skip to main content

Crate gdext_async

Crate gdext_async 

Source
Expand description

Provides utilities for bidirectional support between Rust and GDScript for async and await.

This crate provides two macros, both intended for interoperability with GDScript: godot_async and godot_await. If you are writing a pure-Rust project that does not need to inter-operate with GDScript, then you probably do NOT need this crate.

§Features

  • macros - Exposes the attribute macro #[gdext_async]. Enabled by default. This requires the syn crate as a dependency.

Macros§

godot_async
Convert a block of Rust async code into a Godot task whose completion can safely be awaited from GDScript.
godot_await
Await (in Rust) a Godot value, using semantics similar to GDScript’s await.

Functions§

resolve_gdscript_coroutine
If the object is a GDScriptFunctionState, await it. If not, return it unmodified. Note that, unlike GDScript, this function does NOT attempt to detect and await signals. Only actual GDScriptFunctionState objects will be awaited.

Attribute Macros§

gdext_async
Attribute macro that can be applied to impl blocks (similar to godot_api) to enable optional functionality.