Skip to content

Commit

Permalink
chore: support stream::Entry::value method
Browse files Browse the repository at this point in the history
  • Loading branch information
ethe committed Jul 18, 2024
1 parent a672a9a commit 13ad69b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<R> Entry<'_, R>
where
R: Record,
{
pub fn key(&self) -> Timestamped<<R::Key as Key>::Ref<'_>> {
pub(crate) fn key(&self) -> Timestamped<<R::Key as Key>::Ref<'_>> {
match self {
Entry::Mutable(entry) => entry
.key()
Expand All @@ -44,6 +44,14 @@ where
Entry::Immutable(entry) => entry.internal_key(),
}
}

pub(crate) fn value(&self) -> R::Ref<'_> {
match self {
Entry::Mutable(entry) => entry.value().as_ref().map(R::as_record_ref).unwrap(),
Entry::SsTable(entry) => entry.get(),
Entry::Immutable(entry) => entry.get(),
}
}
}

impl<R> fmt::Debug for Entry<'_, R>
Expand Down

0 comments on commit 13ad69b

Please sign in to comment.