Struct rustfmt_nightly::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
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
fn with_max_width(&self, config: &Config) -> Shape
fn offset(width: usize, indent: Indent, offset: usize) -> Shape
fn visual_indent(&self, extra_width: usize) -> Shape
fn block_indent(&self, extra_width: usize) -> Shape
fn block_left(&self, width: usize) -> Option<Shape>
fn add_offset(&self, extra_width: usize) -> Shape
fn block(&self) -> Shape
fn sub_width(&self, width: usize) -> Option<Shape>
fn shrink_left(&self, width: usize) -> Option<Shape>
fn offset_left(&self, width: usize) -> Option<Shape>
fn used_width(&self) -> usize
Trait Implementations
impl Copy for Shape
[src]
impl Clone for Shape
[src]
fn clone(&self) -> Shape
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more