pub struct RocksStorage { /* private fields */ }Implementations§
Source§impl RocksStorage
impl RocksStorage
pub fn new(config: StorageConfig) -> Result<Self>
Sourcepub fn restore_from_snapshot(&self, snapshot: &Snapshot) -> Result<()>
pub fn restore_from_snapshot(&self, snapshot: &Snapshot) -> Result<()>
Restore state from snapshot
Trait Implementations§
Source§impl Storage for RocksStorage
impl Storage for RocksStorage
Source§fn health_check(&self) -> Result<()>
fn health_check(&self) -> Result<()>
Health check
Source§fn write_state(&self, record: StateRecord) -> Result<()>
fn write_state(&self, record: StateRecord) -> Result<()>
Write a state record
Source§fn read_state(&self, record_id: &RecordId) -> Result<Option<StateRecord>>
fn read_state(&self, record_id: &RecordId) -> Result<Option<StateRecord>>
Read a state record
Source§fn read_state_at_version(
&self,
record_id: &RecordId,
version: Version,
) -> Result<Option<StateRecord>>
fn read_state_at_version( &self, record_id: &RecordId, version: Version, ) -> Result<Option<StateRecord>>
Read state at specific version
Source§fn list_keys(&self, namespace: &str, agent_id: &str) -> Result<Vec<String>>
fn list_keys(&self, namespace: &str, agent_id: &str) -> Result<Vec<String>>
List all keys for an agent
Source§fn scan_prefix(
&self,
namespace: &str,
agent_id: &str,
prefix: &str,
) -> Result<Vec<StateRecord>>
fn scan_prefix( &self, namespace: &str, agent_id: &str, prefix: &str, ) -> Result<Vec<StateRecord>>
Scan keys with prefix
Source§fn append_event(&self, event: EventLogEntry) -> Result<()>
fn append_event(&self, event: EventLogEntry) -> Result<()>
Append event to log
Source§fn replay_events(
&self,
namespace: &str,
agent_id: &str,
start_ts: Option<CommitTs>,
end_ts: Option<CommitTs>,
) -> Result<Vec<EventLogEntry>>
fn replay_events( &self, namespace: &str, agent_id: &str, start_ts: Option<CommitTs>, end_ts: Option<CommitTs>, ) -> Result<Vec<EventLogEntry>>
Replay events for an agent
Source§fn next_commit_ts(&self) -> Result<CommitTs>
fn next_commit_ts(&self) -> Result<CommitTs>
Get next commit timestamp
Source§fn create_snapshot(&self) -> Result<Snapshot>
fn create_snapshot(&self) -> Result<Snapshot>
Create a snapshot of current state
Source§fn get_all_state(&self) -> Result<Vec<StateRecord>>
fn get_all_state(&self) -> Result<Vec<StateRecord>>
Get all state records (for snapshotting)
Auto Trait Implementations§
impl Freeze for RocksStorage
impl RefUnwindSafe for RocksStorage
impl Send for RocksStorage
impl Sync for RocksStorage
impl Unpin for RocksStorage
impl UnwindSafe for RocksStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more