dyn-future 3.0.4

Convenient and fast dynamic Futures for Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use dyn_future::DynFuture;
use futures::future;
use futures::executor::block_on;
use std::pin::Pin;

fn make() -> Pin<DynFuture<Box<u64>>> {
    DynFuture::new(future::ready(Box::new(420)))
}

#[test]
fn consume_dyn_future_box() {
    assert_eq!(block_on(make()), Box::new(420))
}

#[test]
fn drop_dyn_future_box() {
    drop(make())
}