pub struct Line { /* private fields */ }

Implementations

Create a new line using cluster storage, optimized for appending and lower memory utilization. The line will automatically switch to cell storage when necessary to apply edits.

Wrap the line so that it fits within the provided width. Returns the list of resultant line(s)

Returns true if the line’s last changed seqno is more recent than the provided seqno parameter

Annotate the line with the sequence number of a change. This can be used together with Line::changed_since to manage caching and rendering

Check whether the reverse video bit is set. If it is set, then the line should be displayed with foreground/background colors reversed.

Force the reverse bit set. This also implicitly sets dirty.

Check whether the line is single-width.

Force single-width. This also implicitly sets double-height-(top/bottom) and dirty.

Check whether the line is double-width and not double-height.

Force double-width. This also implicitly sets double-height-(top/bottom) and dirty.

Check whether the line is double-height-top.

Force double-height top-half. This also implicitly sets double-width and dirty.

Check whether the line is double-height-bottom.

Force double-height bottom-half. This also implicitly sets double-width and dirty.

Set a flag the indicate whether the line should have the bidi algorithm applied during rendering

Set the bidi direction for the line. This affects both the bidi algorithm (if enabled via set_bidi_enabled) and the layout direction of the line. auto_detect specifies whether the direction should be auto-detected before falling back to the specified direction.

Returns a tuple of (BIDI_ENABLED, Direction), indicating whether the line should have the bidi algorithm applied and its base direction, respectively.

If we have any cells with an implicit hyperlink, remove the hyperlink from the cell attributes but leave the remainder of the attributes alone.

Scan through the line and look for sequences that match the provided rules. Matching sequences are considered to be implicit hyperlinks and will have a hyperlink attribute associated with them. This function will only make changes if the line has been invalidated since the last time this function was called. This function does not remember the values of the rules slice, so it is the responsibility of the caller to call invalidate_implicit_hyperlinks if it wishes to call this function with different rules.

Returns true if the line contains a hyperlink

Recompose line into the corresponding utf8 string.

Returns a substring from the line.

If we’re about to modify a cell obscured by a double-width character ahead of that cell, we need to nerf that sequence of cells to avoid partial rendering concerns. Similarly, when we assign a cell, we need to blank out those occluded successor cells.

Assign a cell using grapheme text with a known width and attributes. This is a micro-optimization over first constructing a Cell from the grapheme info. If assigning this particular cell can be optimized to an append to the interal clustered storage then the cost of constructing and dropping the Cell can be avoided.

Place text starting at the specified column index. Each grapheme of the text run has the same attributes.

Iterates the visible cells, respecting the width of the cell. For instance, a double-width cell overlaps the following (blank) cell, so that blank cell is omitted from the iterator results. The iterator yields (column_index, Cell). Column index is the index into Self::cells, and due to the possibility of skipping the characters that follow wide characters, the column index may skip some positions. It is returned as a convenience to the consumer as using .enumerate() on this iterator wouldn’t be as useful.

Adjusts the internal storage so that it occupies less space. Subsequent mutations will incur some overhead to re-materialize the storage in a form that is suitable for mutation.

Return true if the line consists solely of whitespace cells

Return true if the last cell in the line has the wrapped attribute, indicating that the following line is logically a part of this one.

Adjust the value of the wrapped attribute on the last cell of this line.

Concatenate the cells from other with this line, appending them to this line. This function is used by rewrapping logic when joining wrapped lines back together.

mutable access the cell data, but the caller must take care to only mutate attributes rather than the cell textual content. Use set_cell if you need to modify the textual content of the cell, so that important invariants are upheld.

Given a starting attribute value, produce a series of Change entries to recreate the current line

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. 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.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.