Skip to main content

Installation

API reference for the iii-helpers crate (Rust).

http

HTTP request/response types, auth config, and the http helper. Import

Types

HttpAuthConfig · HttpInvocationConfig · HttpMethod · HttpRequest · HttpResponse

HttpAuthConfig

Authentication configuration for HTTP-invoked functions.
  • Hmac — HMAC signature verification using a shared secret.
  • Bearer — Bearer token authentication.
  • ApiKey — API key sent via a custom header.

HttpInvocationConfig

Configuration for registering an HTTP-invoked function (Lambda, Cloudflare Workers, etc.) instead of a local handler.

HttpMethod

HTTP method accepted by HttpInvocationConfig. Distinct from the core builtin_triggers HTTP method enum, which also covers HEAD/OPTIONS.

HttpRequest

Buffered HTTP request received by a function handler.

HttpResponse

Buffered HTTP response returned from a function handler.

observability

Logger, OpenTelemetry config, and span helpers. Import

Types

BaggageSpanProcessor · CapturedContext · ConnectionState · EngineLogExporter · EngineMetricsExporter · EngineSpanExporter · Logger · OtelConfig · OtelMessage · ReconnectionConfig · SharedEngineConnection · WorkerGaugesHandle · WorkerGaugesOptions · WorkerMetrics · WorkerMetricsCollector

BaggageSpanProcessor

CapturedContext

Snapshot of the current OTel context for use across tokio::spawn. tokio::spawn does NOT carry OTel context into the spawned task; without this, child spans become orphan roots. Capture before spawn, then call .attach(future) inside the spawned block.

ConnectionState

Connection state for the shared WebSocket

EngineLogExporter

Custom log exporter that sends OTLP JSON over a shared WebSocket connection. Uses a hand-built JSON serializer to match the III Engine’s expected format.

EngineMetricsExporter

Custom metrics exporter that sends OTLP JSON over a shared WebSocket connection. Uses a hand-built JSON serializer to match the III Engine’s expected format.

EngineSpanExporter

Custom span exporter that sends OTLP JSON over a shared WebSocket connection. Uses a hand-built JSON serializer (not opentelemetry-proto serde) to match the format the III Engine expects: camelCase field names, integer attribute values as JSON numbers, and hex-encoded trace/span IDs.

Logger

Structured logger that emits logs as OpenTelemetry LogRecords. Every log call automatically captures the active trace and span context, correlating your logs with distributed traces without any manual wiring. When OTel is not initialized, Logger gracefully falls back to the tracing crate. Pass structured data as the second argument to any log method. Using a serde_json::Value object of key-value pairs (instead of string interpolation) lets you filter, aggregate, and build dashboards in your observability backend.

OtelConfig

Configuration for OpenTelemetry initialization

OtelMessage

Message to send over the shared WebSocket connection

ReconnectionConfig

Configuration for WebSocket reconnection behavior

SharedEngineConnection

Shared WebSocket connection for all OTEL exporters

WorkerGaugesHandle

Handle that keeps the OTEL gauges alive. Drop to stop reporting.

WorkerGaugesOptions

Options for registering worker gauges

WorkerMetrics

Collected worker metrics snapshot

WorkerMetricsCollector

Collects system metrics for the current process

queue

Queue enqueue result types. Import

Types

EnqueueResult

EnqueueResult

Result returned by the engine when a message is successfully enqueued.

stream

Stream trigger configs, change events, IO inputs, and update operations. Import

Types

MergePath · StreamAuthInput · StreamAuthResult · StreamChangeEvent · StreamChangeEventDetail · StreamDeleteInput · StreamDeleteResult · StreamEventType · StreamGetInput · StreamJoinLeaveEvent · StreamJoinLeaveTriggerConfig · StreamJoinResult · StreamListGroupsInput · StreamListInput · StreamSetInput · StreamSetResult · StreamTriggerConfig · StreamUpdateInput · StreamUpdateResult · UpdateOp · UpdateOpError

MergePath

Path target for a UpdateOp::Merge operation. Accepts either a single string (legacy / first-level field) or an array of literal segments (nested path). Path normalization rules applied by the engine:
  • absent / Single("") / Segments(vec![]) → root merge
  • Single("foo") is equivalent to Segments(vec!["foo".into()])
  • Segments(["a", "b", "c"]) walks three literal keys, never interpreting dots specially. Segments(vec!["a.b".into()]) is a single literal key named "a.b".
Variant ordering is load-bearing. #[serde(untagged)] tries variants in declaration order, Single MUST come before Segments so a JSON string deserializes into Single rather than failing the array match first.

StreamAuthInput

Input for stream authentication.

StreamAuthResult

Result of stream authentication.

StreamChangeEvent

Handler input for stream triggers, fired when an item changes via stream::set, stream::update, or stream::delete.

StreamChangeEventDetail

Detail of a stream change event containing the mutation type and data.

StreamDeleteInput

Input for deleting a stream item.

StreamDeleteResult

StreamEventType

The kind of mutation that occurred on a stream item.

StreamGetInput

Input for retrieving a single stream item.

StreamJoinLeaveEvent

Event payload for stream join/leave triggers.

StreamJoinLeaveTriggerConfig

Trigger config for stream:join and stream:leave triggers.

StreamJoinResult

Result of a stream join request.

StreamListGroupsInput

Input for listing all groups in a stream.

StreamListInput

Input for listing all items in a stream group.

StreamSetInput

Input for setting a stream item.

StreamSetResult

StreamTriggerConfig

Trigger config for stream triggers. Filters which item changes fire the handler.

StreamUpdateInput

Input for atomically updating a stream item.

StreamUpdateResult

Result of an atomic update operation

UpdateOp

Operations that can be performed atomically on a stream value

UpdateOpError

Per-op error reported by an atomic update operation.

worker_connection_manager

RBAC auth and registration callback types. Import

Types

AuthInput · AuthResult · OnFunctionRegistrationInput · OnFunctionRegistrationResult · OnTriggerRegistrationInput · OnTriggerRegistrationResult · OnTriggerTypeRegistrationInput · OnTriggerTypeRegistrationResult

AuthInput

Input passed to the RBAC auth function during WebSocket upgrade. Contains the HTTP headers, query parameters, and client IP from the connecting worker’s upgrade request.

AuthResult

Return value from the RBAC auth function. Controls which functions the authenticated worker can invoke and what context is forwarded to the middleware.

OnFunctionRegistrationInput

Input passed to the on_function_registration_function_id hook when a worker attempts to register a function through the RBAC port. Return an OnFunctionRegistrationResult with the (possibly mapped) fields, or return an error to deny the registration.

OnFunctionRegistrationResult

Result returned from the on_function_registration_function_id hook. Omitted fields keep the original value from the registration request.

OnTriggerRegistrationInput

Input passed to the on_trigger_registration_function_id hook when a worker attempts to register a trigger through the RBAC port. Return an OnTriggerRegistrationResult with the (possibly mapped) fields, or return an error to deny the registration.

OnTriggerRegistrationResult

Result returned from the on_trigger_registration_function_id hook. Omitted fields keep the original value from the registration request.

OnTriggerTypeRegistrationInput

Input passed to the on_trigger_type_registration_function_id hook when a worker attempts to register a new trigger type through the RBAC port. Return an OnTriggerTypeRegistrationResult with the (possibly mapped) fields, or return an error to deny the registration.

OnTriggerTypeRegistrationResult

Result returned from the on_trigger_type_registration_function_id hook. Omitted fields keep the original value from the registration request.