Struct rustfmt_nightly::comment::ItemizedBlock[][src]

struct ItemizedBlock {
    lines: Vec<String>,
    indent: usize,
    opener: String,
    line_start: String,
}
Expand description

Block that is formatted as an item.

An item starts with either a star * or a dash -. Different level of indentation are handled by shrinking the shape accordingly.

Fields

lines: Vec<String>

the lines that are identified as part of an itemized block

indent: usize

the number of whitespaces up to the item sigil

opener: String

the string that marks the start of an item

line_start: String

sequence of whitespaces to prefix new lines that are part of the item

Implementations

Returns true if the line is formatted as an item

Creates a new ItemizedBlock described with the given line. The is_itemized_line needs to be called first.

Returns a StringFormat used for formatting the content of an item.

Returns true if the line is part of the current itemized block. If it is, then it is added to the internal lines list.

Returns the block as a string, with each line trimmed at the start.

Returns the block as a string under its original form.

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

Performs the conversion.

Performs the conversion.

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.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 80 bytes