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: bool

Specifies 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: bool

Specifies 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

Read a graph from a DOT file.

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

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.