Struct sauron::cmd::Cmd[][src]

pub struct Cmd<DSP> {
    pub commands: Vec<Rc<dyn Fn(DSP) + 'static>, Global>,
    pub should_update_view: bool,
}
Expand description

Cmd is a command to be executed by the system. This is returned at the init function of a component and is executed right after instantiation of that component. Cmd required a DSP object which is the Program as an argument The emit function is called with the program argument. The callback is supplied with the program an is then executed/emitted.

Fields

commands: Vec<Rc<dyn Fn(DSP) + 'static>, Global>

the functions that would be executed when this Cmd is emited

should_update_view: bool

this instruct the program whether or not to update the view

Implementations

creates a new Cmd from a function

creates a unified Cmd which batches all the other Cmds in one.

A Cmd with no callback, similar to NoOp.

Executes the Cmd

Creates an empty Cmd and specifies that there is NO update will be made to the view.

Create a cmd which instruct the program that there is NO update will be made to the view

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

Performs the conversion.

Performs the conversion.

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.