[−][src]Struct deviz::Graph
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]
&mut self,
from_id: impl Into<String>,
to_id: impl Into<String>,
label: impl Into<String>
)
Define an edge from the node with id from_id
to the node with id to_id
with the given
label.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Graph
[src]
impl Send for Graph
[src]
impl Sync for Graph
[src]
impl Unpin for Graph
[src]
impl UnwindSafe for Graph
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,