pub struct ConcurrentSkipList<K: Ord + Clone, V: Clone> { /* private fields */ }Expand description
A concurrent skip list optimized for offset lookups
Provides O(log n) lookups for finding messages by offset, which is critical for efficient consumer fetching.
§Design: Append-Only
This skip list intentionally does not implement remove(). It is designed for
append-only offset indexing where:
- Entries are never deleted individually — the entire skip list is dropped when the corresponding segment is compacted or deleted
- Memory lifecycle is tied to segment lifetime — when a segment is removed,
the skip list is dropped via the
Dropimplementation, which properly deallocates all nodes - Offset indices are monotonically increasing — no reuse of keys
This design provides better performance than a skip list with remove support:
- No ABA problem handling required
- Simpler atomic operations (no backlink management)
- Predictable memory layout
Implementations§
Source§impl<K: Ord + Clone + Default, V: Clone + Default> ConcurrentSkipList<K, V>
impl<K: Ord + Clone + Default, V: Clone + Default> ConcurrentSkipList<K, V>
Trait Implementations§
impl<K: Ord + Clone + Send, V: Clone + Send> Send for ConcurrentSkipList<K, V>
impl<K: Ord + Clone + Sync, V: Clone + Sync> Sync for ConcurrentSkipList<K, V>
Auto Trait Implementations§
impl<K, V> !Freeze for ConcurrentSkipList<K, V>
impl<K, V> !RefUnwindSafe for ConcurrentSkipList<K, V>
impl<K, V> Unpin for ConcurrentSkipList<K, V>
impl<K, V> !UnwindSafe for ConcurrentSkipList<K, V>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more