Trait SignalReceiver
pub trait SignalReceiver<C, Ps>: 'static {
// Required method
fn call(&mut self, maybe_instance: C, params: Ps);
}
Expand description
Trait that is implemented for functions that can be connected to signals.
This is used in ConnectBuilder
.
There are three variations of the C
(class instance) parameter:
()
for global and associated (“static”) functions.&C
for&self
methods.&mut C
for&mut self
methods.
See also Signals in the book.
§Usage as a bound
To write generic code that handles different functions and forwards them to TypedSignal
and ConnectBuilder
APIs,
you have to use SignalReceiver
in combination with IndirectSignalReceiver
. Consult the docs of the latter for elaboration.
§Hidden impls
in this doc
To keep this documentation readable, we only document one variant of each impl SignalReceiver
: arbitrarily the one with three parameters
(P0, P1, P2)
. Keep this in mind when looking at a concrete signature.
Required Methods§
fn call(&mut self, maybe_instance: C, params: Ps)
fn call(&mut self, maybe_instance: C, params: Ps)
Invoke the receiver on the given instance (possibly ()
) with params
.