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

add prev_kv field to watch event #72

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/watch/mod.rs
Expand Up @@ -124,6 +124,7 @@ impl From<mvccpb::event::EventType> for EventType {
pub struct Event {
pub event_type: EventType,
pub kv: KeyValue,
pub prev_kv: Option<KeyValue>,
}

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