pub struct SignalBuilder { /* private fields */ }
Expand description
Builder for signals.
Implementations§
Source§impl SignalBuilder
impl SignalBuilder
Sourcepub fn param_types(
self,
param_types: impl IntoIterator<Item = impl Into<SignalType>>,
) -> Self
pub fn param_types( self, param_types: impl IntoIterator<Item = impl Into<SignalType>>, ) -> Self
The signal’s parameters.
Sourcepub fn return_type<T: StaticType>(self) -> Self
pub fn return_type<T: StaticType>(self) -> Self
The signal’s returned value type.
Sourcepub fn return_type_from(self, type_: impl Into<SignalType>) -> Self
pub fn return_type_from(self, type_: impl Into<SignalType>) -> Self
The signal’s returned value type.
Sourcepub fn run_cleanup(self) -> Self
pub fn run_cleanup(self) -> Self
Run the signal class handler in the last emission stage.
Sourcepub fn no_recurse(self) -> Self
pub fn no_recurse(self) -> Self
Signals being emitted for an object while currently being in emission for this very object will not be emitted recursively, but instead cause the first emission to be restarted.
Sourcepub fn detailed(self) -> Self
pub fn detailed(self) -> Self
This signal supports “::detail” appendices to the signal name upon handler connections and emissions.
Sourcepub fn action(self) -> Self
pub fn action(self) -> Self
Action signals are signals that may freely be emitted on alive objects from user code.
Sourcepub fn must_collect(self) -> Self
pub fn must_collect(self) -> Self
Varargs signal emission will always collect the arguments, even if there are no signal handlers connected.
Sourcepub fn deprecated(self) -> Self
pub fn deprecated(self) -> Self
The signal is deprecated and will be removed in a future version.
Sourcepub fn flags(self, flags: SignalFlags) -> Self
pub fn flags(self, flags: SignalFlags) -> Self
Explicitly set all flags.
This overrides previously set flags on this builder.
Sourcepub fn class_handler<F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static>(
self,
func: F,
) -> Self
pub fn class_handler<F: Fn(&[Value]) -> Option<Value> + Send + Sync + 'static>( self, func: F, ) -> Self
Class handler for this signal.
Sourcepub fn accumulator<F: Fn(&SignalInvocationHint, Value, &Value) -> ControlFlow<Value, Value> + Send + Sync + 'static>(
self,
func: F,
) -> Self
pub fn accumulator<F: Fn(&SignalInvocationHint, Value, &Value) -> ControlFlow<Value, Value> + Send + Sync + 'static>( self, func: F, ) -> Self
Accumulator for the return values of the signal.
This is called if multiple signal handlers are connected to the signal for accumulating the return values into a single value.