Skip to content

Commit

Permalink
Improve Store comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker committed Sep 2, 2023
1 parent 872e8bc commit 99f1db6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/storage/kv/memory.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::Store;
use crate::error::Result;

/// In-memory key-value store using the Rust standard library B-tree implementation.
/// An in-memory key/value store using the Rust standard library B-tree
/// implementation. Data is not persisted.
pub struct Memory {
data: std::collections::BTreeMap<Vec<u8>, Vec<u8>>,
}
Expand Down
8 changes: 7 additions & 1 deletion src/storage/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ pub use mvcc::MVCC;

use crate::error::Result;

/// A key/value store.
/// A key/value storage engine, where both keys and values are arbitrary byte
/// strings between 0 B and 2 GB, stored in lexicographical key order. Writes
/// are only guaranteed durable after calling flush().
///
/// Only supports single-threaded use since all methods (including reads) take a
/// mutable reference -- serialized access can't be avoided anyway, since both
/// Raft execution and file access is serial.
pub trait Store: std::fmt::Display + Send + Sync {
/// The iterator returned by scan(). Traits can't return "impl Trait", and
/// we don't want to use trait objects, so the type must be specified.
Expand Down

0 comments on commit 99f1db6

Please sign in to comment.