Skip to main content

Module protocol

Module protocol 

Source
Expand description

Bidirectional NDJSON protocol between Rust runtime and TypeScript process.

Messages are newline-delimited JSON objects. Each function invocation gets a unique call_id for multiplexing concurrent calls over a single connection.

Structs§

AuthInfo
Auth context passed to function handlers.
CallMessage
Invoke a function on the TypeScript side.
CancelScheduleMessage
Cancel a scheduled function.
DbOpMessage
A database operation request from TypeScript.
DbResultMessage
Result of a DB operation, sent back to TypeScript.
ErrorInfo
Error info in protocol messages.
ErrorMessage
Function failed.
ReadyMessage
Handshake payload from the TS runtime.
RequestInfo
HTTP request metadata forwarded to TypeScript actions invoked via defineRoute bindings. All fields are strings so the TS side can use them directly without re-parsing.
ReturnMessage
Function returned successfully.
RunFnMessage
Call another function from within an action.
ScheduleMessage
Schedule a function for future execution.
StreamChunkMessage
A stream chunk to forward to the HTTP client as SSE.

Enums§

DbOp
Database operations available to TypeScript functions.
FnType
Function type.
TsMessage
A message from the TypeScript handler back to Rust.