11 breaking releases

Uses new Rust 2024

new 0.12.1 Feb 13, 2026
0.11.0 Feb 7, 2026

#1007 in Network programming


Used in 5 crates

MIT/Apache

165KB
4.5K SLoC

Tehuti

crates-io version

Modular communication system for game development.


lib.rs:

Tehuti is an opinionated communication library, giving useful pluggable primitives for building custom communication systems for various use-cases.

Key concepts:

  • Peers: Individual participants in the communication system.
  • Meetings: Place where peers gather together to communicate.
  • Channels: Communication pathways between peers in a meeting.
  • Packets: The raw data being transmitted between peers over channels.
  • Protocols: Low-level rules and conventions for communication in a meeting.
  • Engines: Custom backends that handle meetings communication in a specific way.

How typical communication works:

  1. Engine on each machine creates a Meeting - in case of networking, think of it as a session, where one machine can host and other machines join.
  2. Meeting creates local peer(s) - think of them as actors that can replicate their state and behavior across machines. Peers define and bind to specific channels with read/write rights. These define a peer role in the meeting. For example instead hardcoded client/server roles, you define which peer role has rights to read/write on which channels - server could have write rights to all channels, since it is the source of truth, while clients could have read rights to most channels, but write rights only to a few channels (e.g. their own input state).
  3. Peers get replicated on all machines joining the meeting, so each machine has a local representation of all remote peers. These remote peers are automatically kept in sync by the meeting engine, which uses the defined protocols to replicate peer state and behavior across machines.
  4. You send messages (packets) between peers over their bound channels. Messages get converted to packets, transmitted over the network (or other medium), received on the other side, converted back to messages, and delivered to all machines peer(s).

Dependencies

~5.5–8.5MB
~82K SLoC