fn remove_vertex(&mut self, vertex_id: usize) -> Result<()> {
        if !self.contains_vertex(vertex_id) {
            Err(Error::new_vnf(vertex_id))?
        } else {
            self.vertex_ids.remove(&vertex_id);

            self.edges
                .retain(|(src_id, dst_id, _)| *src_id != vertex_id || *dst_id != vertex_id);

            Ok(())
        }
    }
/// Removes a vertex from the subgraph.
///
/// # Arguments
/// `vertex_id`: Id of the vertex to be removed.
///
/// # Returns
/// * `Err`: If vertex with id: `vertex_id` is not present in the subgraph.
/// * `Ok`:
Removes a vertex from the subgraph.
Removes a vertex from the subgraph .
fn remove_vertex(&mut self, vertex_id: usize) -> Result<()> {
        if !self.contains_vertex(vertex_id) {
            Err(Error::new_vnf(vertex_id))?
        } else {
            self.vertex_ids.remove(&vertex_id);
            self.edges
                .retain(|(src_id, dst_id, _)| *src_id != vertex_id || *dst_id != vertex_id);
            Ok(())
        }
    }
fn remove_vertex ( & mut self , vertex_id : usize ) -> Result < ( ) > { if ! self . contains_vertex ( vertex_id ) { Err ( Error :: new_vnf ( vertex_id ) ) ? } else { self . vertex_ids . remove ( & vertex_id ) ; self . edges . retain ( | ( src_id , dst_id , _ ) | * src_id != vertex_id || * dst_id != vertex_id ) ; Ok ( ( ) ) } }
Removes a vertex from the subgraph.
Removes a vertex from the subgraph .
&mut self
vertex_id
usize
`Err`: If vertex with id: `vertex_id` is not present in the subgraph.
`Ok`.
` Err ` : If vertex with id : ` vertex_id ` is not present in the subgraph . ` Ok ` .
&mut self
vertex_id
usize