future_form 0.3.1

Abstractions over Send and !Send futures
Documentation
use super::*;

async fn use_counter_generic<K: FutureForm>(counter: &impl Counter<K>) -> u32 {
    counter.next().await
}

#[tokio::test]
async fn test_trait_in_trait_sendable() {
    let memory: Memory<Sendable> = Memory::new(41);
    let result = use_counter_generic::<Sendable>(&memory).await;
    assert_eq!(result, 42);
}

#[tokio::test]
async fn test_trait_in_trait_local() {
    let memory: Memory<Local> = Memory::new(41);
    let result = use_counter_generic::<Local>(&memory).await;
    assert_eq!(result, 42);
}