[][src]Struct deviz::Graph

pub struct Graph { /* fields omitted */ }

A builder for directed graph output. Construct using deviz::graph.

Examples

let mut graph = deviz::graph("g");
graph.node_labeled("root", "ROOT");
graph.node("A");
graph.node("B");
graph.edge("root", "A");
graph.edge_labeled("root", "B", "edge label");

Implementations

impl Graph[src]

pub fn node(&mut self, id: impl Into<String>)[src]

Add a node with the given id. The node's label equals its id.

pub fn node_labeled(&mut self, id: impl Into<String>, label: impl Into<String>)[src]

Add a node with the given id and label.

pub fn edge(&mut self, from_id: impl Into<String>, to_id: impl Into<String>)[src]

Define an unlabeled edge from the node with id from_id to the node with id to_id.

If a node id is used in an edge but there is no corresponding call to node or node_labeled, then the node will be added automatically.

Warning: The order that edges are displayed in the graph is not guaranteed to correspond to the order that they were defined. This will hopefully change in the future, but for now you should label all edges if their order matters.

pub fn edge_labeled(
    &mut self,
    from_id: impl Into<String>,
    to_id: impl Into<String>,
    label: impl Into<String>
)
[src]

Define an edge from the node with id from_id to the node with id to_id with the given label.

Trait Implementations

impl Debug for Graph[src]

impl Drop for Graph[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.