Trait oxidd_core::util::NodeSet

source ·
pub trait NodeSet<E>: Clone + Default + Eq {
    // Required methods
    fn len(&self) -> usize;
    fn insert(&mut self, edge: &E) -> bool;
    fn contains(&self, edge: &E) -> bool;
    fn remove(&mut self, edge: &E) -> bool;

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

Set of nodes

Required Methods§

source

fn len(&self) -> usize

Get the number of nodes in the set

source

fn insert(&mut self, edge: &E) -> bool

Add a node (the node to which edge points) to the set

Returns true if the element was added (i.e. not previously present).

source

fn contains(&self, edge: &E) -> bool

Return true if the set contains the given node

source

fn remove(&mut self, edge: &E) -> bool

Remove a node from the set

Returns true if the node was present in the set.

Provided Methods§

source

fn is_empty(&self) -> bool

Returns true iff there are no nodes in the set

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<E: Edge> NodeSet<E> for BTreeSet<NodeID>

source§

fn len(&self) -> usize

source§

fn insert(&mut self, edge: &E) -> bool

source§

fn contains(&self, edge: &E) -> bool

source§

fn remove(&mut self, edge: &E) -> bool

source§

impl<E: Edge, S: Clone + Default + BuildHasher> NodeSet<E> for HashSet<NodeID, S>

source§

fn len(&self) -> usize

source§

fn insert(&mut self, edge: &E) -> bool

source§

fn contains(&self, edge: &E) -> bool

source§

fn remove(&mut self, edge: &E) -> bool

Implementors§