macro_rules! graph {
($($source:expr => $target:expr),+ $(,)?) => { ... };
}Expand description
Creates a graph from the given pairs.
This macro creates a Graph and adds nodes and edges based on the
provided source-target pairs. It’s primarily intended for use in tests and
examples to quickly set up graphs, and is not optimized for performance.
Additionally, the node type must implement Copy.
In case you need a Builder, e.g. to inspect the graph before building
or to print it to DOT format, use the graph_builder! macro.
§Examples
use zrx_graph::graph;
// Create graph from pairs
let graph = graph! {
"a" => "b", "a" => "c",
"b" => "c",
};