pub struct PrinterContext { /* private fields */ }
Expand description
Context allows to customize the output of the file.
§Example:
use self::graphviz_rust::printer::PrinterContext;
let mut ctx = PrinterContext::default();
ctx.always_inline();
ctx.with_indent_step(4);
Implementations§
Source§impl PrinterContext
impl PrinterContext
Sourcepub fn always_inline(&mut self) -> &mut PrinterContext
pub fn always_inline(&mut self) -> &mut PrinterContext
Print everything on one line.
Sourcepub fn with_semi(&mut self) -> &mut PrinterContext
pub fn with_semi(&mut self) -> &mut PrinterContext
Add a semicolon at the end of every line.
Sourcepub fn with_node_mult_attr_s_l(&mut self) -> &mut PrinterContext
pub fn with_node_mult_attr_s_l(&mut self) -> &mut PrinterContext
Print multiple attributes on seperate lines
Sourcepub fn with_indent_step(&mut self, step: usize) -> &mut PrinterContext
pub fn with_indent_step(&mut self, step: usize) -> &mut PrinterContext
Set a step of the indent.
Sourcepub fn with_line_sep(&mut self, sep: String) -> &mut PrinterContext
pub fn with_line_sep(&mut self, sep: String) -> &mut PrinterContext
Set a specific line separator.
Sourcepub fn with_inline_size(&mut self, inline_s: usize) -> &mut PrinterContext
pub fn with_inline_size(&mut self, inline_s: usize) -> &mut PrinterContext
Set the max line length.
The default value is 90.
Sourcepub fn with_attr_value_printer(
&mut self,
attr_id: Id,
fmt: Box<AttributeValuePrinter>,
) -> &mut PrinterContext
pub fn with_attr_value_printer( &mut self, attr_id: Id, fmt: Box<AttributeValuePrinter>, ) -> &mut PrinterContext
Add an attribute printer for a specific attribute id.
pub fn new( semi: bool, indent_step: usize, line_s: String, inline_size: usize, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrinterContext
impl !RefUnwindSafe for PrinterContext
impl !Send for PrinterContext
impl !Sync for PrinterContext
impl Unpin for PrinterContext
impl !UnwindSafe for PrinterContext
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