Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit afddc17

Browse files
authored
add prev_kv field to watch event (#72)
1 parent 73a76d3 commit afddc17

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/watch/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ impl From<mvccpb::event::EventType> for EventType {
124124
pub struct Event {
125125
pub event_type: EventType,
126126
pub kv: KeyValue,
127+
pub prev_kv: Option<KeyValue>,
127128
}
128129

129130
impl From<mvccpb::Event> for Event {
@@ -134,6 +135,7 @@ impl From<mvccpb::Event> for Event {
134135
_ => EventType::Delete, // FIXME: assert valid event type
135136
},
136137
kv: From::from(proto.kv.expect("must fetch kv")),
138+
prev_kv: proto.prev_kv.map(KeyValue::from),
137139
}
138140
}
139141
}

0 commit comments

Comments
 (0)