[][src]Module gdnative::prelude

Curated re-exports of common items.

Modules

core_types

Types that represent core-datatypes of Godot.

nativescript

Types and functions related to the NativeScript extension of GDNative.

user_data

Customizable user-data wrappers.

Macros

godot_dbg

Prints and returns the value of a given expression for quick and dirty debugging, using the engine's logging system (visible in the editor).

godot_error

Print an error using the engine's logging system (visible in the editor).

godot_gdnative_init

Declare the API endpoint to initialize the gdnative API on startup.

godot_gdnative_terminate

Declare the API endpoint invoked during shutdown.

godot_init

Declare all the API endpoints necessary to initialize a NativeScript library.

godot_nativescript_init

Declare the API endpoint to initialize nativescript classes on startup.

godot_print

Print a message using the engine's logging system (visible in the editor).

godot_warn

Print a warning using the engine's logging system (visible in the editor).

Structs

Aabb

Axis-aligned bounding box.

Aether

Special user-data wrapper intended for zero-sized types, that does not perform any allocation or synchronization at runtime. Does not implement MapMut.

ArcData

User-data wrapper encapsulating a Arc<T>. Does not implement MapMut.

Basis

A 3x3 matrix.

Button

core class Button inherits BaseButton (unsafe).

CanvasItem

core class CanvasItem inherits Node (unsafe).

CanvasLayer

core class CanvasLayer inherits Node (unsafe).

ClassBuilder
Color

RGBA color with 32 bits floating point components.

ColorRect

core class ColorRect inherits Control (unsafe).

Control

core class Control inherits CanvasItem (unsafe).

Dictionary

A reference-counted Dictionary of Variant key-value pairs.

ExportInfo

Metadata about the exported property.

GodotString

Godot's reference-counted string type.

Image

core class Image inherits Resource (reference counted).

InitHandle

A handle that can register new classes to the engine during initialization.

Input

core singleton class Input inherits Object (unsafe).

InputEvent

core class InputEvent inherits Resource (reference counted).

InputEventKey

core class InputEventKey inherits InputEventWithModifiers (reference counted).

Instance

A persistent reference to a GodotObject with a rust NativeClass attached.

KinematicBody

core class KinematicBody inherits PhysicsBody (unsafe).

KinematicBody2D

core class KinematicBody2D inherits PhysicsBody2D (unsafe).

Label

core class Label inherits Control (unsafe).

LocalCellData

User-data wrapper analogous to a Arc<RefCell<T>>, that is restricted to the thread where it was originally created.

ManuallyManaged

Marker that indicates that a type is manually managed.

MutexData

User-data wrapper encapsulating a Arc<Mutex<T>>.

Node

core class Node inherits Object (unsafe).

Node2D

core class Node2D inherits CanvasItem (unsafe).

NodePath

A reference-counted relative or absolute path in a scene tree, for use with Node.get_node() and similar functions. It can reference a node, a resource within a node, or a property of a node or resource.

Null

Represents an explicit null reference in method arguments. This works around type inference issues with Option. You may create Nulls with Null::null or GodotObject::null.

Object

The base class of most Godot classes.

PackedScene

core class PackedScene inherits Resource (reference counted).

Plane

Plane in hessian form.

PropertyUsage
Ref

A polymorphic smart pointer for Godot objects whose behavior changes depending on the memory management method of the underlying type and the thread access status.

RefCounted

Marker that indicates that a type is reference-counted.

RefInstance

A reference to a GodotObject with a rust NativeClass attached that is assumed safe during a certain lifetime.

Reference

Base class of all reference-counted types. Inherits Object.

ResourceLoader

core singleton class ResourceLoader inherits Object (unsafe).

Rid

The RID type is used to access the unique integer ID of a resource. They are opaque, so they do not grant access to the associated resource by themselves.

RwLockData

User-data wrapper encapsulating a Arc<RwLock<T>>.

SceneTree

core class SceneTree inherits MainLoop (unsafe).

Shader

core class Shader inherits Resource (reference counted).

Shared

Marker that indicates that a value currently might be shared in the same or over multiple threads.

Signal
SignalArgument
Spatial

core class Spatial inherits Node (unsafe).

Sprite

core class Sprite inherits Node2D (unsafe).

StringName
TRef

A temporary safe pointer to Godot objects that tracks thread access status. TRef can be coerced into bare references with Deref.

Texture

core class Texture inherits Resource (reference counted).

ThreadLocal

Marker that indicates that a value can currently only be shared in the same thread.

Timer

core class Timer inherits Node (unsafe).

Transform

3D Transformation (3x4 matrix) Using basis + origin representation.

Tween

core class Tween inherits Node (unsafe).

Unique

Marker that indicates that a value currently only has a single unique reference.

Variant

A Variant can represent many of godot's core types.

VariantArray

A reference-counted Variant vector. Godot's generic array data type. Negative indices can be used to count from the right.

Viewport

core class Viewport inherits Node (unsafe).

Enums

GodotError

Error codes used in various Godot APIs.

VariantOperator

Godot variant operator kind.

VariantType

Traits

AsArg

Trait for safe conversion from Godot object references into API method arguments. This is a sealed trait with no public interface.

FromVariant

Types that can be converted from a Variant.

GodotObject

Trait for Godot API objects. This trait is sealed, and implemented for generated wrapper types.

Instanciable

GodotObjects that have a zero argument constructor.

NativeClass

Trait used for describing and initializing a Godot script class.

NativeClassMethods

Trait used to provide information of Godot-exposed methods of a script class.

OwnedToVariant

Types that can only be safely converted to a Variant as owned values. Such types cannot implement ToVariant in general, but can still be passed to API methods as arguments, or used as return values. Notably, this includes Unique arrays, dictionaries, and references to Godot objects and instances.

QueueFree

Manually managed Godot classes implementing queue_free. This trait has no public interface. See Ref::queue_free.

SubClass

Marker trait for API types that are subclasses of another type. This trait is implemented by the bindings generator, and has no public interface. Users should not attempt to implement this trait.

ToVariant

Types that can be converted to a Variant.

Vector2Godot

Helper methods for Vector2.

Vector3Godot

Helper methods for Vector3.

Type Definitions

Angle
ByteArray

A reference-counted vector of u8 that uses Godot's pool allocator.

ColorArray

A reference-counted vector of Color that uses Godot's pool allocator.

Float32Array

A reference-counted vector of f32 that uses Godot's pool allocator.

Int32Array

A reference-counted vector of i32 that uses Godot's pool allocator.

Point2
Point3
Quat
Rect2
Rotation2D
Rotation3D
StringArray

A reference-counted vector of GodotString that uses Godot's pool allocator.

Transform2D
Vector2
Vector2Array

A reference-counted vector of Vector2 that uses Godot's pool allocator.

Vector3
Vector3Array

A reference-counted vector of Vector3 that uses Godot's pool allocator.

Attribute Macros

methods

Derive Macros

FromVariant
NativeClass
OwnedToVariant
ToVariant