Struct rustfmt::Shape
[−]
[src]
pub struct Shape { pub width: usize, pub indent: Indent, pub offset: usize, }
Fields
width: usize
indent: Indent
offset: usize
Methods
impl Shape
[src]
fn legacy(width: usize, indent: Indent) -> Shape
[src]
indent
is the indentation of the first line. The next lines
should begin with at least indent
spaces (except backwards
indentation). The first line should not begin with indentation.
width
is the maximum number of characters on the last line
(excluding indent
). The width of other lines is not limited by
width
.
Note that in reality, we sometimes use width for lines other than the
last (i.e., we are conservative).
fn indented(indent: Indent, config: &Config) -> Shape
[src]
fn with_max_width(&self, config: &Config) -> Shape
[src]
fn offset(width: usize, indent: Indent, offset: usize) -> Shape
[src]
fn visual_indent(&self, extra_width: usize) -> Shape
[src]
fn block_indent(&self, extra_width: usize) -> Shape
[src]
fn block_left(&self, width: usize) -> Option<Shape>
[src]
fn add_offset(&self, extra_width: usize) -> Shape
[src]
fn block(&self) -> Shape
[src]
fn sub_width(&self, width: usize) -> Option<Shape>
[src]
fn shrink_left(&self, width: usize) -> Option<Shape>
[src]
fn offset_left(&self, width: usize) -> Option<Shape>
[src]
fn used_width(&self) -> usize
[src]
Trait Implementations
impl Copy for Shape
[src]
impl Clone for Shape
[src]
fn clone(&self) -> Shape
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more