pub struct TextLines { /* private fields */ }

Implementations

Creates a new TextLines with the specified text and default indent width of 4.

Creates a new TextLines with the specified text and indent width. The indent width sets the width of a tab character when getting the display column.

Gets the number of lines in the text.

Gets the text length in bytes.

Gets the line index from a byte index. Note that if you provide the middle byte index of a \r\n newline then it will return the index of the line the preceding line.

Gets the line start byte index.

Gets the line end byte index (before/at the newline character).

Gets the line range.

Gets the byte position from the provided line and column index.

Gets the line and column index of the provided byte index.

Gets the line and column display based on the indentation width and the provided byte index.

Gets the line and column display based on the provided byte index and indentation width.

Trait Implementations

Formats the value using the given formatter. Read more

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more