pub struct Dot<'a, G> where
    G: IntoEdgeReferences + IntoNodeReferences
{ /* private fields */ }
Expand description

Dot implements output to graphviz .dot format for a graph.

Formatting and options are rather simple, this is mostly intended for debugging. Exact output may change.

Examples

use petgraph::Graph;
use petgraph::dot::{Dot, Config};

let mut graph = Graph::<_, ()>::new();
graph.add_node("A");
graph.add_node("B");
graph.add_node("C");
graph.add_node("D");
graph.extend_with_edges(&[
    (0, 1), (0, 2), (0, 3),
    (1, 2), (1, 3),
    (2, 3),
]);

println!("{:?}", Dot::with_config(&graph, &[Config::EdgeNoLabel]));

// In this case the output looks like this:
//
// digraph {
//     0 [label="\"A\""]
//     1 [label="\"B\""]
//     2 [label="\"C\""]
//     3 [label="\"D\""]
//     0 -> 1
//     0 -> 2
//     0 -> 3
//     1 -> 2
//     1 -> 3
//     2 -> 3
// }

// If you need multiple config options, just list them all in the slice.

Implementations

Create a Dot formatting wrapper with default configuration.

Create a Dot formatting wrapper with custom configuration.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. 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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

Converts the given value to a String. Read more

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.