Expand description
Platform-agnostic HTTP router for pylon.
This crate contains the pure routing logic that maps HTTP requests to
data store operations. It has no I/O dependencies — no tiny_http,
no tungstenite, no rusqlite. It works with any DataStore
implementation (SQLite Runtime, Cloudflare D1, etc.).
Structs§
- Noop
Notifier - No-op notifier for platforms without real-time push.
- Noop
Plugin Hooks - No-op plugin hooks for platforms or tests without a registry.
- Router
Context
Enums§
- Frame
Encode Error - Errors from
encode_crdt_frame. Surfaced loud rather than silently truncating so a pathological entity / row_id name (>64 KiB) becomes an observable failure instead of a malformed frame the client can’t decode.
Constants§
- CRDT_
FRAME_ SNAPSHOT - Frame type for a full CRDT snapshot.
- CRDT_
FRAME_ UPDATE - Frame type for an incremental CRDT update (reserved — not yet emitted).
Traits§
- Cache
Ops - Cache operations used by the router.
- Change
Notifier - Receives change notifications for real-time sync.
- Email
Sender - Sends emails (magic codes, invitations, etc.).
- FileOps
- File storage operations used by the router.
- FnOps
- TypeScript function operations used by the router.
- JobOps
- Job queue operations used by the router.
- Open
ApiGenerator - Generates the OpenAPI spec JSON string for the manifest.
- Plugin
Hook Ops - Plugin CRUD lifecycle hooks used by the router.
- PubSub
Ops - Pub/Sub operations used by the router.
- RoomOps
- Room operations used by the router.
- Scheduler
Ops - Scheduler operations used by the router.
- Shard
Ops - Access to sharded real-time simulations (game matches, MMO zones, etc.).
- Workflow
Ops - Workflow engine operations used by the router.
Functions§
- broadcast_
change_ with_ crdt - Convenience: emit BOTH the JSON change event AND the binary CRDT
snapshot frame after a successful insert/update on a CRDT-mode
entity. The CRDT snapshot is fetched via
DataStore::crdt_snapshot; forcrdt: falseentities (the LWW opt-out) it returnsOk(None)and we skip the binary broadcast cleanly. - encode_
crdt_ frame - Encode a CRDT broadcast frame. Layout documented at the top of this module. Returns the encoded bytes on success; errors when entity / row_id can’t fit the 16-bit length header (~65 KiB, never hit in practice).
- json_
error - json_
error_ safe - json_
error_ with_ hint - route
- Route an HTTP request to the appropriate handler.