Trait GodotConvert
pub trait GodotConvert {
type Via: GodotType;
}Expand description
Indicates that a type can be passed to/from Godot, either directly or through an intermediate “via” type.
The associated type Via specifies how this type is passed across the FFI boundary to/from Godot.
Generally ToGodot needs to be implemented to pass a type to Godot, and FromGodot to receive this type from Godot.
GodotType is a stronger bound than GodotConvert, since it expresses that a type is directly representable
in Godot (without intermediate “via”). Every GodotType also implements GodotConvert with Via = Self.
Please read the godot::meta module docs for further information about conversions.
§u64
The type u64 is not supported by ToGodot and FromGodot traits. You can thus not pass it in #[func] parameters/return types.
The reason is that Godot’s Variant type, and therefore also GDScript, only support signed 64-bit integers (i64).
Implicitly wrapping u64 to i64 would be surprising behavior, as the value could suddenly change for large numbers.
As such, godot-rust leaves this decision to users: it’s possible to define a newtype around u64 with custom ToGodot/FromGodot impls.