Struct dot_parser::canonical::Graph [−][src]
pub struct Graph<'a, A> {
pub strict: bool,
pub is_digraph: bool,
pub name: Option<&'a str>,
pub attr: Vec<AttrStmt<A>>,
pub nodes: NodeSet<'a, A>,
pub edges: EdgeSet<'a, A>,
}Expand description
A Graph is a structure that can be created from a regular
Graph, but that is more friendly to work with. For instance, in a Graph,
attributes are most often given as a list of list of Attr, while in a
Graph, the lists are flatten.
Fields
strict: boolSpecifies if the Graph is strict or not. A “strict” graph must not
contain the same edge multiple times. Notice that, for undirected edge,
an edge from A to B and an edge from B to A are equals.
is_digraph: boolSpecifies if the Graph is directed.
name: Option<&'a str>The name of the Graph, if any.
attr: Vec<AttrStmt<A>>The global attributes of the graph.
nodes: NodeSet<'a, A>The nodes of the graph.
edges: EdgeSet<'a, A>The edges of the graph.
Implementations
Filter and map attributes. The main intended usage of this function is
to convert attributes as &'a str into an enum, e.g.
to convert ["label"="whatever", "color"="foo"] into
[Attr::Label(whatever), Attr::Color(foo)].
To take into account non-standard attributes, the Attr enum has to be
provided by the user.