Skip to main content

Crate statevec_api

Crate statevec_api 

Source
Expand description

Runtime-facing StateVec host APIs and plugin contracts.

Domain plugins use this crate to implement RuntimePlugin and execute deterministic transactions against a host-provided RuntimeHostContext. Runtime hosts use the same traits and the exported plugin ABI to load domain code across a process or dynamic-library boundary.

Modules§

runtime_error_kind
Well-known runtime error kinds used by ABI helpers.

Structs§

Command
Runtime command value with kind, external sequence, external time, and payload.
CommittedReceipt
Receipt returned when a command has a determined final outcome.
CommittedResultRecord
Fixed committed-result record.
ExportedRuntimePluginV1Handle
Boxed plugin handle owned across the ABI boundary.
QueueReceipt
Receipt returned when a command is accepted by the queue.
QueueRecord
Minimal consumer-side contract for a single globally ordered queue.
RecordKey
Fully qualified record key used by runtime hosts.
RuntimeApiProbe
RuntimeBytesMutRef
Borrowed mutable byte slice passed across the C ABI.
RuntimeBytesRef
Borrowed immutable byte slice passed across the C ABI.
RuntimeCommandRef
Borrowed runtime command envelope.
RuntimeCommandView
ABI view of a command envelope.
RuntimeErrorBuf
Fixed-size ABI error buffer.
RuntimeErrorKind
Stable numeric runtime error kind.
RuntimeHostContextV1
ABI handle for mutable runtime host access.
RuntimeHostContextV1Adapter
RuntimeHostError
Error returned by host context operations.
RuntimeHostVTableV1
Mutable host vtable exposed to runtime plugins.
RuntimePluginApiV1
ABI function table returned by a runtime plugin entrypoint.
RuntimePluginError
Error returned by plugin transaction execution.
RuntimePluginLoadError
Error returned while creating or loading a runtime plugin.
RuntimePluginUnloadError
Error returned when unloading a runtime plugin.
RuntimeReadContextV1
ABI handle for read-only runtime host access.
RuntimeReadContextV1Adapter
RuntimeReadVTableV1
Read-only host vtable exposed to invariant validation.
RuntimeRecordKeyView
ABI view of a record key.
SubmitRequest
Encoded submit request written to ingress queues.

Enums§

CommittedStatus
Determined command outcome.
QueueCodecError
Error returned when queue codec records cannot be encoded or decoded.
RejectedErrorCode
Domain/runtime rejection category encoded in committed result records.
RuntimeCallStatus
Status returned by FFI ABI calls.
RuntimeErrorPhase
Phase in which an ABI error occurred.

Constants§

COMMITTED_RESULT_RECORD_LEN
Total: version(1) + ext_seq(8) + status_tag(1) + status_value(8) = 18.
COMMITTED_RESULT_RECORD_VERSION
Version byte used by committed result queue records.
RUNTIME_PLUGIN_ABI_VERSION_V1
Current stable runtime plugin ABI version.
RUNTIME_PLUGIN_ENTRY_V1_SYMBOL
Null-terminated symbol name exported by StateVec runtime plugins.
STATEVEC_API_COMPAT_VERSION
Numeric runtime plugin ABI compatibility version.
STATEVEC_API_VERSION
Logical API compatibility version.
SUBMIT_REQUEST_RECORD_VERSION
Version byte used by submit request queue records.

Traits§

BizInvariantReadContext
Read-only state access surface for invariant validation.
CommittedResultQuery
Query surface for command outcomes keyed by queue sequence.
InvariantReadContextExt
Typed convenience methods for BizInvariantReadContext.
QueueConsumer
Consumer-side contract for a single globally ordered queue.
QueueConsumerResume
Resume metadata query for queue consumers.
QueueProducer
Minimal producer-side contract for a single globally ordered queue.
RuntimeCommandEnvelope
Borrowed command envelope passed to runtime plugins.
RuntimeHostContext
Object-safe host capability boundary used by runtime plugins.
RuntimeHostContextExt
Typed convenience methods layered on top of the raw RuntimeHostContext capability boundary.
RuntimePlugin
Domain runtime plugin contract.
RuntimePluginFactory
Factory used by a runtime host to create configured plugin instances.
TxContext
Full raw transaction context capability set.
TxPkContext
Primary-key lookup capability for raw transaction contexts.
TxReadContext
Read-only raw transaction capability used by typed convenience APIs.
TxSysIdCreateContext
Raw create capability that accepts a host-assigned system id.
TxWriteContext
Raw write capability for transaction contexts.
TypedTxContext
Typed transaction convenience API over generated StateVec accessors.

Functions§

clear_runtime_error
Resets an optional ABI error buffer.
decode_committed_result_record
Decodes a committed-result record.
decode_submit_request
Decodes a submit request queue record.
encode_committed_result_record
Encodes a committed-result record.
encode_committed_result_record_fixed
Encodes a committed-result record into its fixed-width representation.
encode_submit_request
Encodes a submit request queue record.
runtime_bytes_slice
Converts an ABI byte reference into a Rust slice.
runtime_bytes_slice_mut
Converts an ABI mutable byte reference into a mutable Rust slice.
runtime_error_message
Formats an ABI error buffer for diagnostics.
runtime_error_text
Returns the error text from an ABI error buffer.
runtime_plugin_create_runtime_v1
Creates a runtime plugin instance through the v1 ABI helper.
runtime_plugin_destroy_runtime_v1
Destroys a runtime plugin instance created by runtime_plugin_create_runtime_v1.
runtime_plugin_name_v1
ABI helper returning a plugin factory name.
runtime_plugin_on_unload_v1
Calls the plugin unload hook through the v1 ABI helper.
runtime_plugin_run_tx_v1
Runs one command transaction through the v1 ABI helper.
runtime_plugin_schema_bytes_v1
ABI helper returning cached schema IDL JSON bytes.
runtime_plugin_validate_biz_invariants_v1
Validates plugin business invariants through the v1 ABI helper.
write_runtime_error
Writes an error into an optional ABI error buffer.

Type Aliases§

RuntimeBytesMutVisitor
Visitor callback for uniquely borrowed mutable byte slices.
RuntimeBytesVisitor
Visitor callback for borrowed byte slices.
RuntimePluginEntryV1
Runtime plugin entrypoint function type.
RuntimeRecordKeyVisitor
Visitor callback for record keys.