async-trait-static 0.1.0

async fn in trait for no_std
Documentation

Async trait methods for no_std

Features like async-trait, avoid using Box and dyn.

This crate is ready for #![no_std] when PR68524 merged.

Features

  • basic function async fn for trait.
  • support default Implementations.
  • test more feature support.

Usage

use async_trait_static::async_trait;

async fn hello() -> u8 {
    1
}

#[async_trait]
trait AsyncFnTrait {
    async fn run(&self);
}

struct AsyncStruct;

#[async_trait]
impl AsyncFnTrait for AsyncStruct {
    async fn run(&self) {
        hello().await;
    }
}