Documentation Index
Fetch the complete documentation index at: https://iii.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
This page is a hand-authored snapshot of the planned public surface. The final reference will be
generated from the SDK source.
Installation
iii_sdk.
Common methods
register_worker
Connect a worker to a running iii engine and return its handle.
III carries every method below. Spawned async tasks are driven on the SDK’s
internal tokio runtime.
register_function
Register a callable function on this worker. Request and response schemas are derived from the
handler’s input and output types via the schemars::JsonSchema derive; the call site doesn’t
restate them.
RegisterFunction value via RegisterFunction::new("namespace::name", handler) and pass
it to register_function. The handler’s parameter and return types must implement
serde::Deserialize, serde::Serialize, and schemars::JsonSchema.
register_trigger
Bind a registered function to a configured trigger instance.
trigger.unregister() on the returned handle. There is no free-function
unregister_trigger.
register_trigger_type
Declare a new trigger type that this worker advertises.
C and R are the trigger config and result types, each schemars::JsonSchema.
unregister_trigger_type
Remove a previously registered trigger type.
trigger
Invoke a registered function. Always async; await the future to receive the result.
Value is the function’s return JSON for synchronous calls, an EnqueueResult-shaped
JSON for TriggerAction::Enqueue actions, and Null for TriggerAction::Void.
shutdown
Disconnect from the engine and release resources. Returns immediately; in-flight tasks are aborted.
Trigger actions
TriggerAction is a plain enum.
TriggerRequest::action as Some(TriggerAction::Void) or
Some(TriggerAction::Enqueue { queue: "math".to_string() }). None means synchronous.
Error type
IIIError is the public error enum. Most invocation failures arrive on the Remote or Runtime
variants.
ErrorBody carries the engine’s { code, message, stacktrace? } payload; match on
IIIError::Remote(body) => body.code.as_str() to branch on engine error codes
(invocation_failed, invocation_stopped, function_not_found, FORBIDDEN, TIMEOUT, etc.).
Channels
ChannelReader and ChannelWriter wrap the engine’s stream WebSockets. StreamChannelRef
identifies a channel:
ChannelReader::new(engine_ws_base, ref) and ChannelWriter::new(engine_ws_base, ref) open the
underlying WebSocket. Reader methods include read(), on_message(), and close(); writer
methods include write(), send_message(), and close().
Logger
Logger is a Clone + Default struct that emits structured log records. The output integrates
with the SDK’s OpenTelemetry setup; see
iii-observability for the export side.
Connection state
IIIConnectionState is the public enum mirroring the wire-level connection lifecycle.
Info types
The SDK re-exports the engine’s structured introspection types:FunctionInfo.function_id, optionaldescription, optionalrequest_format/response_format, optionalmetadata.TriggerInfo.id,trigger_type,function_id, optionalconfig/metadata.WorkerInfo.id,name, runtime / version / OS fields, IP,status,connected_at_ms,function_count, registeredfunctions,active_invocations, optionalisolation.WorkerMetadata. The structured metadata a worker reports about itself:runtime,version,name,os,pid,telemetry(an optionalWorkerTelemetryMetacarrying language / framework / project labels plus an Amplitude key, used by iii-telemetry for anonymous usage reporting; distinct from the OpenTelemetry observability surfaces owned by iii-observability),isolation. Rust is the only SDK that surfaces this as a distinct type today.
MessageType
Not part of this SDK. Wire frames are typed via the protocol module’s Message enum, which is
internal to the SDK.