Expand description
§aimdb-ws-protocol
Shared wire protocol types for the AimDB WebSocket connector ecosystem.
Used by:
aimdb-websocket-connector— the server side (Axum/Tokio)aimdb-wasm-adapter— the browser client (WsBridge)
§Wire Protocol
All messages are JSON-encoded with a "type" discriminant tag:
§Server → Client (ServerMessage)
data— live record push with timestampsnapshot— late-join current valuesubscribed— subscription acknowledgementerror— per-operation errorpong— response to client pingquery_result— response to a client query request
§Client → Server (ClientMessage)
subscribe— subscribe to one or more topics (supports MQTT wildcards)unsubscribe— cancel subscriptionswrite— inbound value for alink_from("ws://…")recordping— keepalive pingquery— query historical / persisted records
§Topic Matching
topic_matches implements MQTT-style wildcard matching (# for
multi-level, * for single-level).
Structs§
- Query
Record - A single record returned in a
ServerMessage::QueryResult. - Topic
Info - Metadata for a single outbound topic served by a WebSocket endpoint.
Enums§
- Client
Message - A message received from a WebSocket client.
- Error
Code - Machine-readable error codes sent in
ServerMessage::Error. - Server
Message - A message sent from the server to a connected WebSocket client.
Functions§
- now_ms
- Returns the current milliseconds since the Unix epoch (for
tsfields). - topic_
matches - Returns
trueiftopicmatchespattern.