Module export

Source
Expand description

Functionality for user-defined types exported to the engine (native scripts).

NativeScript allows users to have their own scripts in a native language (in this case Rust). It is not the same as GDNative, the native interface to call into Godot. Symbols in this module allow registration, exporting and management of user-defined types which are wrapped in native scripts.

If you are looking for how to manage Godot core types or classes (objects), check out the core_types and object modules, respectively.

To handle initialization and shutdown of godot-rust, take a look at the init module.

For full examples, see examples in the godot-rust repository.

Modules§

hint
Strongly typed property hints.
user_data
Customizable user-data wrappers.

Macros§

godot_wrap_method
Convenience macro to wrap an object’s method into a Method implementor that can be passed to the engine when registering a class.

Structs§

ArgBuilder
Builder for providing additional argument information for error reporting.
ArgumentError
Error during argument parsing.
ClassBuilder
Allows registration of exported properties, methods and signals.
ExportInfo
Metadata about the exported property.
IndexBounds
Defines which number of arguments is valid.
MethodBuilder
Builder type used to register a method on a NativeClass.
Property
Placeholder type for exported properties with no backing field.
PropertyBuilder
Builder type used to register a property on a NativeClass.
PropertyUsage
SignalBuilder
Class to construct a signal. Make sure to call Self::done() in the end.
SignalParam
Parameter in a signal declaration.
StaticArgs
Adapter for methods whose arguments are statically determined. If the arguments would fail to type check, the method will print the errors to Godot’s debug console and return null.
Varargs
Safe interface to a list of borrowed method arguments with a convenient API for common operations with them.

Enums§

RpcMode
VarargsError
All possible errors that can occur when converting from Varargs.

Traits§

Export
Trait for exportable types.
FromVarargs
Trait for structures that can be parsed from Varargs.
Method
Safe low-level trait for stateful, variadic methods that can be called on a native script type.
Mixin
Trait for mixins, manually registered #[methods] blocks that may be applied to multiple types.
NativeClass
Trait used for describing and initializing a Godot script class.
NativeClassMethods
Trait used to provide information of Godot-exposed methods of a script class.
OwnerArg
Trait for types that can be used as the owner arguments of exported methods. This trait is sealed and has no public interface.
StaticArgsMethod
Trait for methods whose argument lists are known at compile time. Not to be confused with a “static method”.
StaticallyNamed
A NativeScript “class” that is statically named. NativeClass types that implement this trait can be registered using [InitHandle::add_class].