Skip to content

Commit 4a94388

Browse files
committed
add some comment
1 parent 1f29cf7 commit 4a94388

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/notes/kvs/src/kv.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ enum Command {
149149
Remove { key: String },
150150
}
151151

152+
/// 定义支持的指令/日志
152153
impl Command {
153154
fn set(key: String, value: String) -> Self {
154155
Command::Set { key, value }
@@ -162,8 +163,11 @@ impl Command {
162163
/// 命令位置
163164
#[derive(Debug)]
164165
struct CommandPos {
166+
/// 日志文件序号
165167
gen: u64,
168+
/// 日志在一个文件中的偏移量
166169
pos: u64,
170+
/// 日志的长度。一个指令就算是一条日志
167171
len: u64,
168172
}
169173

0 commit comments

Comments
 (0)