#async #promise #future

pinky-swear

Futures and async/await-ready Promises

38 stable releases (6 major)

6.2.1 Aug 15, 2025
6.2.0 Nov 14, 2023
6.1.0 Jan 30, 2022
5.2.1 Jan 4, 2022
0.4.2 Oct 31, 2019

#94 in Asynchronous

Download history 88514/week @ 2026-01-19 99556/week @ 2026-01-26 121928/week @ 2026-02-02 140572/week @ 2026-02-09 134466/week @ 2026-02-16 174613/week @ 2026-02-23 167629/week @ 2026-03-02 191549/week @ 2026-03-09 175834/week @ 2026-03-16 124360/week @ 2026-03-23 120598/week @ 2026-03-30 132922/week @ 2026-04-06 124075/week @ 2026-04-13 116899/week @ 2026-04-20 112125/week @ 2026-04-27 63593/week @ 2026-05-04

422,877 downloads per month
Used in 123 crates (2 directly)

BSD-2-Clause

11KB
192 lines

Simple promise library compatible with std::future and async/await

API Docs Build status Downloads

Example

Create a promise and wait for the result while computing the result in another thread

use pinky_swear::{Pinky, PinkySwear};
use std::{thread, time::Duration};

fn compute(pinky: Pinky<Result<u32, ()>>) {
    thread::sleep(Duration::from_millis(1000));
    pinky.swear(Ok(42));
}

fn main() {
    let (promise, pinky) = PinkySwear::new();
    thread::spawn(move || {
        compute(pinky);
    });
    assert_eq!(promise.wait(), Ok(42));
}

Dependencies

~5–7.5MB
~60K SLoC