post-haste logo

post-haste

Free

A no_std, alloc-free async Rust library for creating modular projects.

FreeFree tier
Type
Open Source

About post-haste

Post-haste is a no_std, alloc-free async Rust library designed for building highly modular codebases in resource-constrained environments. It introduces two core abstractions: Agents, which encapsulate single-responsibility functionality with a create() and run() lifecycle, and a Postmaster, which enables compile-time defined inter-agent communication via message passing. The library uses macros (init_postmaster!, addresses, payloads) to generate efficient, allocation-free communication channels, making it ideal for embedded systems, IoT devices, and other memory-limited targets. Agents register with the Postmaster and communicate via typed mailboxes, with configurable send timeouts. The project is maintained on GitHub under the MIT license.

Key Features

Agent trait with create() and run() lifecycle for modular components
Postmaster for compile-time defined message passing between agents
init_postmaster!() macro for generating allocation-free communication infrastructure
addresses and payloads macros for type-safe enums
Supports configurable send timeout (default 1000 microseconds)
Designed for no_std and alloc-free environments

Pros & Cons

Pros
  • No_std and alloc-free, suitable for resource-constrained targets
  • Compile-time safety reduces runtime overhead
  • Clear separation of concerns via single-responsibility Agents
  • Async task support for concurrent agents
Cons
  • Requires compile-time knowledge of all agents and payloads (not dynamic)
  • Limited ecosystem and small community (8 stars on GitHub)
  • Primarily targeted at embedded/constrained use cases, less flexible for general applications

Best For

Embedded systems and bare-metal programmingIoT devices with limited memory and processingReal-time systems requiring deterministic behaviorAny Rust project needing a lightweight, modular actor framework

FAQ

What is Post-haste?
Post-haste is a no_std, alloc-free async Rust library for creating modular projects using Agents and a Postmaster for inter-agent communication.
How does the Agent trait work?
Agents implement the Agent trait, which requires a create() function for instantiation and a run() function as the main async loop. The run() function receives an inbox for receiving messages.
How does the Postmaster handle communication?
The Postmaster is generated at compile-time via the init_postmaster!() macro. It uses address and payload enums annotated with macros to route messages between agents without allocations.
Is Post-haste suitable for no_std targets?
Yes, the library is explicitly designed to be no_std and alloc-free, making it ideal for embedded and bare-metal environments.