pub fn successors(&self, index: usize) -> Result<Vec<&V>> {
        if !self.vertices.contains_key(&index) {
            bail!(
                "Vertex {} does not exist and therefor has no successors",
                index
            );
        }

        let vertices = &self.successors[&index];

        Ok(vertices.iter().fold(Vec::new(), |mut v, index| {
            v.push(self.vertices.get(index).unwrap());
            v
        }))
    }
/// Returns all immediate successors of a vertex from the graph.
Returns all immediate successors of a vertex from the graph.
Returns all immediate successors of a vertex from the graph .
pub fn successors(&self, index: usize) -> Result<Vec<&V>> {
        if !self.vertices.contains_key(&index) {
            bail!(
                "Vertex {} does not exist and therefor has no successors",
                index
            );
        }
        let vertices = &self.successors[&index];
        Ok(vertices.iter().fold(Vec::new(), |mut v, index| {
            v.push(self.vertices.get(index).unwrap());
            v
        }))
    }
pub fn successors ( & self , index : usize ) -> Result < Vec < & V > > { if ! self . vertices . contains_key ( & index ) { bail ! ( " " index ) ; } let vertices = & self . successors [ & index ] ; Ok ( vertices . iter ( ) . fold ( Vec :: new ( ) , | mut v , index | { v . push ( self . vertices . get ( index ) . unwrap ( ) ) ; v } ) ) }
Returns all immediate successors of a vertex from the graph.
Returns all immediate successors of a vertex from the graph .
&self
index
usize
&self
index
usize