Struct relm4::FactorySender

source ·
pub struct FactorySender<C: FactoryComponent> { /* private fields */ }
Expand description

Contains senders to send and receive messages from a Component.

Implementations§

Retrieve the sender for input messages.

Useful to forward inputs from another component. If you just need to send input messages, input() is more concise.

Retrieve the sender for output messages.

Useful to forward outputs from another component. If you just need to send output messages, output() is more concise.

Retrieve the sender for command output messages.

Useful to forward outputs from another component. If you just need to send output messages, command() is more concise.

Emit an input to the component.

Spawns an asynchronous command. You can bind the the command to the lifetime of the component by using a ShutdownReceiver.

Spawns a synchronous command.

This is particularly useful for CPU-intensive background jobs that need to run on a thread-pool in the background.

If you expect the component to be dropped while the command is running take care while sending messages!

Spawns a future that will be dropped as soon as the factory component is shut down.

Essentially, this is a simpler version of Self::command().

Spawns a synchronous command that will be dropped as soon as the factory component is shut down.

Essentially, this is a simpler version of Self::spawn_command().

Emit an output to the component.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Returns the position. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more