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

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.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

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.