act

Macro act 

Source
macro_rules! act {
    ($actor:ident => $expr:expr) => { ... };
    ($actor:ident => $body:block) => { ... };
}
Expand description

Create action returning Result<T, E>.

§Example

handle.call(act!(actor => async move {
    if actor.value < 0 {
        Err(io::Error::new(io::ErrorKind::Other, "negative"))
    } else {
        Ok(actor.value)
    }
})).await?