@@ -39,7 +39,7 @@ use std::ffi::CString;
39
39
use std:: marker:: PhantomData ;
40
40
use std:: ptr;
41
41
42
- use crate :: core_types:: { GodotString , Variant } ;
42
+ use crate :: core_types:: { GodotString , ToVariant , Variant } ;
43
43
use crate :: nativescript:: { user_data:: UserData , NativeClass , NativeClassMethods } ;
44
44
use crate :: object:: { GodotObject , NewRef , TRef } ;
45
45
use crate :: private:: get_api;
@@ -53,7 +53,22 @@ pub mod property;
53
53
pub use self :: method:: {
54
54
Method , MethodBuilder , RpcMode , ScriptMethod , ScriptMethodAttributes , ScriptMethodFn , Varargs ,
55
55
} ;
56
- pub use self :: property:: { Export , ExportInfo , PropertyBuilder , Usage as PropertyUsage } ;
56
+ pub use self :: property:: { ExportInfo , PropertyBuilder , Usage as PropertyUsage } ;
57
+
58
+ /// Trait for exportable types.
59
+ pub trait Export : ToVariant {
60
+ /// A type-specific hint type that is valid for the type being exported.
61
+ ///
62
+ /// If this type shows up as `NoHint`, a private, uninhabitable type indicating
63
+ /// that there are no hints available for the time being, users *must* use `None`
64
+ /// for properties of this type. This ensures that it will not be a breaking change
65
+ /// to add a hint for the type later, since it supports no operations and cannot
66
+ /// be named directly in user code.
67
+ type Hint ;
68
+
69
+ /// Returns `ExportInfo` given an optional typed hint.
70
+ fn export_info ( hint : Option < Self :: Hint > ) -> ExportInfo ;
71
+ }
57
72
58
73
/// A handle that can register new classes to the engine during initialization.
59
74
///
0 commit comments