rokdocs
v0.1

rok::core::collections

rok::core::collections - List / Dict / Set / OrderedDict / OrderedSet / Slice (stdlib spec 2.9), Deque and BinaryHeap.

Each collection is a small handle struct over GC buffers (raw): copying the handle shares the collection, so the mutating methods take self (spec writes ref self; the handle makes that moot).

Modules

  • raw rok::core::collections::raw - the GC buffer the collections are built on (stdlib 2.9.12).
  • list rok::core::collections::list - `List<T>`, a growable array (stdlib spec 2.9.2): one object holding the length, the capacity and the current element buffer, swapped for a bigger one on growth.
  • deque rok::core::collections::deque - `Deque<T>`, a growable ring buffer with O(1) push and pop at both ends.
  • heap rok::core::collections::heap - `BinaryHeap<T>`, a priority queue over a `List` laid out as an implicit binary tree.
  • dict rok::core::collections::dict - `Dict<K, V>`, a hash map (stdlib spec 2.9.3), compact: entries are appended to dense key / value / hash arrays, and a power-of-two index of linear-probed slots maps a hash to its entry.
  • set rok::core::collections::set - `Set<T>`, a hash set (stdlib spec 2.9.4) over `Dict<T, bool>`.
  • ordered_dict rok::core::collections::ordered_dict - `OrderedDict<K, V>`, a hash map that iterates in insertion order (stdlib spec 2.9.5): a `Dict`, whose compact entries already keep that order.
  • ordered_set rok::core::collections::ordered_set - `OrderedSet<T>`, a hash set that iterates in insertion order (stdlib spec 2.9.5), over `OrderedDict<T, bool>`.
  • slice rok::core::collections::slice: `Slice<T>`, a zero-copy view (stdlib 2.9.7); element `i` is `buf[start + i * stride]`, and the view keeps its buffer alive.
  • broadcast rok::core::collections::broadcast - the element-wise dot operators on `List<T>` (stdlib spec 2.6.7): `List op List` (same length, else a panic), `List op T` and `T op List` (the scalar applies to every element).

Re-exports

list::

pub use list::

deque::

pub use deque::

heap::BinaryHeap

pub use heap::BinaryHeap

dict::

pub use dict::

set::Set

pub use set::Set

ordered_dict::OrderedDict

pub use ordered_dict::OrderedDict

ordered_set::OrderedSet

pub use ordered_set::OrderedSet

slice::

pub use slice::