Trait BuiltinExport

pub trait BuiltinExport { }
Expand description

Marker trait to identify GodotTypes that can be directly used with an #[export].

Implemented pretty much for all the GodotTypes that are not GodotClass. Provides a few blanket implementations and, by itself, has no implications for the Var or Export traits.

Some Godot Types which are inherently non-nullable (e.g., Gd<T>), might have their value set to null by the editor. Additionally, Godot must generate initial, default value for such properties, causing memory leaks.

Non-algebraic types that don’t implement BuiltinExport shouldn’t be used directly as an #[export] and must be handled using associated algebraic types, such as:

  • Option<T>, which represents optional value that can be null when used.
  • OnEditor<T>, which represents value that must not be null when used.

Implementations on Foreign Types§

§

impl BuiltinExport for bool

§

impl BuiltinExport for f32

§

impl BuiltinExport for f64

§

impl BuiltinExport for i8

§

impl BuiltinExport for i16

§

impl BuiltinExport for i32

§

impl BuiltinExport for i64

§

impl BuiltinExport for u8

§

impl BuiltinExport for u16

§

impl BuiltinExport for u32

§

impl<T> BuiltinExport for Option<T>

Implementors§