Struct mortal::terminal::Cursor
[−]
[src]
pub struct Cursor { pub line: usize, pub column: usize, }
Represents the cursor position in a terminal device
Fields
line: usize
Index of line in terminal, beginning at 0
.
column: usize
Index of column in terminal, beginning at 0
.
Methods
impl Cursor
[src]
pub fn next(&self, size: Size) -> Option<Cursor>
[src]
Returns the position of the next cell within a terminal of the given size.
Returns None
if this cursor position represents the last cell.
pub fn previous(&self, size: Size) -> Option<Cursor>
[src]
Returns the position of the previous cell within a terminal of the given size.
Returns None
if this cursor position represents the first cell.
pub fn first() -> Cursor
[src]
Returns a Cursor
pointing to the first cell, i.e. (0, 0)
.
pub fn last(size: Size) -> Cursor
[src]
Returns a Cursor
pointing to the last cell of a screen of the given size.
pub fn is_out_of_bounds(&self, size: Size) -> bool
[src]
Returns whether the cursor is out of bounds of the given size.
Trait Implementations
impl Copy for Cursor
[src]
impl Clone for Cursor
[src]
fn clone(&self) -> Cursor
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Cursor
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for Cursor
[src]
impl Eq for Cursor
[src]
impl PartialEq for Cursor
[src]
fn eq(&self, __arg_0: &Cursor) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Cursor) -> bool
[src]
This method tests for !=
.