pub struct PrinterContext { /* private fields */ }Expand description
Context allows to customize the output of the file.
§Example:
fn ctx(){
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
everything in one line
Sourcepub fn with_semi(&mut self) -> &mut PrinterContext
pub fn with_semi(&mut self) -> &mut PrinterContext
add semi at the end of every line
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 sep
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 a line len enough to fit in a line
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