pub enum Change {
Show 14 variants Attribute(AttributeChange), AllAttributes(CellAttributes), Text(String), ClearScreen(ColorAttribute), ClearToEndOfLine(ColorAttribute), ClearToEndOfScreen(ColorAttribute), CursorPosition { x: Position, y: Position, }, CursorColor(ColorAttribute), CursorShape(CursorShape), CursorVisibility(CursorVisibility), Image(Image), ScrollRegionUp { first_row: usize, region_size: usize, scroll_count: usize, }, ScrollRegionDown { first_row: usize, region_size: usize, scroll_count: usize, }, Title(String),
}
Expand description

Change describes an update operation to be applied to a Surface. Changes to the active attributes (color, style), moving the cursor and outputting text are examples of some of the values.

Variants

Attribute(AttributeChange)

Change a single attribute

AllAttributes(CellAttributes)

Change all possible attributes to the given set of values

Text(String)

Add printable text. Control characters are rendered inert by transforming them to space. CR and LF characters are interpreted by moving the cursor position. CR moves the cursor to the start of the line and LF moves the cursor down to the next line. You typically want to use both together when sending in a line break.

ClearScreen(ColorAttribute)

Clear the screen to the specified color. Implicitly clears all attributes prior to clearing the screen. Moves the cursor to the home position (top left).

ClearToEndOfLine(ColorAttribute)

Clear from the current cursor X position to the rightmost edge of the screen. The background color is set to the provided color. The cursor position remains unchanged.

ClearToEndOfScreen(ColorAttribute)

Clear from the current cursor X position to the rightmost edge of the screen on the current line. Clear all of the lines below the current cursor Y position. The background color is set ot the provided color. The cursor position remains unchanged.

CursorPosition

Fields

Move the cursor to the specified Position.

CursorColor(ColorAttribute)

Change the cursor color.

CursorShape(CursorShape)

Change the cursor shape

CursorVisibility(CursorVisibility)

Change the cursor visibility

Image(Image)

Place an image at the current cursor position. The image defines the dimensions in cells. TODO: check iterm rendering behavior when the image is larger than the width of the screen. If the image is taller than the remaining space at the bottom of the screen, the screen will scroll up. The cursor Y position is unchanged by rendering the Image. The cursor X position will be incremented by Image::width cells.

ScrollRegionUp

Fields

first_row: usize
region_size: usize
scroll_count: usize

Scroll the region_size lines starting at first_row upwards by scroll_count lines. The scroll_count lines at the top of the region are overwritten. The scroll_count lines at the bottom of the region will become blank.

After a region is scrolled, the cursor position is undefined, and the terminal’s scroll region is set to the range specified. To restore scrolling behaviour to the full terminal window, an additional Change::ScrollRegionUp { first_row: 0, region_size: height, scroll_count: 0 }, where height is the height of the terminal, should be emitted.

ScrollRegionDown

Fields

first_row: usize
region_size: usize
scroll_count: usize

Scroll the region_size lines starting at first_row downwards by scroll_count lines. The scroll_count lines at the bottom the region are overwritten. The scroll_count lines at the top of the region will become blank.

After a region is scrolled, the cursor position is undefined, and the terminal’s scroll region is set to the range specified. To restore scrolling behaviour to the full terminal window, an additional Change::ScrollRegionDown { first_row: 0, region_size: height, scroll_count: 0 }, where height is the height of the terminal, should be emitted.

Title(String)

Change the title of the window in which the surface will be rendered.

Implementations

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.

Converts to this type from the input type.

Converts this type into the (usually inferred) 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.