Struct dot_parser::ast::Graph [−][src]
pub struct Graph<'a, A = (&'a str, &'a str)> {
pub strict: bool,
pub is_digraph: bool,
pub name: Option<&'a str>,
pub stmts: StmtList<'a, A>,
}Expand description
This structure is an AST for the DOT graph language. The generic A
denotes the type of attributes. By default (and when parsing), it is
(&'a str, &'a str), i.e. two strings, one for the key and one for the
value of the attribute. The library provides functions to map from one type
to an other.
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.
stmts: StmtList<'a, A>The statements that describe 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.
Trait Implementations
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more