Skip to main content
The Rust SDK provides an authenticated client, Arrow IPC streaming, exact table-definition checks, resumable commit following, and the native worker contract.

Install from the repository

Add the current workspace crate as a path dependency:
Cargo.toml

Connect

ConnectOptions::from_env reads the standard endpoint and token variables. It defaults the endpoint to http://127.0.0.1:8334.
Supply every destination explicitly inside an injected container environment:

Create or verify a table

ensure_table creates a missing table and rejects an existing table whose definition differs from the requested contract.

Append Arrow batches

The client commits each incoming RecordBatch independently. It derives a unique commit key for each batch from the supplied run key.

Stream query results

The SDK decodes the Arrow IPC response incrementally instead of buffering the full result.

Follow table commits

The stream reconnects after a socket drop and resumes from the last observed sequence. An expired replay cursor returns a distinct ClientError::CursorExpired error.

Implement the worker contract

Implement Worker<C> for native in-process workers. The runtime passes a WorkerContext<C> with the trigger, outputs, environment, logger, abort flag, and memory-grant host. The Rust trigger and result shapes match the TypeScript wire contract. Use CronInterval for logical time, ChangeEvent for data-change dispatches, and WorkerResult for the optional rows-written summary.