Trait mz_ore::str::IndentLike

source ·
pub trait IndentLike {
    // Required methods
    fn indented<F>(&mut self, f: F) -> Result
       where F: FnMut(&mut Self) -> Result;
    fn indented_if<F>(&mut self, guard: bool, f: F) -> Result
       where F: FnMut(&mut Self) -> Result;
}
Expand description

Convenience methods for pretty-printing based on indentation that are automatically available for context objects that can be mutably referenced as an Indent instance.

Required Methods§

source

fn indented<F>(&mut self, f: F) -> Result
where F: FnMut(&mut Self) -> Result,

Print a block of code defined in f one step deeper from the current Indent.

source

fn indented_if<F>(&mut self, guard: bool, f: F) -> Result
where F: FnMut(&mut Self) -> Result,

Same as IndentLike::indented, but the f only going to be printed in an indented context if guard is true.

Object Safety§

This trait is not object safe.

Implementors§