Skip to main content

VisitMap

Trait VisitMap 

Source
pub trait VisitMap<N> {
    // Required methods
    fn visit(&mut self, a: N) -> bool;
    fn is_visited(&self, a: &N) -> bool;
    fn unvisit(&mut self, _a: N) -> bool;
}
Expand description

A mapping for storing the visited status for NodeId N.

Required Methods§

Source

fn visit(&mut self, a: N) -> bool

Mark a as visited.

Return true if this is the first visit, false otherwise.

Source

fn is_visited(&self, a: &N) -> bool

Return whether a has been visited before.

Source

fn unvisit(&mut self, _a: N) -> bool

Mark a as unvisited.

Return true if this vertex was marked as visited at the time of unsetting it, false otherwise.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<Ix> VisitMap<Ix> for FixedBitSet
where Ix: IndexType,

Source§

fn visit(&mut self, x: Ix) -> bool

Source§

fn is_visited(&self, x: &Ix) -> bool

Source§

fn unvisit(&mut self, x: Ix) -> bool

Source§

impl<N, S> VisitMap<N> for HashSet<N, S>
where N: Hash + Eq, S: BuildHasher,

Source§

fn visit(&mut self, x: N) -> bool

Source§

fn is_visited(&self, x: &N) -> bool

Source§

fn unvisit(&mut self, x: N) -> bool

Source§

impl<N, S> VisitMap<N> for HashSet<N, S>
where N: Hash + Eq, S: BuildHasher,

Available on crate feature std only.
Source§

fn visit(&mut self, x: N) -> bool

Source§

fn is_visited(&self, x: &N) -> bool

Source§

fn unvisit(&mut self, x: N) -> bool

Implementors§