Type Definition smol::future::BoxedLocal

source · []
pub type BoxedLocal<T> = Pin<Box<dyn Future<Output = T> + 'static, Global>>;
Expand description

Type alias for Pin<Box<dyn Future<Output = T> + 'static>>.

Examples

use futures_lite::future::{self, FutureExt};

// These two lines are equivalent:
let f1: future::BoxedLocal<i32> = async { 1 + 2 }.boxed_local();
let f2: future::BoxedLocal<i32> = Box::pin(async { 1 + 2 });