Struct kas_text::Text[][src]

pub struct Text<T: FormattableText> { /* fields omitted */ }
Expand description

Text, prepared for display in a given enviroment

This struct is composed of three parts: an Environment, a representation of the FormattableText being displayed, and a TextDisplay object.

Most Functionality is implemented via the TextApi and TextApiExt traits.

Implementations

Construct from an environment and a text model

This struct must be made ready for usage by calling Text::prepare.

Construct from a default environment (single-line) and text

The environment is default-constructed, with line-wrapping turned off (see Environment::flags doc).

Construct from a default environment (multi-line) and text

The environment is default-constructed (line-wrap on).

Clone the formatted text

Extract text object, discarding the rest

Access the formattable text object

Set the text

One must call Text::prepare afterwards and may wish to inspect its return value to check the size allocation meets requirements.

Trait Implementations

Performs the conversion.

Performs the conversion.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Insert a char at the given position Read more

Replace a section of text Read more

Set text to a raw String Read more

Swap the raw text with a String Read more

Read the TextDisplay

Access whole text as contiguous str Read more

Clone the unformatted text as a String

Read the environment

Mutate the environment Read more

Require an action Read more

Prepare text for display Read more

Prepare text runs Read more

Update font size Read more

Prepare lines (“wrap”) Read more

Get the sequence of effect tokens Read more

Length of text 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

Cast from Self to T

Try converting from Self to T

Cast to integer, truncating Read more

Cast to the nearest integer Read more

Cast the floor to an integer Read more

Cast the ceiling to an integer Read more

Try converting to integer with truncation Read more

Try converting to the nearest integer Read more

Try converting the floor to an integer Read more

Try convert the ceiling to an integer Read more

Convert from T to Self

Try converting from T to Self

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.