Data structures

  • List: values of one type, in order. Walk, sort, map, select.
  • Map: find a value by key (Int, String or Bytes), in insertion order. Lookups and counters.
  • Set: each Int, String or Bytes once, in first-added order. Duplicates and membership.
  • Queue (std/queue): first in, first out, of strings.
  • Heap (std/heap): a priority queue of any type; pop gives the first value in your order.
  • Range: 0...n counts without a list. Use it in for.
  • Bytes: a compact immutable byte string, for digests, file contents and wire formats. Slice, join, compare.
  • Lazy: a recipe of steps over a list, a range or an endless source, run one item at a time.
  • Optional: some(value) or none, for a value that may be missing.
  • Structs and enums: fixed named fields, or named cases.

All values are immutable. New to these? Read the tour pages Lists and Maps first.