use NodeLabels::*; use super::{Id, Labeller, Nodes, Edges, GraphWalk, render, Style}; use super::LabelText::{self, LabelStr, EscStr, HtmlStr}; use std::io; use std::io::prelude::*; /// each node is an index in a vector in the graph. type Node = usize; struct Edge { from: usize, to: usize, label: &'static str, style: Style, } fn edge(from: usize, to: usize, label: &'static str, style: Style) -> Edge { Edge { from, to, label, style, } } struct LabelledGraph { /// The name for this graph. Used for labeling generated `digraph`. name: &'static str, /// Each node is an index into `node_labels`; these labels are /// used as the label text for each node. (The node *names*, /// which are unique identifiers, are derived from their index /// in this array.) /// /// If a node maps to None here, then just use its name as its /// text. node_labels: Vec>, node_styles: Vec