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§
- Maybe unaligned pool array access
- Geometric types.
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
DictionaryofVariantkey-value pairs. - Godot’s reference-counted string type.
- Error indicating that an
i64cannot be converted to aMargin. - 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
Variantcan represent all Godot values (core types orObjectclass instances). - A reference-counted
Variantvector. Godot’s generic array data type. Negative indices can be used to count from the right. - 2D vector class.
- 3D vector class.
Enums§
- Error type returned by
FromVariant::from_variant. - Error codes used in various Godot APIs.
- Provides compatibility with Godot’s
Marginenum through theTryFromtrait.
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
Variantas owned values. Such types cannot implementToVariantin general, but can still be passed to API methods as arguments, or used as return values. Notably, this includesUniquearrays, 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
ToVariantimplementations preserve equivalence.
Type Aliases§
- Result type with GodotError