9 releases

0.1.9 Oct 16, 2023
0.1.8 Oct 12, 2023

#35 in #pi

36 downloads per month
Used in 2 crates (via pi_spatial)

MIT/Apache

21KB
476 lines

pi_link_list


lib.rs:

链表核心逻辑。维护链表的关联关系, 但不存储链表的具体数据, 数据有外部容器存储(该容器实现了Index<K, Output = Node<K, T>> + IndexMut<K, Output = Node<K, T>>)

关于索引的意义,请参考:https://github.com/GaiaWorld/pi_lib/tree/master/dyn_uint 由于需要从任意位置删除元素,我们未采用标准库使用vec作为双端队列内部容器的做法。 如果要从任意位置删除,链表是个不错的选择。

简单的使用本双端队列,请使用slab_deque模块提供的双端队列 要查看本模块的用法,可以参照slab_deque模块,和https://github.com/GaiaWorld/pi_lib/tree/master/task_pool库

Dependencies

~1.1–1.6MB
~37K SLoC