Add explanation about exporting custom types
@@ -22,6 +22,9 @@ impl GreetingResource {
#[derive(NativeClass)]
#[inherit(Node)]
struct Greeter {
+ // It's possible to export any type that implements `Export`, `ToVariant` and `FromVariant` using `#[property]`
+ // All these traits are implemented for `Instance<T, Shared>` where the base class of `T` is reference-counted.
+ // `Resource` inherits from `Reference`, so all native scripts extending `Resource` have reference-counted base classes.
#[property]
greeting_resource: Option<Instance<GreetingResource, Shared>>,
}
