inline database stream interface functions lt 64B
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
a7cb1c5951
commit
9775694423
5 changed files with 13 additions and 0 deletions
|
@ -28,6 +28,7 @@ impl<'a> Cursor<'a, KeyVal<'a>> for Items<'a> {
|
|||
|
||||
fn fetch(&self) -> Option<KeyVal<'a>> { self.state.fetch().map(keyval_longevity) }
|
||||
|
||||
#[inline]
|
||||
fn seek(&mut self) { self.state.seek_fwd(); }
|
||||
}
|
||||
|
||||
|
@ -40,5 +41,6 @@ impl<'a> Stream for Items<'a> {
|
|||
}
|
||||
|
||||
impl FusedStream for Items<'_> {
|
||||
#[inline]
|
||||
fn is_terminated(&self) -> bool { !self.state.init && !self.state.valid() }
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ impl<'a> Cursor<'a, KeyVal<'a>> for ItemsRev<'a> {
|
|||
|
||||
fn fetch(&self) -> Option<KeyVal<'a>> { self.state.fetch().map(keyval_longevity) }
|
||||
|
||||
#[inline]
|
||||
fn seek(&mut self) { self.state.seek_rev(); }
|
||||
}
|
||||
|
||||
|
@ -40,5 +41,6 @@ impl<'a> Stream for ItemsRev<'a> {
|
|||
}
|
||||
|
||||
impl FusedStream for ItemsRev<'_> {
|
||||
#[inline]
|
||||
fn is_terminated(&self) -> bool { !self.state.init && !self.state.valid() }
|
||||
}
|
||||
|
|
|
@ -26,8 +26,10 @@ impl<'a> Keys<'a> {
|
|||
impl<'a> Cursor<'a, Key<'a>> for Keys<'a> {
|
||||
fn state(&self) -> &State<'a> { &self.state }
|
||||
|
||||
#[inline]
|
||||
fn fetch(&self) -> Option<Key<'a>> { self.state.fetch_key().map(slice_longevity) }
|
||||
|
||||
#[inline]
|
||||
fn seek(&mut self) { self.state.seek_fwd(); }
|
||||
}
|
||||
|
||||
|
@ -40,5 +42,6 @@ impl<'a> Stream for Keys<'a> {
|
|||
}
|
||||
|
||||
impl FusedStream for Keys<'_> {
|
||||
#[inline]
|
||||
fn is_terminated(&self) -> bool { !self.state.init && !self.state.valid() }
|
||||
}
|
||||
|
|
|
@ -26,8 +26,10 @@ impl<'a> KeysRev<'a> {
|
|||
impl<'a> Cursor<'a, Key<'a>> for KeysRev<'a> {
|
||||
fn state(&self) -> &State<'a> { &self.state }
|
||||
|
||||
#[inline]
|
||||
fn fetch(&self) -> Option<Key<'a>> { self.state.fetch_key().map(slice_longevity) }
|
||||
|
||||
#[inline]
|
||||
fn seek(&mut self) { self.state.seek_rev(); }
|
||||
}
|
||||
|
||||
|
@ -40,5 +42,6 @@ impl<'a> Stream for KeysRev<'a> {
|
|||
}
|
||||
|
||||
impl FusedStream for KeysRev<'_> {
|
||||
#[inline]
|
||||
fn is_terminated(&self) -> bool { !self.state.init && !self.state.valid() }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue