- a value of type
- an immutable tag of type
- a unique
u64which is assigned in sequential order of insertion starting at 0 when the queue is created.
pub fn after<'a, Tags>(&self, index: u64, tags: Tags) -> Option<Item<K, V>> where Tags: IntoIterator<Item = &'a K>, K: 'a,
If we use
Tags, this signature simplifies to:
pub fn after(&self, index: u64, tags: &[K]) -> Option<Item<K, V>>
These methods are the real benefit of using a hopscotch queue over another data structure. Their asymptotic time complexity is:
- linear relative to the number of tags queried,
- logarithmic relative to the total number of distinct tags in the queue,
- constant relative to the length of the queue, and
- constant relative to the distance between successive items with the same tag.
Hopscotch queues also provide flexible iterators
efficiently traverse portions of their contents, sliced by index using
and filtered by set of desired tags using
An immutable reference to an item currently in the queue.
A mutable reference to an item currently in the queue.
An iterator over immutable references to items in a queue. Created by
An iterator over mutable references to items in a queue. Created by
An item that has been popped from the queue.
A hopscotch queue with keys of type
Trait for type constructors of reference-counting pointers.