#async #future

dev auto-future

For quickly making a struct into a future via an async fn

1 stable release

1.0.0 Feb 1, 2023

#1169 in Asynchronous

Download history 48408/week @ 2025-06-07 44999/week @ 2025-06-14 66551/week @ 2025-06-21 40424/week @ 2025-06-28 55603/week @ 2025-07-05 53500/week @ 2025-07-12 49072/week @ 2025-07-19 63097/week @ 2025-07-26 60974/week @ 2025-08-02 65048/week @ 2025-08-09 65165/week @ 2025-08-16 70175/week @ 2025-08-23 65047/week @ 2025-08-30 65823/week @ 2025-09-06 71695/week @ 2025-09-13 68859/week @ 2025-09-20

282,714 downloads per month
Used in 75 crates (via kantan)

MIT license

4KB

Auto Future
a means for easily building futurable structs

crate docs

This is for quickly making structs futurable, where the future implementation is an underlying async fn.

See this example for details ...

  use ::auto_future::AutoFuture;

  struct ExampleStruct;

  impl ExampleStruct {
    async fn do_async_work(self) -> u32 {
      // perform a bunch of awaited calls ...

      123
    }
  }

  impl IntoFuture for ExampleStruct {
      type Output = u32;
      type IntoFuture = AutoFuture<u32>;

      fn into_future(self) -> Self::IntoFuture {
          let raw_future = self.do_async_work();
          AutoFuture::new(raw_future)
      }
  }

No runtime deps