Skip to main content

Crate dstate

Crate dstate 

Source
Expand description

§dstate

Framework-agnostic distributed state replication for Rust actor systems.

dstate provides traits and replication logic for managing state that is replicated across nodes in a cluster. State changes are projected into public views, synchronized via configurable strategies, and persisted through a pluggable storage interface.

§Core Traits

§Adapter Crates

Use dstate with a concrete actor framework via an adapter:

Re-exports§

pub use engine::DistributedStateEngine;
pub use engine::EngineAction;
pub use engine::EngineHealth;
pub use engine::EngineQueryResult;
pub use engine::HealthStatus;
pub use engine::MutateResult;
pub use engine::DeltaMutateResult;
pub use engine::SyncMetrics;
pub use engine::WireMessage;

Modules§

engine
Public API for driving the dstate replication protocol.
test_support

Structs§

ActorSendError
Error returned by ActorRef::send().
BatchedChangeFeed
A batched collection of change notifications broadcast by the aggregator. No target node is specified because this message is broadcast to all nodes in the cluster.
ChangeFeedConfig
Configuration for the change feed aggregator.
ChangeNotification
A notification that a state has changed on a node (used by the change feed).
ClusterError
Error returned by ClusterEvents operations.
Generation
Logical version of a state, used for ordering and staleness detection.
GroupError
Error returned by processing group operations.
NodeId
Unique identifier for a node in the cluster.
StateConfig
Per-state-type configuration.
StateObject
The local node’s authoritative copy of a distributed state.
StateRegistry
Registry of all distributed state types on this node.
StateViewObject
A peer node’s replicated view of a distributed state.
SubscriptionId
Opaque handle returned by ClusterEvents::subscribe, used to cancel a subscription via ClusterEvents::unsubscribe.
SyncStrategy
Synchronization strategy composed from independent options.
SystemClock
Production clock delegating to std::time.

Enums§

ClusterEvent
Events emitted by the cluster membership system.
DeserializeError
Errors from deserializing state/view/delta data.
MutationError
Errors from mutation operations.
PersistError
Errors from persistence operations.
PushMode
Push mode for synchronization.
QueryError
Errors from query operations.
RegistryError
Errors from state registration.
SyncMessage
Wire-level synchronization messages exchanged between nodes.
SyncUrgency
Urgency hint returned by DeltaDistributedState::sync_urgency().
VersionMismatchPolicy
Policy for handling wire version mismatches on inbound sync messages.

Traits§

ActorRef
A handle to a running actor that can receive messages of type M.
ActorRuntime
The top-level actor runtime abstraction. One instance per node.
AnyStateShard
Type-erased interface for a registered state shard.
Clock
Abstraction over time sources, enabling deterministic testing.
ClusterEvents
Subscription to cluster membership events.
DeltaDistributedState
A distributed state type with separate State/View/Delta projections.
DistributedState
A distributed state type whose full state is the public view (no projection).
StatePersistence
Async trait for persisting state to durable storage.
TimerHandle
A handle to a scheduled timer that can be cancelled.