pub fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        writeln!(f, "{} {{", graph_type(&self.graph))?;

        for node in self.graph.node_references() {
            write!(
                f,
                "{}{} [label=\"",
                INDENT,
                (&self.graph).to_index(node.id())
            )?;
            self.visitor.visit_node(node, &mut DotWrite::new(f))?;
            writeln!(f, "\"]")?;
        }

        let edge_str = edge_str(&self.graph);
        for edge in self.graph.edge_references() {
            write!(
                f,
                "{}{} {} {} [label=\"",
                INDENT,
                (&self.graph).to_index(edge.source()),
                edge_str,
                (&self.graph).to_index(edge.target())
            )?;
            self.visitor.visit_edge(edge, &mut DotWrite::new(f))?;
            writeln!(f, "\"]")?;
        }

        writeln!(f, "}}")
    }
Outputs a graphviz-compatible representation of this graph to the given formatter.
guppy/src/petgraph_support/dot.rs