Struct gdnative_core::export::SignalBuilder
source · pub struct SignalBuilder<'a, C> { /* private fields */ }
Expand description
Class to construct a signal. Make sure to call Self::done()
in the end.
Signal parameters can be added with the various param*()
methods.
Keep in mind that unlike function parameters, signal parameters (both their lengths and types)
are not statically checked in Godot. The parameter signature you specify is simply to assist you
in the editor UI and with auto-generation of GDScript signal handlers.
Implementations§
source§impl<'a, C: NativeClass> SignalBuilder<'a, C>
impl<'a, C: NativeClass> SignalBuilder<'a, C>
sourcepub fn with_param(self, parameter_name: &str, parameter_type: VariantType) -> Self
pub fn with_param(self, parameter_name: &str, parameter_type: VariantType) -> Self
Add a parameter for the signal with a name and type.
Note that GDScript signal parameters are generally untyped and not checked at runtime. The type is solely used for UI purposes.
sourcepub fn with_param_default(
self,
parameter_name: &str,
default_value: Variant
) -> Self
pub fn with_param_default(
self,
parameter_name: &str,
default_value: Variant
) -> Self
Add a parameter for the signal with a name and default value.
The type is inferred from the default value. Note that GDScript signal parameters are generally untyped and not checked at runtime. The type is solely used for UI purposes.
sourcepub fn with_param_untyped(self, parameter_name: &str) -> Self
pub fn with_param_untyped(self, parameter_name: &str) -> Self
Add a (untyped) parameter for the signal with a name.
Types are not required or checked at runtime, but they help for editor UI and auto-generation of signal listeners.
sourcepub fn with_param_custom(self, parameter: SignalParam) -> Self
pub fn with_param_custom(self, parameter: SignalParam) -> Self
Add a parameter for the signal, manually configured.