diff --git a/src/watch/event.rs b/src/watch/event.rs index 2356ad8c..566c7224 100644 --- a/src/watch/event.rs +++ b/src/watch/event.rs @@ -25,6 +25,19 @@ impl Event { } } +/// Get the inner value of the event +/// +/// NOTE: for update, it returns the new value +impl Event { + pub fn inner(&self) -> Result { + match self { + Event::Insert(insert) => insert.inner(), + Event::Update(update) => update.inner_new(), + Event::Delete(delete) => delete.inner(), + } + } +} + impl Debug for Event { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self {