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<Box<dyn FnOnce(DSP)>>
the functions that would be executed when this Cmd is emited
Implementations
sourceimpl<DSP> Cmd<DSP> where
DSP: 'static,
impl<DSP> Cmd<DSP> where
DSP: 'static,
sourcepub fn batch(cmds: impl IntoIterator<Item = Self>) -> Self
pub fn batch(cmds: impl IntoIterator<Item = Self>) -> Self
When you need the runtime to perform couple of commands, you can batch then together.
sourcepub fn append(self, cmds: impl IntoIterator<Item = Self>) -> Self
pub fn append(self, cmds: impl IntoIterator<Item = Self>) -> Self
Append more cmd into this cmd and return self
sourcepub fn should_update_view(self, should_update_view: bool) -> Self
pub fn should_update_view(self, should_update_view: bool) -> Self
Modify the Cmd such that whether or not it will update the view set by should_update_view
when the cmd is executed in the program
sourcepub fn no_render(self) -> Self
pub fn no_render(self) -> Self
Modify the command such that it will not do an update on the view when it is executed.
sourcepub fn measure(self) -> Self
pub fn measure(self) -> Self
Modify the command such that it will log measurement when it is executed
sourcepub fn measure_with_name(self, name: &str) -> Self
pub fn measure_with_name(self, name: &str) -> Self
Modify the Cmd such that it will log a measuregment when it is executed
The measurement_name
is set to distinguish the measurements from each other.
Trait Implementations
Auto Trait Implementations
impl<DSP> !RefUnwindSafe for Cmd<DSP>
impl<DSP> !Send for Cmd<DSP>
impl<DSP> !Sync for Cmd<DSP>
impl<DSP> Unpin for Cmd<DSP>
impl<DSP> !UnwindSafe for Cmd<DSP>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more