Crate fast_set

source ·

Structs

  • A FastSet is a set of usize with fast add, remove, contains, and clear operations. Each instance of FastSet has some maximal value, and uses heap space proportional to that value. Every operation except cloning, including clear, runs in constant time. new should also run in constant time if alloc_zeroed does, which I am assured is true on any modern OS. Based on a neat trick described by Russ Cox at https://research.swtch.com/sparse.
  • An OutOfBounds error occurs when FastSet::add or FastSet::remove is called with a key that is higher than the set’s capacity