pub struct Line {
pub text: LineText,
}
Expand description
Text data and metadata for a single line of text
Note that the internal field accessed by .tag()
and .set_tag()
is shared
throughout the historical instances of the Line.
The main way to create, move around or clone Line instances is through
PubLine
. For this purpose PubLine implements From<&Line> and Line
implements From. (Creating a PubLine from a Line is basically free,
creating a Line from a PubLine includes some allocations but still cheap.)
This is to ensure that the internal pointers that Line uses internally
(sharing objects between historical states) aren’t pointing to somewhere
they shouldn’t.
The text data for a given line
LineText
ensures that the text data is valid for a single line and
implements reference counted cloning, allowing easy re-use of the same
data (through history, clipboard and even multiple identical lines
(depending on how they are created)).
Get the current value of the tag field.
Set the tag to given character
Note that this changes all historical states of this line.
Formats the value using the given formatter.
Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self
and other
values to be equal, and is used
by ==
.
This method tests for !=
. The default implementation is almost always
sufficient, and should not be overridden without very good reason.
The type returned in the event of a conversion error.
Performs the conversion.
Gets the type name of self
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns
true
if the boxed type is the same as
T
.
Read more
Forward to the method defined on the type Any
.
Forward to the method defined on the type Any
.
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
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.