pub trait ItemSet<I>where
    I: Copy,{
    // Required methods
    fn len(&self) -> usize;
    fn clear(&mut self);
    fn insert(&mut self, u: I) -> bool;
    fn remove(&mut self, u: I) -> bool;
    fn contains(&self, u: I) -> bool;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A (finite) set of items (node or edges) of a graph.

Required Methods§

source

fn len(&self) -> usize

Return the number of items in this set.

source

fn clear(&mut self)

Remove all nodes from the set.

source

fn insert(&mut self, u: I) -> bool

Add one item to the set.

Return true iff u had not been contained in this set before.

source

fn remove(&mut self, u: I) -> bool

Remove one item from the set.

Returns true if the item had been contained in the set, otherwise false.

source

fn contains(&self, u: I) -> bool

Return true iff item u is contained in this set.

Provided Methods§

source

fn is_empty(&self) -> bool

Return true if this set is empty.

Implementations on Foreign Types§

source§

impl<N, B> ItemSet<N> for HashSet<N, B>where N: Copy + Eq + Hash, B: BuildHasher,

source§

fn is_empty(&self) -> bool

source§

fn len(&self) -> usize

source§

fn clear(&mut self)

source§

fn insert(&mut self, u: N) -> bool

source§

fn remove(&mut self, u: N) -> bool

source§

fn contains(&self, u: N) -> bool

source§

impl<'a, N, S> ItemSet<N> for &'a mut Swhere S: ItemSet<N>, N: Copy,

source§

fn is_empty(&self) -> bool

source§

fn len(&self) -> usize

source§

fn clear(&mut self)

source§

fn insert(&mut self, u: N) -> bool

source§

fn remove(&mut self, u: N) -> bool

source§

fn contains(&self, u: N) -> bool

Implementors§