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

pub struct Cmd<DSP>(pub Vec<Rc<dyn Fn(DSP) + 'static>, Global>);

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.

Implementations

impl<DSP> Cmd<DSP> where
    DSP: Clone + 'static, 
[src]

pub fn new<F>(f: F) -> Cmd<DSP> where
    F: Fn(DSP) + 'static, 
[src]

creates a new Cmd from a function

pub fn batch(cmds: Vec<Cmd<DSP>, Global>) -> Cmd<DSP>[src]

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

pub fn none() -> Cmd<DSP>[src]

A Cmd with no callback, similar to NoOp.

pub fn emit(self, program: &DSP)[src]

Executes the Cmd

Auto Trait Implementations

impl<DSP> !RefUnwindSafe for Cmd<DSP>[src]

impl<DSP> !Send for Cmd<DSP>[src]

impl<DSP> !Sync for Cmd<DSP>[src]

impl<DSP> Unpin for Cmd<DSP>[src]

impl<DSP> !UnwindSafe for Cmd<DSP>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.