pub struct EdgeList<'d, 'w> { /* private fields */ }Expand description
An EdgeList is returned from Scope::edge and can be used to set the attributes
of an edge, or to chain additional nodes onto the edge statement.
Implementations§
Source§impl<'d, 'w> EdgeList<'d, 'w>
impl<'d, 'w> EdgeList<'d, 'w>
Sourcepub fn edge<N: AsRef<[u8]>>(&mut self, node_id: N) -> &mut Self
pub fn edge<N: AsRef<[u8]>>(&mut self, node_id: N) -> &mut Self
Adds another edge from the last node added to node_id.
Note that nodes do not need to be already defined by Scope::node_auto
or by Scope::node_named (unless you want to set node-specifc attributes).
use dot_writer::DotWriter;
let mut output_bytes = Vec::new();
{
let mut writer = DotWriter::from(&mut output_bytes);
writer.set_pretty_print(false);
writer.digraph().edge("a", "b").edge("c").edge("d");
}
assert_eq!(
std::str::from_utf8(&output_bytes).unwrap(),
"digraph{a->b->c->d;}"
);
Sourcepub fn attributes(self) -> AttributesList<'d, 'w>
pub fn attributes(self) -> AttributesList<'d, 'w>
Start writing the attributes section of an edge definition. See the returned structure for what attributes can be set. Note that no more nodes can be added after this function is called.
Auto Trait Implementations§
impl<'d, 'w> Freeze for EdgeList<'d, 'w>
impl<'d, 'w> !RefUnwindSafe for EdgeList<'d, 'w>
impl<'d, 'w> !Send for EdgeList<'d, 'w>
impl<'d, 'w> !Sync for EdgeList<'d, 'w>
impl<'d, 'w> Unpin for EdgeList<'d, 'w>
impl<'d, 'w> !UnwindSafe for EdgeList<'d, 'w>
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