Function report_progress

Source
pub fn report_progress<E>(
    sender: &Sender<CommandQueue>,
    event: E,
) -> Result<(), SendError<CommandQueue>>
where E: Event,
Expand description

A helper function for reporting progress from a task controlled by AsyncComponent.

This method is a shorthand for creating a CommandQueue, pushing a single command that dispatches an event (of type E) and sends it over the sender.

§Example

#[derive(Event)]
struct FooEvent;

report_progress(&sender, FooEvent)?;

§Errors

This method forwards the Result received from calling sender.send(...).