Skip to main content

boxed

Function boxed 

Source
pub fn boxed<'a, T>(fut: impl Future<Output = T> + 'a) -> LocalBoxFuture<'a, T>
Expand description

Wraps an async block into a LocalBoxFuture. Use this when passing closures to fallible_transaction or infallible_transaction:

fallible_transaction(|tx| boxed(async move {
    tx.execute(op1, input).await?;
    Ok(result)
})).await;