Trait godot_core::meta::ArrayElement

source ·
pub trait ArrayElement: GodotType { }
Expand description

Marker trait to identify types that can be stored in [Array<T>][crate::builtin::Array].

The types for which this trait is implemented, overlap mostly with GodotType. This is done consistently what GDScript allows inside Array[T].

Notable differences are:

  • Only VariantArray, not Array<T> is allowed (typed arrays cannot be nested).
  • Option is only supported for Option<Gd<T>>, but not e.g. Option<i32>.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ArrayElement for bool

source§

impl ArrayElement for f32

source§

impl ArrayElement for f64

source§

impl ArrayElement for i8

source§

impl ArrayElement for i16

source§

impl ArrayElement for i32

source§

impl ArrayElement for i64

source§

impl ArrayElement for u8

source§

impl ArrayElement for u16

source§

impl ArrayElement for u32

source§

impl<T: GodotClass> ArrayElement for Option<Gd<T>>

Implementors§