rokdocs
v0.1

rok::core::collections::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>.

Structs

OrderedSet

pub struct OrderedSet<T>
  • pub const fn new() -> OrderedSet<T>
  • pub const fn from(items: List<T>) -> OrderedSet<T>

    The items inserted in order (later duplicates dropped).

  • pub const fn len(self) -> usize
  • pub fn is_empty(self) -> bool
  • pub const fn insert(self, x: T) -> bool

    true when x was not there yet.

  • pub const fn remove(self, x: T) -> bool

    true when x was there.

  • pub const fn contains(self, x: T) -> bool
  • pub const fn iter(self) -> KeysIter<T

    The members in insertion order, lazily.

  • pub const fn to_list(self) -> List<T>
  • pub const fn union(self, other: OrderedSet<T>) -> OrderedSet<T>

    self's members, then other's new ones.

  • pub const fn intersection(self, other: OrderedSet<T>) -> OrderedSet<T>
  • pub const fn difference(self, other: OrderedSet<T>) -> OrderedSet<T>
  • pub fn symmetric_difference(self, other: OrderedSet<T>) -> OrderedSet<T>
  • pub const fn is_subset(self, other: OrderedSet<T>) -> bool
  • pub fn is_superset(self, other: OrderedSet<T>) -> bool
  • pub fn is_disjoint(self, other: OrderedSet<T>) -> bool
Trait implementations 7
  • impl<T> !Sync for OrderedSet<T>
  • impl<T: Hash> Default for OrderedSet<T>
  • impl<T: Hash + Clone> Clone for OrderedSet<T>
  • impl<T: Hash> IntoIterator for OrderedSet<T>
  • impl<T: Hash> FromIterator<T> for OrderedSet<T>
  • impl<T: Hash> PartialEq for OrderedSet<T>
  • impl<T: Hash + Debug> Debug for OrderedSet<T>