Skip to main content

DotPrinter

Trait DotPrinter 

Source
pub trait DotPrinter {
    // Required method
    fn print(&self, ctx: &mut PrinterContext) -> String;
}
Expand description

The trait for serailizing a Graph into the graphviz DOT language:

§Example:

       use dot_generator::*;
       use dot_structures::*;
       use self::graphviz_rust::printer::PrinterContext;
       use self::graphviz_rust::printer::DotPrinter;

       let mut ctx =PrinterContext::default();
       ctx.always_inline();
       ctx.with_indent_step(4);
       let graph = graph!(strict di id!("t"));

       let string = graph.print(&mut ctx);

Required Methods§

Source

fn print(&self, ctx: &mut PrinterContext) -> String

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DotPrinter for Attribute

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Edge

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Graph

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for GraphAttributes

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Id

Source§

fn print(&self, _ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Node

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for NodeId

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Port

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Stmt

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Subgraph

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Vec<Attribute>

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Vec<Stmt>

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Source§

impl DotPrinter for Vertex

Source§

fn print(&self, ctx: &mut PrinterContext) -> String

Implementors§