Trait WeakListNodeSet

Source
pub unsafe trait WeakListNodeSet {
    // Required methods
    fn insert_ns(&mut self, ptr: usize);
    fn contains_ns(&self, list: &WeakList<Self>, ptr: usize) -> bool
       where Self: Sized;
    fn remove_ns(&mut self, ptr: usize);
}
Expand description

WeakList storage, needs to be able to tell whether a node belongs to this list.

Implementations can assume that:

  • insert will only be called for nodes that do not already belong to the list
  • remove will only be called for nodes that do already belong to the list

§Safety

This trait is unsafe because if an implementation returns true for a pointer that is not in the list, many invariants will be broken. Therefore, contains must always return the correct value.

Required Methods§

Source

fn insert_ns(&mut self, ptr: usize)

Source

fn contains_ns(&self, list: &WeakList<Self>, ptr: usize) -> bool
where Self: Sized,

Source

fn remove_ns(&mut self, ptr: usize)

Implementations on Foreign Types§

Source§

impl WeakListNodeSet for Lazy<HashSet<usize>>

Source§

fn insert_ns(&mut self, ptr: usize)

Source§

fn contains_ns(&self, _list: &WeakList<Self>, ptr: usize) -> bool

Source§

fn remove_ns(&mut self, ptr: usize)

Implementors§