[][src]Macro async_scoped::unsafe_scope_and_collect

macro_rules! unsafe_scope_and_collect {
    ($fn: expr) => { ... };
}

DEPRECATED: please use the function variant.

A macro that creates a scope and immediately awaits the stream. The outputs of the futures are collected as a Vec and returned along with the output of the block. This macro must be invoked within an async block.

Safety This macro is not completely safe: please see

https://www.reddit.com/r/rust/comments/ee3vsu/asyncscoped_spawn_non_static_futures_with_asyncstd/fbpis3c?utm_source=share&utm_medium=web2x The caller must ensure the enclosing async block (and it's stack) does not collapse before the macro completes driving the stream. However, unless the enclosing future gets forgotten, the implementation will still panic when the returned future is dropped without being fully driven.