pub struct MapSignal<T> { /* private fields */ }
Expand description

Block which applies a closure to every received Message (e.g. Signal) before sending it further.

Note that this block doesn’t allow to specify how RecvErrors are handled. Thus in in many cases, it is better to implement a custom type as Consumer/Producer (see Nop for an example) instead of using this block.

See also MapSample for a block which performs the operation on a per-sample basis and may be better suited when wanting to apply a function to each sample.

Implementations§

Creates a block which doesn’t modify the received messages (e.g. which doesn’t modify the Signals)

Creates a block which applies the given closure to each message (e.g. to each Signal)

Modifies the used closure, which is applied to every sample

Trait Implementations§

Obtain reference to ReceiverConnector
Connect Consumer to Producer
Disconnect Consumer from any connected Producer if connected
Obtain reference to SenderConnector
Connect Producer to Consumer

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.