Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ reduce this boilerplate through layered abstractions:

- **Transport adapter** built on Tokio I/O
- **Framing layer** for length‑prefixed or custom frames
- **Connection preamble** with customizable validation callbacks [[docs](docs/preamble-validator.md)]
- **Connection preamble** with customizable validation callbacks \[[docs](docs/preamble-validator.md)\]
Comment thread
leynos marked this conversation as resolved.
- Call `with_preamble::<T>()` before registering success or failure callbacks
- **Serialization engine** using `bincode` or a `wire-rs` wrapper
- **Routing engine** that dispatches messages by ID
- **Handler invocation** with extractor support
- **Middleware chain** for request/response processing
- **[Connection lifecycle hooks](#connection-lifecycle)** for per-connection
setup and teardown

These layers correspond to the architecture outlined in the design
document【F:docs/rust-binary-router-library-design.md†L292-L344】.
Expand Down Expand Up @@ -83,9 +85,24 @@ binary protocol server【F:docs/rust-binary-router-library-design.md†L1120-L11
Handlers can return types implementing the `Responder` trait. These values are
encoded using the application's configured serializer and written
back through the `FrameProcessor`【F:docs/rust-binary-router-library-design.md†L718-L724】.

The included `LengthPrefixedProcessor` illustrates a simple framing strategy
based on a big‑endian length prefix【F:docs/rust-binary-router-library-design.md†L1076-L1117】.

## Connection Lifecycle

`WireframeApp` can run callbacks when a connection is opened or closed. The state
produced by `on_connection_setup` is passed to `on_connection_teardown` when the
connection ends.

```rust
let app = WireframeApp::new()
.on_connection_setup(|| async { 42u32 })
.on_connection_teardown(|state| async move {
println!("closing with {state}");
});
```

## Current Limitations

Connection processing is not implemented yet. After the optional
Expand Down