godot

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 _;

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.

Structs§

Aabb
Axis-aligned bounding box in 3D space.
Array
Godot’s Array type.
AudioStreamPlayer
Godot class AudioStreamPlayer.
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.
Camera2D
Godot class Camera2D.
Camera3D
Godot class Camera3D.
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.
Input
Godot class Input.
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.
OnReady
Ergonomic late-initialization container with ready() support.
PackedByteArray
Implements Godot’s PackedByteArray type, which is a space-efficient array of u8s.
PackedColorArray
Implements Godot’s PackedColorArray type, which is a space-efficient array of Colors.
PackedFloat32Array
Implements Godot’s PackedFloat32Array type, which is a space-efficient array of f32s.
PackedFloat64Array
Implements Godot’s PackedFloat64Array type, which is a space-efficient array of f64s.
PackedInt32Array
Implements Godot’s PackedInt32Array type, which is a space-efficient array of i32s.
PackedInt64Array
Implements Godot’s PackedInt64Array type, which is a space-efficient array of i64s.
PackedScene
Godot class PackedScene.
PackedStringArray
Implements Godot’s PackedStringArray type, which is a space-efficient array of GStrings.
PackedVector2Array
Implements Godot’s PackedVector2Array type, which is a space-efficient array of Vector2s.
PackedVector3Array
Implements Godot’s PackedVector3Array type, which is a space-efficient array of Vector3s.
PackedVector4Array
Implements Godot’s PackedVector4Array type, which is a space-efficient array of Vector4s.
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
A Signal represents a signal of an Object instance in Godot.
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.
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.
IAudioStreamPlayer
Virtual methods for class AudioStreamPlayer.
ICamera2D
Virtual methods for class Camera2D.
ICamera3D
Virtual methods for class Camera3D.
INode
Virtual methods for class Node.
INode2D
Virtual methods for class Node2D.
INode3D
Virtual methods for class Node3D.
IObject
Virtual methods for class Object.
IPackedScene
Virtual methods for class PackedScene.
IRefCounted
Virtual methods for class RefCounted.
IResource
Virtual methods for class Resource.
ISceneTree
Virtual methods 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.

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.