Enum text_terminal::ScrollPosition
source · pub enum ScrollPosition {
Top,
AtUnit(ScrollbackBufferPoint),
Bottom(ScrollbackBufferPoint),
}
Expand description
The position (“viewport”) that the terminal is currently scrolled to.
By default, the terminal starts at the Bottom
,
such that it will auto-scroll upon new characters being displayed.
Variants§
Top
The terminal is scrolled all the way up.
In this position, the terminal screen “viewport” is locked and will NOT auto-scroll down to show any newly-outputted lines of text.
AtUnit(ScrollbackBufferPoint)
The terminal is scrolled to a specific point, given by the
contained ScrollbackBufferPoint
that points to the Unit
that will be displayed in the upper-left hand corner of the screen viewport.
In this position, the terminal screen “viewport” is locked and will NOT auto-scroll down to show any newly-outputted lines of text.
Bottom(ScrollbackBufferPoint)
The terminal position is scrolled all the way down.
In this position, the terminal screen “viewport” is NOT locked and will auto-scroll down to show any newly-outputted lines of text.
For convenience in calculating the screen viewport,
the contained fields are the same as in the AtUnit
variant.
In this mode, the contained point must be updated whenever the screen is scrolled down by virtue of a new line being displayed at the bottom. the screen viewport is scrolled up or down.
Trait Implementations§
source§impl Clone for ScrollPosition
impl Clone for ScrollPosition
source§fn clone(&self) -> ScrollPosition
fn clone(&self) -> ScrollPosition
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScrollPosition
impl Debug for ScrollPosition
source§impl Default for ScrollPosition
impl Default for ScrollPosition
source§impl PartialEq<ScrollPosition> for ScrollPosition
impl PartialEq<ScrollPosition> for ScrollPosition
source§fn eq(&self, other: &ScrollPosition) -> bool
fn eq(&self, other: &ScrollPosition) -> bool
self
and other
values to be equal, and is used
by ==
.