Skip to main content

Crate golem_rust

Crate golem_rust 

Source

Re-exports§

pub use websocket::WebSocketCloseInfo;
pub use websocket::WebSocketError;
pub use websocket::WebSocketMessage;
pub use websocket::WebsocketConnection;
pub use wasip3;
pub use golem_schema;
pub use quota::*;
pub use secrets::*;

Modules§

bindings
durability
durable_streams
External Durable Streams clients. The host owns HTTP, framing and authentication; these clients retain only replay-reconstructed checkpoints, buffers and producer state. Each client owns one golem:agent/durable-streams@2.0.0 resource. Construction journals its immutable descriptor without HTTP; dropping the client releases it.
http
Outgoing HTTP over WASI HTTP p3, using standard Rust HTTP request builders.
permissions
Typed permission-card management over the golem:permissions WIT interfaces.
quota
Ergonomic wrappers for the golem:quota/types WIT interface.
retry
Semantic retry policies for host-managed operations and local user code.
schema
Recursive in-memory mirror of the golem:core@2.0.0 schema model.
secrets
tool
websocket
wit_stream
Component Model stream constructor generated by wit_bindgen for the primary bindings world. Used by callers that need to hand a writable stream<u8> to host imports such as wasi:blobstore outgoing values.

Structs§

AgentAllFilter
AgentAnyFilter
AgentConfigVarsFilter
AgentCreatedAtFilter
AgentEnvFilter
AgentId
Native counterpart of golem:core/types@2.0.0::agent-id.
AgentMetadata
AgentNameFilter
AgentStatusFilter
AgentVersionFilter
ComponentId
Native counterpart of golem:core/types@2.0.0::component-id.
EnvironmentId
Native counterpart of golem:core/types@2.0.0::environment-id.
FallibleTransaction
FallibleTransaction is a sequence of operations that are executed in a way that if any of the operations fails all the already performed operation’s compensation actions got executed in reverse order.
ForkDetails
GetAgents
PromiseId
Native counterpart of golem:core/types@2.0.0::promise-id.
PromiseResult
Quantity
A fixed-point decimal value with a unit, constrained by the QuantityUnit marker U. Encodes to the rich SchemaValue::Quantity.
SchemaFingerprintV1
BLAKE3-256 digest of the v1 deterministic-CBOR encoding of a stream element schema closure.
SchemaGraph
A self-contained schema graph in the recursive in-memory form.
TypedSchemaValue
A typed value: a self-contained SchemaGraph paired with a value tree built against that schema.
Uuid
A Universally Unique Identifier (UUID).

Enums§

AgentOperationError
Error returned by an operation targeting another agent.
AgentPropertyFilter
AgentStatus
FilterComparator
ForkResult
SchemaFingerprintError
SchemaType
One schema type in the recursive in-memory representation.
SchemaValue
One node in the recursive in-memory schema-value tree.
StringFilterComparator
TransactionFailure
The result of a transaction execution that failed.
UpdateMode

Traits§

CompensationFunction
FromSchema
Decode a SchemaValue back into a Rust value.
FromWire
Decode a concrete value, consuming every visited wire node exactly once.
IntoSchema
Convert a Rust type into a self-contained schema graph and a SchemaValue tree.
IntoTypedSchemaValue
Ergonomic value.into_typed_schema_value()? form of try_into_typed_schema_value, mirroring the legacy IntoValueAndType::into_value_and_type method shape.
IntoWire
Encode a concrete value without constructing an owned schema value.
Operation
Represents a compensable operation of the transaction.
QuantityUnit
Marker trait describing the unit constraints of a Quantity.
Transaction
A unified interface for the different types of transactions. Using it can make the code easier to switch between different transactional guarantees but is more constrained in terms of error types.
TupleOrUnit
WireSchema
Appends the concrete type’s schema directly to a shared wire arena.

Functions§

await_promise
Awaits a promise.
await_promise_json
Awaits a promise.
blocking_await_promise
Awaits a promise blocking the execution of the agent. The agent is going to be suspended until the promise is completed.
blocking_await_promise_json
Awaits a promise blocking the execution of the agent. The agent is going to be suspended until the promise is completed.
boxed
Wraps an async block into a LocalBoxFuture. Use this when passing closures to fallible_transaction or infallible_transaction:
call_compensation_function
complete_promise
complete_promise_json
Completes a promise with a JSON payload
create_promise
decode_schema_graph
decode_schema_value
decode_typed_schema_value
decode_typed_schema_value_owned
encode_schema_graph
encode_schema_value
encode_schema_value_async
encode_typed_schema_value
encode_typed_schema_value_async
encode_typed_schema_value_owned
fallible_transaction
Fallible transaction execution. If any operation fails, all the already executed successful operation’s compensation actions are executed in reverse order and the transaction returns with a failure.
fork
generate_idempotency_key
Generates an idempotency key. This operation will never be replayed — i.e. not only is this key generated, but it is persisted and committed, such that the key can be used in third-party systems (e.g. payment processing) to introduce idempotence.
get_agent_metadata
get_promise
get_self_metadata
Read full self metadata. Requires view permission on the running agent, admitted by the effective permission card and permitted by initialCard. Stored environment and configuration fields are not filtered by the per-key permissions used for WASI reads. Pure initialization does not call this API. Permission denials and backend failures remain typed AgentOperationErrors.
infallible_transaction
Runs new attempts until the body succeeds. Return operation errors with ?. Each failed attempt compensates successful operations in reverse order before starting a new attempt. Attempts append durable history; they never rewind it. The host resolves the saga policy after each completely compensated failure. Exhaustion, policy errors and partial compensation return typed failures. Rust WASM panics abort as programming errors without compensation.
operation
Constructs an Operation from two async closures: one for executing the operation, and one for rolling it back. The rollback operation always sees the input and the output of the operation.
oplog_commit
resolve_agent_id
resolve_agent_id_strict
resolve_component_id
schema_fingerprint_v1
Computes the v1 stream element schema fingerprint.
sync_operation
Constructs an Operation from two synchronous closures: one for executing the operation, and one for rolling it back. This is a convenience wrapper around operation for cases where the execute and compensate logic is synchronous.
transaction
Runs a transaction through the Transaction interface.
update_agent

Type Aliases§

LocalBoxFuture
A boxed local future. Used as the return type for transaction closures to allow the returned future to borrow from the transaction reference.
OplogIndex
ScheduledTime
Public alias for the instant/datetime type used by Golem’s scheduling APIs.
TransactionResult
The result of a transaction execution.

Attribute Macros§

agent_client
agent_definition
agent_implementation
arg
command
constraint
description
endpoint
golem_operation
Defines a function as an Operation that can be used in transactions
http_router
Registers an implementation of the SDK’s HttpRouter trait.
prompt
read_only
result
tool_definition
tool_implementation
tool_middleware
universal_tool_middleware

Derive Macros§

AllowedLanguages
AllowedMimeTypes
ConfigSchema
FromSchema
FromWire
Decodes canonical wire nodes directly into a concrete guest type.
IntoSchema
IntoWire
Converts a guest value directly to canonical wire nodes, including affine resource preflight. Does not construct or validate a schema model.
MultimodalSchema
Schema
Derives IntoSchema, FromSchema, IntoWire, FromWire, and WireSchema. Requires the schema crate’s guest feature for the direct wire traits.
ToolError
WireSchema
Appends a concrete type definition directly to the flat WIT schema arena.