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
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
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
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
sourceimpl<'de> Deserialize<'de> for Change
impl<'de> Deserialize<'de> for Change
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<AttributeChange> for Change
impl From<AttributeChange> for Change
sourcefn from(c: AttributeChange) -> Self
fn from(c: AttributeChange) -> Self
Converts to this type from the input type.
sourceimpl Into<Change> for OutputElement
impl Into<Change> for OutputElement
impl Eq for Change
impl StructuralEq for Change
impl StructuralPartialEq for Change
Auto Trait Implementations
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more