godot::meta

Trait GodotType

pub trait GodotType:
    Sized
    + GodotConvert<Via = Self>
    + Sealed
    + 'static { }
Expand description

Type that is directly representable in the engine.

This trait cannot be implemented for custom user types; for those, GodotConvert exists instead. A type implements GodotType when Godot has a direct, native representation for it. For instance:

  • i64 implements GodotType, since it can be directly represented by Godot’s int type.
  • But VariantType does not implement GodotType. While it is an enum Godot uses, we have no native way to indicate to Godot that a value should be one of the variants of VariantType.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl GodotType for bool

§

impl GodotType for f32

§

impl GodotType for f64

§

impl GodotType for i8

§

impl GodotType for i16

§

impl GodotType for i32

§

impl GodotType for i64

§

impl GodotType for u8

§

impl GodotType for u16

§

impl GodotType for u32

§

impl GodotType for u64

§

impl GodotType for ()

§

impl<T> GodotType for Option<T>
where T: GodotType, <T as GodotType>::Ffi: GodotNullableFfi, <T as GodotType>::ToFfi<'f>: for<'f> GodotNullableFfi,

Implementors§