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

Commit

Permalink
add prev_kv field to watch event (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbirtles committed Oct 3, 2022
1 parent 73a76d3 commit afddc17
Showing 1 changed file with 2 additions and 0 deletions.
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),
}
}
}

0 comments on commit afddc17

Please sign in to comment.