Trait Export
pub trait Export: Var {
// Provided method
fn export_hint() -> PropertyHintInfo { ... }
}
Expand description
Trait implemented for types that can be used as #[export]
fields.
Export
is only implemented for objects Gd<T>
if either T: Inherits<Node>
or T: Inherits<Resource>
, just like GDScript.
This means you cannot use #[export]
with Gd<RefCounted>
, for example.
For enums, this trait can be derived using the #[derive(Export)]
macro.
Provided Methods§
fn export_hint() -> PropertyHintInfo
fn export_hint() -> PropertyHintInfo
The export info to use for an exported field of this type, if no other export info is specified.
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 Export for bool
impl Export for bool
fn export_hint() -> PropertyHintInfo
§impl Export for f32
impl Export for f32
fn export_hint() -> PropertyHintInfo
§impl Export for f64
impl Export for f64
fn export_hint() -> PropertyHintInfo
§impl Export for i8
impl Export for i8
fn export_hint() -> PropertyHintInfo
§impl Export for i16
impl Export for i16
fn export_hint() -> PropertyHintInfo
§impl Export for i32
impl Export for i32
fn export_hint() -> PropertyHintInfo
§impl Export for i64
impl Export for i64
fn export_hint() -> PropertyHintInfo
§impl Export for u8
impl Export for u8
fn export_hint() -> PropertyHintInfo
§impl Export for u16
impl Export for u16
fn export_hint() -> PropertyHintInfo
§impl Export for u32
impl Export for u32
fn export_hint() -> PropertyHintInfo
§impl<T> Export for Option<Gd<T>>
impl<T> Export for Option<Gd<T>>
fn export_hint() -> PropertyHintInfo
§impl<T> Export for Option<T>
impl<T> Export for Option<T>
fn export_hint() -> PropertyHintInfo
§impl<T, D> Export for Option<DynGd<T, D>>
#[export]
for Option<DynGd<T, D>>
is available only for T
being Engine class (such as Node or Resource).
impl<T, D> Export for Option<DynGd<T, D>>
#[export]
for Option<DynGd<T, D>>
is available only for T
being Engine class (such as Node or Resource).
Consider exporting Option<Gd<T>>
instead of Option<DynGd<T, D>>
for user-declared GDExtension classes.
fn export_hint() -> PropertyHintInfo
Implementors§
impl Export for Aabb
impl Export for Basis
impl Export for Color
impl Export for Dictionary
impl Export for GString
impl Export for NodePath
impl Export for PackedByteArray
impl Export for PackedColorArray
impl Export for PackedFloat32Array
impl Export for PackedFloat64Array
impl Export for PackedInt32Array
impl Export for PackedInt64Array
impl Export for PackedStringArray
impl Export for PackedVector2Array
impl Export for PackedVector3Array
impl Export for PackedVector4Array
impl Export for Plane
impl Export for Projection
impl Export for Quaternion
impl Export for Rect2
impl Export for Rect2i
impl Export for StringName
impl Export for Transform2D
impl Export for Transform3D
impl Export for Variant
impl Export for Vector2
impl Export for Vector2i
impl Export for Vector3
impl Export for Vector3i
impl Export for Vector4
impl Export for Vector4i
impl<T> Export for Array<Gd<T>>where
T: GodotClass<Exportable = Yes> + Bounds,
impl<T> Export for Array<T>where
T: ArrayElement + Export,
impl<T> Export for OnEditor<Gd<T>>
impl<T> Export for OnEditor<T>
impl<T, D> Export for Array<DynGd<T, D>>where
T: GodotClass<Exportable = Yes, Declarer = DeclEngine> + Bounds + GodotClass,
D: 'static + ?Sized,
#[export]
for Array<DynGd<T, D>>
is available only for T
being Engine class (such as Node or Resource).
Consider exporting Array<Gd<T>>
instead of Array<DynGd<T, D>>
for user-declared GDExtension classes.
impl<T, D> Export for OnEditor<DynGd<T, D>>where
T: GodotClass<Exportable = Yes, Declarer = DeclEngine> + Bounds,
OnEditor<DynGd<T, D>>: Var,
D: 'static + ?Sized,
#[export]
for OnEditor<DynGd<T, D>>
is available only for T
being Engine class (such as Node or Resource).
Consider exporting OnEditor<Gd<T>>
instead of OnEditor<DynGd<T, D>>
for user-declared GDExtension classes.