protocol library

Classes

AuthError
AuthTokenStore
Platform-agnostic interface for storing authentication tokens.
BsatnRowList
Row list with optional size hint for efficient decoding
CallProcedureMessage
v2 CallProcedure. Wire: v2.rs:150-166. { request_id: u32, flags: CallProcedureFlags(u8), procedure: Box<str>, args: Bytes }.
CallReducerMessage
v2 CallReducer. Wire: v2.rs:115-131. { request_id: u32, flags: CallReducerFlags(u8), reducer: Box<str>, args: Bytes }.
ClientMessage
Committed
Connected
Connecting
ConnectionConfig
ConnectionQuality
ConnectionState
Disconnected
Dropped
Event
Base sealed class for all transaction events.
EventContext
Context information for a table change event
EventTableRows
Failed
FatalError
Identity
SpacetimeDB user identity
InitialConnectionMessage
v2 InitialConnection — handshake payload. Wire: v2.rs:198-204{ identity, connection_id, token }.
InMemoryOfflineStorage
InMemoryTokenStore
Default in-memory token storage.
Int64
An immutable 64-bit signed integer, in the range -2^63, 2^63 - 1. Arithmetic operations may overflow in order to maintain this range.
InternalError
JsonFileStorage
MessageDecoder
MutationSyncResult
OfflineQueuePolicy
Controls how the offline mutation queue accepts and replays mutations.
OfflineStorage
OidcHelper
Helper for OAuth/OIDC authentication flows with SpacetimeDB.
OneOffQueryMessage
v2 OneOffQuery. Wire: v2.rs:101-109. { request_id: u32, query_string: Box<str> }.
OneOffQueryResult
v2 OneOffQueryResult. Wire: v2.rs:358-367{ request_id: u32, result: Result<QueryRows, Box<str>> }. Result<T,E> sum: tag 0 = Ok, tag 1 = Err (verified sats/ser/impls.rs:120-123).
OptimisticChange
Represents a change to be applied optimistically to the local cache.
OptimisticEvent
Pending
PersistentTableRows
ProcedureResultMessage
v2 ProcedureResult — procedure invocation outcome.
ProcedureStatus
v2 ProcedureStatus two-variant sum. Wire: tag 0 Returned(Bytes) — u32 length + bytes; tag 1 InternalError(Box<str>). Front-loaded to slice 2 (was a v1-shape collision with unit OutOfEnergy at tag 1).
QueryRows
Flat rows-per-table container used by SubscribeApplied / UnsubscribeApplied / OneOffQueryResult. Wire: v2.rs:223-237.
QuerySetUpdate
A set of TableUpdates scoped to a client-assigned QuerySetId. Wire: v2.rs:308-314.
Reconnecting
ReducerEvent
ReducerResultMessage
v2 ReducerResult — caller's CallReducer outcome. Wire: v2.rs:371-381{ request_id: u32, timestamp: Timestamp(i64 µs), result: ReducerOutcome }. Timestamp on v2 wire is microseconds (canonical sats/src/timestamp.rs:11-14, stale v2.rs:378 doc comment notwithstanding).
RowSizeHint
SdkLogger
ServerMessage
SingleTableRows
SpacetimeDbConnection
SubscribeApplied
v2 SubscribeApplied — initial-data delivery for a query set. Wire: v2.rs:206-221{ request_id: u32, query_set_id: u32, rows: QueryRows }.
SubscribeAppliedEvent
SubscribeMessage
v2 Subscribe. Wire: v2.rs:53-67. { request_id: u32, query_set_id: u32, query_strings: Box<[Box<str>]> }.
SubscriptionErrorMessage
v2 SubscriptionError. Wire: v2.rs:271-291{ request_id: Option<u32>, query_set_id: QuerySetId, error: Box<str> }.
SyncState
TableCache<T>
TableDeleteEvent<T>
Event emitted when a row is deleted from a table
TableEvent<T>
Base sealed class for all table change events
TableEventSpec
TableInsertEvent<T>
Event emitted when a row is inserted into a table
TableUpdate
Table update — v2 wire shape per v2.rs:316-321. { table_name: RawIdentifier, rows: Box<[TableUpdateRows]> }
TableUpdateEvent<T>
Event emitted when a row is updated in a table
TableUpdateRows
Rows of a TableUpdate, separated by table kind (persistent vs event). Wire: v2.rs TableUpdateRows sum — tag 0 PersistentTable, tag 1 EventTable.
TransactionBatch<T>
TransactionResult
Result of a reducer call.
TransactionUpdateMessage
v2 TransactionUpdate — non-caller broadcast. Wire: v2.rs:302-306{ query_sets: Box<[QuerySetUpdate]> }.
UnknownTransactionEvent
UnsubscribeApplied
v2 UnsubscribeApplied. Wire: v2.rs:245-254{ request_id: u32, query_set_id: u32, rows: Option<QueryRows> }. rows populated only when the matching Unsubscribe set SendDroppedRows.
UnsubscribeMessage
v2 Unsubscribe. Wire: v2.rs:74-93. { request_id: u32, query_set_id: u32, flags: UnsubscribeFlags(u8) }.
UpdateStatus
Status of a reducer transaction.

Enums

ClientMessageType
v2 ClientMessage tag order (v2.rs:18-29).
CompressionTag
NegotiatedWsProtocol
OptimisticChangeType
OutboundBatchingPolicy
OverflowStrategy
ProcedureStatusType
ReplayDecision
SdkLogLevel
ServerMessageType
Server message type tags (Server -> Client). Based on v2 websocket.rs ServerMessage enum order (v2.rs:175-196).
SyncStatus
TableEventKind
UnsubscribeFlags
Flags on Unsubscribe. Wire: v2.rs:86-93.

Constants

kV2WsProtocol → const String
kV3WsProtocol → const String

Functions

nextOptimisticIntId() int
Generate a client-side temporary integer primary key for optimistic inserts. Returns a negative microsecond-timestamp so it cannot collide with server-assigned positive IDs.

Typedefs

SdkLogCallback = void Function(String level, String message)