Module gdnative::core_types

Expand description

Types that represent core types of Godot.

In contrast to generated Godot class types from the api module, the types in here are hand-written in idiomatic Rust and are the counterparts to built-in types in GDScript.

godot-rust provides optional serialization support for many core types. Enable the feature serde to make use of it.

Modules§

Structs§

  • Axis-aligned bounding box.
  • A 3x3 matrix, typically used as an orthogonal basis for Transform.
  • RGBA color with 32-bit floating point components.
  • A reference-counted Dictionary of Variant key-value pairs.
  • Godot’s reference-counted string type.
  • Error indicating that an i64 cannot be converted to a Margin.
  • 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.
  • 3D plane in Hessian form: a*b + b*y + c*z + d = 0
  • A reference-counted CoW typed vector using Godot’s pool allocator, generic over possible element types.
  • Quaternion, used to represent 3D rotations.
  • 2D axis-aligned bounding box.
  • A RID (“resource ID”) is an opaque handle that refers to a Godot Resource.
  • Interned string.
  • Affine 3D transform (3x4 matrix).
  • Affine 2D transform (2x3 matrix).
  • A Variant can represent all Godot values (core types or Object class instances).
  • A reference-counted Variant vector. Godot’s generic array data type. Negative indices can be used to count from the right.
  • 2D vector class.
  • 3D vector class.

Enums§

Traits§

  • Types that can be coerced from a Variant. Coercions are provided by Godot, with results consistent with GDScript. This cannot be implemented for custom types.
  • Types that can be converted from a Variant. Conversions are performed in Rust, and can be implemented for custom types.
  • 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.
  • Trait for element types that can be contained in PoolArray. This trait is sealed and has no public interface.
  • Types that can be converted to a Variant.
  • Trait for types whose ToVariant implementations preserve equivalence.

Type Aliases§