Action

Trait Action 

Source
pub trait Action: Debug + Any {
    // Required method
    fn stateful(
        &self,
        io: &IoManager,
        res: &ResourceManager,
        config: &Config,
        sync_writer: &QWriter<SyncSignal>,
        async_writer: &QWriter<AsyncSignal>,
    ) -> Result<Box<dyn StatefulAction>>;

    // Provided methods
    fn init(self) -> Result<Box<dyn Action>>
       where Self: 'static + Sized { ... }
    fn in_signals(&self) -> BTreeSet<SignalId> { ... }
    fn out_signals(&self) -> BTreeSet<SignalId> { ... }
    fn resources(&self, config: &Config) -> Vec<ResourceAddr> { ... }
}

Required Methods§

Source

fn stateful( &self, io: &IoManager, res: &ResourceManager, config: &Config, sync_writer: &QWriter<SyncSignal>, async_writer: &QWriter<AsyncSignal>, ) -> Result<Box<dyn StatefulAction>>

Provided Methods§

Source

fn init(self) -> Result<Box<dyn Action>>
where Self: 'static + Sized,

Source

fn in_signals(&self) -> BTreeSet<SignalId>

Source

fn out_signals(&self) -> BTreeSet<SignalId>

Source

fn resources(&self, config: &Config) -> Vec<ResourceAddr>

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for Box<dyn Action>

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a> From<&'a (dyn Action + 'static)> for ActionEnumAsRef<'a>

Source§

fn from(f: &dyn Action) -> ActionEnumAsRef<'_>

Converts to this type from the input type.
Source§

impl Serialize for Box<dyn Action>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§