pub fn neighbors(&mut self, v: &'a T) -> HashSet<&'a T> {
        if !self.v2i.contains_key(v) {
            panic!("Attempt made to get neighbors of a missing vertex")
        } else {
            let id = self.get_vertex_id(v);
            let neighbors = self.graph.entry(id).or_insert(HashSet::new());
            let i2v = &self.i2v;

            neighbors.iter().map( |i| {
                match i2v.get(i) {
                    Some(vp) => *vp,
                    None => panic!("Corrupted graph, missing neighbor")
                }
            }).collect()
        }
    }
/// Get the set of neighbors for a given vertex.
Get the set of neighbors for a given vertex.
Get the set of neighbors for a given vertex .
pub fn neighbors(&mut self, v: &'a T) -> HashSet<&'a T> {
        if !self.v2i.contains_key(v) {
            panic!("Attempt made to get neighbors of a missing vertex")
        } else {
            let id = self.get_vertex_id(v);
            let neighbors = self.graph.entry(id).or_insert(HashSet::new());
            let i2v = &self.i2v;
            neighbors.iter().map( |i| {
                match i2v.get(i) {
                    Some(vp) => *vp,
                    None => panic!("Corrupted graph, missing neighbor")
                }
            }).collect()
        }
    }
pub fn neighbors ( & mut self , v : & ' a T ) -> HashSet < & ' a T > { if ! self . v2i . contains_key ( v ) { panic ! ( " " ) } else { let id = self . get_vertex_id ( v ) ; let neighbors = self . graph . entry ( id ) . or_insert ( HashSet :: new ( ) ) ; let i2v = & self . i2v ; neighbors . iter ( ) . map ( | i | { match i2v . get ( i ) { Some ( vp ) => * vp , None => panic ! ( " " ) } } ) . collect ( ) } }
Get the set of neighbors for a given vertex.
Get the set of neighbors for a given vertex .
&mut self
v
&'a T