Trait Export
pub trait Export: Var {
// Provided methods
fn export_hint() -> PropertyHintInfo { ... }
fn as_node_class() -> Option<ClassName> { ... }
}
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.
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.
fn as_node_class() -> Option<ClassName>
fn as_node_class() -> Option<ClassName>
If this is a class inheriting Node
, returns the ClassName
; otherwise None
.
Only overridden for Gd<T>
, to detect erroneous exports of Node
inside a Resource
class.
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.