EdgeList

Struct EdgeList 

Source
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>

Source

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;}"
);
Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.