Worked examples
The wireframe repository ships ten runnable examples at v0.4.0-alpha1. mxd, a complete Hotline server, is the full-size one.
wireframe 0.4.0-alpha1 · samples verified 2026-12-02

Run them from a checkout of the release tag. Its lockfile pins dependencies that build, and its toolchain file names the nightly Rust it was tested with, which rustup installs on first use. Each example needs the examples feature.
git clone https://github.com/leynos/wireframe.git
cd wireframe
git checkout v0.4.0-alpha1-
Routing
echo.rs
The smallest server: one route, and the default reply echoes each envelope back. It listens on 127.0.0.1:7878 and stops on Ctrl+C.
Run echo cargo run --example echo --features examples -
Client
client_echo_login.rs
Sends a typed login request inside an Envelope to the echo server and decodes the acknowledgement. Start echo first.
Run client_echo_login cargo run --example client_echo_login --features examples -
Middleware
ping_pong.rs
Typed Ping and Pong messages, with a Transform that maps one to the other and a logging layer. The pattern this site’s samples follow. Read the walkthrough.
Run ping_pong cargo run --example ping_pong --features examples -
Routing
packet_enum.rs
An enum of packet variants, with handlers dispatched on the variant received and containers such as HashMap in the payload.
Run packet_enum cargo run --example packet_enum --features examples -
Routing
metadata_routing.rs
Routing from a small frame header that carries the message ID and flags.
Run metadata_routing cargo run --example metadata_routing --features examples -
Codec
hotline_codec.rs
Hotline framing: a 20-byte header with big-endian lengths and a transaction ID. The protocol mxd speaks.
Run hotline_codec cargo run --example hotline_codec --features examples -
Codec
mysql_codec.rs
MySQL framing: a 3-byte little-endian payload length and a 1-byte sequence number.
Run mysql_codec cargo run --example mysql_codec --features examples -
Codec
resp_codec.rs
A minimal parser and encoder for a subset of the Redis serialization protocol: simple strings, integers, bulk strings, and arrays. Payloads travel in bulk strings.
Run resp_codec cargo run --example resp_codec --features examples -
Streaming
async_stream.rs
Builds a Response::Stream of five frames with the async-stream crate: the shape a route_response handler returns. The example consumes it by hand. Read the walkthrough.
Run async_stream cargo run --example async_stream --features examples -
Streaming
multi_packet.rs
Splits a transcript across frames sent through a bounded channel by two producer tasks, with back-pressure keeping them in step with the consumer. Read the walkthrough.
Run multi_packet cargo run --example multi_packet --features examples
mxd: a whole server
mxd, the Marrakesh Express Daemon, is df12’s Hotline server in Rust, and it runs on wireframe 0.3.0. Its mxd-wireframe-server binary frames, routes, and answers Hotline transactions through wireframe, behind a transport adapter: the domain crate does not import wireframe, so transport types never reach the domain.
