Module prelude

Source
Expand description

Often-imported symbols.

Re-exports§

pub use super::builtin::math::FloatExt as _;
pub use super::obj::EngineBitfield as _;
pub use super::obj::EngineEnum as _;
pub use super::obj::NewAlloc as _;
pub use super::obj::NewGd as _;
pub use super::obj::WithBaseField as _;
pub use super::obj::WithSignals as _;
pub use super::obj::WithUserSignals as _;

Modules§

real_consts
Re-export of std::f32::consts or std::f64::consts, depending on precision config.

Macros§

array
Constructs Array literals, similar to Rust’s standard vec! macro.
dict
Constructs Dictionary literals, close to Godot’s own syntax.
godot_error
Pushes an error message to Godot’s built-in debugger and to the OS terminal.
godot_print
Prints to the Godot console.
godot_print_rich
Prints to the Godot console. Supports BBCode, color and URL tags.
godot_script_error
Logs a script error to Godot’s built-in debugger and to the OS terminal.
godot_warn
Pushes a warning message to Godot’s built-in debugger and to the OS terminal.
real
A macro to coerce float-literals into the real type.
reals
Array of reals.
swizzle
Access vector components in different order.
varray
Constructs VariantArray literals, similar to Rust’s standard vec! macro.
vslice
Constructs a slice of Variant literals, useful for passing to vararg functions.

Structs§

Aabb
Axis-aligned bounding box in 3D space.
Array
Godot’s Array type.
Base
Restricted version of Gd, to hold the base instance inside a user’s GodotClass.
Basis
A 3x3 matrix, typically used as an orthogonal basis for Transform3D.
Callable
A Callable represents a function in Godot.
Color
Color built-in type, in floating-point RGBA format.
ColorHsv
HSVA floating-number Color representation.
ConvertError
Represents errors that can occur when converting values from Godot.
Dictionary
Godot’s Dictionary type.
DynGd
Smart pointer integrating Rust traits via dyn dispatch.
DynGdMut
Mutably/exclusively bound reference guard for a DynGd smart pointer.
DynGdRef
Shared reference guard for a DynGd smart pointer.
GFile
Open a file for reading or writing.
GString
Godot’s reference counted string type.
Gd
Smart pointer to objects owned by the Godot engine.
GdMut
Mutably/exclusively bound reference guard for a Gd smart pointer.
GdRef
Immutably/shared bound reference guard for a Gd smart pointer.
InstanceId
Represents a non-zero instance ID.
IoError
Error that can occur while using gdext IO utilities.
Node
Godot class Node.
Node2D
Godot class Node2D.
Node3D
Godot class Node3D.
NodePath
A pre-parsed scene tree path.
Object
Godot class Object.
OnEditor
Exported property that must be initialized in the editor (or associated code) before use.
OnReady
Ergonomic late-initialization container with ready() support.
PackedByteArray
Space-efficient array of u8 elements.
PackedColorArray
Space-efficient array of Color elements.
PackedFloat32Array
Space-efficient array of f32 elements.
PackedFloat64Array
Space-efficient array of f64 elements.
PackedInt32Array
Space-efficient array of i32 elements.
PackedInt64Array
Space-efficient array of i64 elements.
PackedScene
Godot class PackedScene.
PackedStringArray
Space-efficient array of GString elements.
PackedVector2Array
Space-efficient array of Vector2 elements.
PackedVector3Array
Space-efficient array of Vector3 elements.
PackedVector4Array
Space-efficient array of Vector4 elements.
Plane
3D plane in Hessian normal form.
Projection
A 4x4 matrix used for 3D projective transformations.
Quaternion
Unit quaternion to represent 3D rotations.
Rect2
2D axis-aligned bounding box.
Rect2i
2D axis-aligned integer bounding box.
RefCounted
Godot class RefCounted.
Resource
Godot class Resource.
SceneTree
Godot class SceneTree.
Signal
Untyped Godot signal.
StringName
A string optimized for unique names.
Transform2D
Affine 2D transform (2x3 matrix).
Transform3D
Affine 3D transform (3x4 matrix).
Variant
Godot variant type, able to store a variety of different types.
VariantOperator
Godot enum name: Variant.Operator.
VariantType
Godot enum name: Variant.Type.
Vector2
Vector used for 2D math using floating point coordinates.
Vector3
Vector used for 3D math using floating point coordinates.
Vector4
Vector used for 4D math using floating point coordinates.
Vector2i
Vector used for 2D math using integer coordinates.
Vector3i
Vector used for 3D math using integer coordinates.
Vector4i
Vector used for 4D math using integer coordinates.

Enums§

ColorChannelOrder
Defines how individual color channels are laid out in memory.
Encoding
Specifies string encoding.
EulerOrder
This enum is exhaustive; you should not expect future Godot versions to add new enumerators.
ProjectionEye
The eye to create a projection for, when creating a projection adjusted for head-mounted displays.
ProjectionPlane
A projection’s clipping plane.
Rid
A RID (“resource ID”) is an opaque handle that refers to a Godot Resource.
Side
This enum is exhaustive; you should not expect future Godot versions to add new enumerators.
Vector2Axis
Enumerates the axes in a Vector2.
Vector3Axis
Enumerates the axes in a Vector3.
Vector4Axis
Enumerates the axes in a Vector4.

Traits§

AsDyn
Trait that defines a T -> dyn Trait relation for use in DynGd.
Export
Trait implemented for types that can be used as #[export] fields.
ExtensionLibrary
Defines the entry point for a GDExtension Rust library.
FromGodot
Defines the canonical conversion from Godot for a type.
GodotClass
Makes T eligible to be managed by Godot and stored in Gd<T> pointers.
GodotConvert
Indicates that a type can be passed to/from Godot, either directly or through an intermediate “via” type.
INode
Interface trait for class Node.
INode2D
Interface trait for class Node2D.
INode3D
Interface trait for class Node3D.
IObject
Interface trait for class Object.
IPackedScene
Interface trait for class PackedScene.
IRefCounted
Interface trait for class RefCounted.
IResource
Interface trait for class Resource.
ISceneTree
Interface trait for class SceneTree.
Inherits
Non-strict inheritance relationship in the Godot class hierarchy.
RealConv
Convenience conversion between real and f32/f64.
RustCallable
Represents a custom callable object defined in Rust.
ToGodot
Defines the canonical conversion to Godot for a type.
Var
Trait implemented for types that can be used as #[var] fields.
XformInv
Applying inverse transforms.

Functions§

load
⚠️ Loads a resource from the filesystem located at path, panicking on error.
save
⚠️ Saves a Resource-inheriting object into the file located at path.
try_load
Loads a resource from the filesystem located at path.
try_save
Saves a Resource-inheriting object into the file located at path.

Type Aliases§

InitLevel
Stage of the Godot initialization process.
VariantArray
A Godot Array without an assigned type.
real
Floating point type used for many structs and functions in Godot.

Attribute Macros§

gdextension
Proc-macro attribute to be used in combination with the ExtensionLibrary trait.
godot_api
Proc-macro attribute to be used with impl blocks of #[derive(GodotClass)] structs.
godot_dyn
Generates a Class -> dyn Trait upcasting relation.

Derive Macros§

Export
Derive macro for Export on enums.
GodotClass
Derive macro for GodotClass on structs.
GodotConvert
Derive macro for GodotConvert on structs.
Var
Derive macro for Var on enums.