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.
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
AtomicOperationGuard
CardId
Native counterpart of golem:core/types@2.0.0::card-id.
Checkpoint
A checkpoint that captures the current oplog index and can revert execution back to it.
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
IdempotenceModeGuard
InfallibleTransaction
InfallibleTransaction is a sequence of operations that are executed in a way that if any of the operations or the underlying Golem executor fails, the whole transaction is going to be retried.
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§

CheckpointOptionExt
Extension trait for Option that provides checkpoint-based revert on None.
CheckpointResultExt
Extension trait for Result that provides checkpoint-based revert on error.
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 an atomic operation of the transaction which has a rollback action.
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§

atomically
Executes the given function as an atomic operation.
atomically_async
Executes the given async function as an atomic operation.
atomically_result
Executes the given fallible function as an atomic operation.
atomically_result_async
Async version of atomically_result.
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_oplog_index
get_promise
get_self_metadata
infallible_transaction
Retry the transaction in case of failure. If any operation returns with a failure, all the already executed successful operation’s compensation actions are executed in reverse order and the transaction gets retried, using Golem’s active retry policy.
infallible_transaction_with_strong_rollback_guarantees
Same as infallible_transaction, but with strong rollback guarantees. The compensation actions are guaranteed to be always executed before the transaction gets retried, even if it fails due to a panic or an external executor failure.
mark_atomic_operation
Marks a block as an atomic operation
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.
set_oplog_index
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
A generic interface for defining transactions, where the transaction mode is determined by the function’s parameter (it can be FallibleTransaction or InfallibleTransaction).
update_agent
use_idempotence_mode
Temporarily sets the idempotence mode to the given value.
with_checkpoint
Creates a checkpoint, runs the given function, and reverts on error.
with_checkpoint_async
Creates a checkpoint, runs the given async function, and reverts on error.
with_idempotence_mode
Executes the given function with the idempotence mode set to the given value.
with_idempotence_mode_async
Executes the given async function with the idempotence mode set to the given value.

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
ToolError
WireSchema
Appends a concrete type definition directly to the flat WIT schema arena.