pub struct RocksStore { /* private fields */ }Expand description
Minimal RocksDB-backed store for the simulator: batch writes plus a global sequence u64 plus a per-sequence batch log.
Implementations§
Trait Implementations§
Source§impl Clone for RocksStore
impl Clone for RocksStore
Source§fn clone(&self) -> RocksStore
fn clone(&self) -> RocksStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl StoreEngine for RocksStore
impl StoreEngine for RocksStore
Source§fn put_batch(&self, kvs: &[(Bytes, Bytes)]) -> Result<u64, String>
fn put_batch(&self, kvs: &[(Bytes, Bytes)]) -> Result<u64, String>
Persist key-value pairs atomically and return the new global sequence number for this write.
Source§fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, String>
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, String>
Fetch the value for a single key. Returns
None when the key does not exist.Source§fn range_scan(
&self,
start: &[u8],
end: &[u8],
limit: usize,
forward: bool,
) -> Result<Vec<(Bytes, Bytes)>, String>
fn range_scan( &self, start: &[u8], end: &[u8], limit: usize, forward: bool, ) -> Result<Vec<(Bytes, Bytes)>, String>
Keys in
[start, end] (inclusive) when end is non-empty; empty end means unbounded
above. Matches store.query.v1.RangeRequest / ReduceRequest on the wire. limit caps
rows returned.Source§fn get_many(
&self,
keys: &[&[u8]],
) -> Result<Vec<(Vec<u8>, Option<Vec<u8>>)>, String>
fn get_many( &self, keys: &[&[u8]], ) -> Result<Vec<(Vec<u8>, Option<Vec<u8>>)>, String>
Batch-get: returns
(key, Option<value>) for each input key, preserving order.Source§fn delete_batch(&self, keys: &[&[u8]]) -> Result<u64, String>
fn delete_batch(&self, keys: &[&[u8]]) -> Result<u64, String>
Delete a batch of keys atomically. Returns the new global sequence number.
Source§fn current_sequence(&self) -> u64
fn current_sequence(&self) -> u64
Current sequence number visible to readers (used for
min_sequence_number checks).Source§fn get_batch(
&self,
sequence_number: u64,
) -> Result<Option<Vec<(Bytes, Bytes)>>, String>
fn get_batch( &self, sequence_number: u64, ) -> Result<Option<Vec<(Bytes, Bytes)>>, String>
Return the (key, value) pairs written by the
put_batch call that was
assigned sequence_number. Ok(None) = the batch has been pruned or
was never written (the store.stream.v1 service maps None to NOT_FOUND
with a BATCH_EVICTED detail). Read moreAuto Trait Implementations§
impl Freeze for RocksStore
impl RefUnwindSafe for RocksStore
impl Send for RocksStore
impl Sync for RocksStore
impl Unpin for RocksStore
impl UnsafeUnpin for RocksStore
impl UnwindSafe for RocksStore
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