tpt-async

Rust

Runtime-agnostic async I/O stack for Rust — no_std-compatible traits, executor, timer wheel, TLS, HTTP, and WebSocket across 9 focused crates.

0 stars0 forks0 watchers

Languages

Rust100.0%
README

tpt-async

The runtime-agnostic async I/O stack for Rust.
From a 2 MB RAM Cortex-M microcontroller to a 64-core cloud server — one API, no forced executor, no 150-crate dependency tree.

CI Crates.io docs.rs License: MIT OR Apache-2.0

Quick Start

[dependencies]
tpt-async  = "0.1"
tpt-net-http = "0.1"
tpt-net-tls  = "0.1"
use tpt_async::prelude::*;
use tpt_net_http::prelude::*;

#[tpt_async::main]
async fn main() {
    let client = HttpClient::builder()
        .tls(tpt_net_tls::rustls_config())
        .build();

    let response = client
        .get("https://api.tpt.solutions/health")
        .timeout(Duration::from_millis(500))
        .send()
        .await
        .unwrap();

    println!("Status: {}", response.status());
}

Workspace Crates

CrateDescriptionno_std
tpt-async-coreSpawn/LocalSpawn traits, Waker utils, state-machine helpers
tpt-async-macros#[tpt_async::main] proc-macro
tpt-async-executorOptional single-threaded cooperative executoralloc
tpt-async-timerConst-generic heapless hierarchical timer wheel
tpt-async-ioZero-copy AsyncRead/AsyncWrite over std/tokio/async-std/bare-metalalloc
tpt-net-tlsrustls 0.23 wrapper — no OpenSSLstd
tpt-net-httpHTTP/1.1 + HTTP/2 zero-copy client/serverstd
tpt-net-wsPure-Rust WebSocket client/serverstd
tpt-asyncFacade re-exporting tpt_async::preludefeature-gated

Design Principles

  • No async-trait — uses RPITIT (async fn in traits, stable since Rust 1.75). Zero heap allocation from trait dispatch.
  • Heapless timers — const-generic hierarchical timer wheel: O(1) insertion/removal, zero dynamic allocation.
  • Zero-copy I/O — HTTP headers parsed directly into &[u8] slices from the I/O buffer.
  • Bring your own executor — implement Spawn for your runtime (tokio, async-std, embassy, smol) and everything works.
  • Audited TLS chain — rustls 0.23 only, TLS 1.3 by default, no OpenSSL path, cargo deny enforced.

Supported Targets

  • x86_64-unknown-linux-gnu / x86_64-pc-windows-msvc
  • thumbv7em-none-eabihf (ARM Cortex-M, core + timer crates)
  • riscv32imac-unknown-none-elf (RISC-V bare-metal, core + timer crates)
  • wasm32-unknown-unknown (Browser / WASI)

License

Licensed under either of MIT or Apache-2.0 at your option.
Copyright 2026 TPT Solutions.