@@ -39,7 +39,7 @@ use std::ffi::CString;
3939use std:: marker:: PhantomData ;
4040use std:: ptr;
4141
42- use crate :: core_types:: { GodotString , Variant } ;
42+ use crate :: core_types:: { GodotString , ToVariant , Variant } ;
4343use crate :: nativescript:: { user_data:: UserData , NativeClass , NativeClassMethods } ;
4444use crate :: object:: { GodotObject , NewRef , TRef } ;
4545use crate :: private:: get_api;
@@ -53,7 +53,22 @@ pub mod property;
5353pub use self :: method:: {
5454 Method , MethodBuilder , RpcMode , ScriptMethod , ScriptMethodAttributes , ScriptMethodFn , Varargs ,
5555} ;
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+ }
5772
5873/// A handle that can register new classes to the engine during initialization.
5974///
0 commit comments