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 thesyncrate 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 actualGDScriptFunctionStateobjects will be awaited.
Attribute Macros§
- gdext_
async - Attribute macro that can be applied to
implblocks (similar togodot_api) to enable optional functionality.