godot - Rust (original) (raw)

Expand description

§Rust bindings for Godot 4

The gdext library implements Rust bindings for the Godot engine, more precisely its version 4. It does so using the GDExtension API, a C interface to integrate third-party language bindings with the engine.

This API doc is accompanied by the book, which provides tutorials that guide you along the way.

An overview of fundamental types and concepts can be found on this page.

§Module organization

The contains generated code, which is derived from the GDExtension API specification. This code spans the official Godot API and is mostly the same as the API you would use in GDScript.

The Godot API is divided into several modules:

In addition to generated code, we provide a framework that allows you to easily interface the Godot engine. Noteworthy modules in this context are:

The prelude contains often-imported symbols; feel free to use godot::prelude::* in your code.

§Public API

Some symbols in the API are not intended for users, however Rust’s visibility feature is not strong enough to express that in all cases (for example, proc-macros and separated crates may need access to internals).

The following API symbols are considered private:

This means there are no guarantees regarding API stability, robustness or correctness. Problems arising from using private APIs are not considered bugs, and anything relying on them may stop working without announcement. Please refrain from using undocumented and private features; if you are missing certain functionality, bring it up for discussion instead. This allows us to improve the library!

§Cargo features

The following features can be enabled for this crate. All of them are off by default.

Avoid default-features = false unless you know exactly what you are doing; it will disable some required internal features.

Godot version and configuration:

Rust functionality toggles:

Integrations:

__docs

Extended documentation

builtin

Built-in types like Vector2, GString and Variant.

classes

Maps the Godot class API to Rust.

global

Godot global enums, constants and utility functions.

init

Entry point and global init/shutdown of the library.

meta

Meta-information about Godot types, their properties and conversions between them.

obj

Types and traits related to objects.

prelude

Often-imported symbols.

register

Register/export Rust symbols to Godot: classes, methods, enums…

tasksince_api="4.2"

Integrates async rust code with the engine.

tools

Higher-level additions to the Godot engine API.