pub(crate) struct Formatter {
    indent: usize,
    lines: Vec<String>,
}

Fields§

§indent: usize§lines: Vec<String>

Implementations§

Source code formatter class. Used to collect source code to be written to a file, and keep track of indentation.

Increase current indentation level by one.

Decrease indentation by one level.

Get the current whitespace indentation in the form of a String.

Add an indented line.

Pushes an empty line.

Write self.lines to a file.

Add one or more lines after stripping common indentation.

Add a comment line.

Add a (multi-line) documentation comment.

Add a match expression.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.