pub struct CfgDot {
pub config: CfgDotConfig,
}
Expand description
The main struct for rendering DOT graphs.
Fields§
§config: CfgDotConfig
The configuration for rendering the graph.
Implementations§
Source§impl CfgDot
impl CfgDot
Sourcepub fn render<R, N, E>(&self, graph: &DiGraph<N, E>, resolver: &R) -> Stringwhere
R: NodeResolver,
pub fn render<R, N, E>(&self, graph: &DiGraph<N, E>, resolver: &R) -> Stringwhere
R: NodeResolver,
Renders the DOT representation of a DiGraph
using the provided resolver.
This method:
- Defines a directed graph (
digraph CFG
). - Applies graph-level and node-level styles from
self.config
. - Iterates over each node in the graph, resolving it via
resolver
. - Calculates the number of incoming edges for each node to create “ports” for the edges.
- Constructs an HTML-like table label for each node with indentation to make it readable.
- Iterates over all edges and connects them to the correct node ports.
The data.render_node(8)
call uses an indentation of 8 spaces for the node’s content.
§Type Parameters
R
- A type that implementsNodeResolver
.N
- Node weight type of theDiGraph
.E
- Edge weight type of theDiGraph
.
§Arguments
graph
- The directed graph to render.resolver
- An object that resolves each node index to a data structure that can be rendered.
§Returns
A String
containing the entire DOT (Graphviz) representation of the graph.
Auto Trait Implementations§
impl Freeze for CfgDot
impl RefUnwindSafe for CfgDot
impl Send for CfgDot
impl Sync for CfgDot
impl Unpin for CfgDot
impl UnwindSafe for CfgDot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more