Macro stakker::ret_some_do

source ·
macro_rules! ret_some_do {
    ($cb:expr) => { ... };
}
Expand description

Create a Ret instance which performs an arbitrary action, ignoring drops

Like ret_some_to!, this ignores the case of the Ret instance being dropped, so the message is received without the wrapping Option. The action is performed immediately at the point in the code where the message is returned. So this is executed synchronously rather than asynchronously. However it will normally be used to defer a call, since it doesn’t have access to any actor, just the message data. If it doesn’t have an actor reference available, it will probably need to capture a Deferrer in the closure.

ret_some_do!(|msg| ...);

Implemented using Ret::new.