act

Macro act 

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

Write an actor action that returns anyhow::Result<T>.

This macro helps create the closure expected by Handle::call when your action returns Result<T, anyhow::Error>. Use act_ok! if your action returns a plain T.

Examples

Self.api.call(act!(actor => actor.do_something())).await
// or with a block
Self.api.call(act!(actor => async move { actor.do_something().await })).await