Attribute Macro spaad::handler[][src]

#[handler]
Expand description

This marks a function as a handler for a type of message, exposing it to external callers.

Usage

#[spaad::handler]
async fn do_something(&mut self) {/* ... */}

// will generate a message for you
#[spaad::handler]
async fn do_something(&mut self, str: String) {/* ... */}

// will reuse an existing message
#[spaad::handler(msg = "AMsg")]
async fn do_something_with_a_msg(&mut self, msg: AMsg) {/* ... */}