Plane

Struct Plane 

Source
pub struct Plane { /* private fields */ }
Expand description

Edited text with cursor.

Implementations§

Source§

impl Plane

Source

pub fn new<T: ToString>(content: T) -> Self

Creates a new text plane populated with the specified content.

Source

pub fn content(&self) -> &[Row]

Returns a reference to the content of the text plane.

Source

pub fn region(&mut self) -> &Region

Returns the region of the content.

Source

pub fn cursor(&self) -> &Cursor

Source

pub fn cursor_pos(&self) -> (usize, usize)

Returns the position of the cursor in text coordinates.

Cursor position is a tuple (column, row).

Source

pub fn cursor_col(&self) -> usize

Source

pub fn cursor_char(&self) -> Option<&Char>

Returns the character pointed by the cursor.

Source

pub fn cursor_char_above(&self) -> Option<&Char>

Returns the character above the cursor.

Source

pub fn cursor_move_up(&mut self) -> bool

Moves the cursor up in the same column.

Source

pub fn cursor_move_down(&mut self) -> bool

Moves the cursor down in the same column.

Source

pub fn cursor_move_left(&mut self) -> bool

Moves the cursor to the left in the same row.

Source

pub fn cursor_move_right(&mut self) -> bool

Moves the cursor to the right in the same row.

Source

pub fn cursor_move_cell_start(&mut self) -> bool

Places the cursor at the first character of the current cell in the same row.

Source

pub fn cursor_move_cell_end(&mut self) -> bool

Places the cursor at the last character of the cell in the same row.

Source

pub fn cursor_move_cell_top(&mut self) -> bool

Source

pub fn cursor_move_cell_bottom(&mut self) -> bool

Source

pub fn cursor_move_row_start(&mut self) -> bool

Places the cursor at the first character of the first cell in the same row.

Source

pub fn cursor_move_row_end(&mut self) -> bool

Places the cursor at the last character of the last cell in the same row.

Source

pub fn cursor_move_col_start(&mut self)

Places the cursor at the character of the first row in the same column.

Source

pub fn cursor_move_col_end(&mut self)

Places the cursor at the character of the last row in the same column.

Source

pub fn cursor_move_cell_next(&mut self) -> bool

Places the cursor at the first character of the next cell in the same row.

Source

pub fn cursor_move_cell_prev(&mut self) -> bool

Places the cursor at the last character of the previous cell in the same row.

Source

pub fn cursor_toggle_caret_block(&mut self)

Source

pub fn cursor_toggle_caret_under_score(&mut self)

Source

pub fn insert_char(&mut self, ch: char) -> bool

Source

pub fn override_char(&mut self, ch: char) -> bool

Source

pub fn delete_char_before_cursor(&mut self) -> bool

Source

pub fn delete_char_under_cursor(&mut self) -> bool

Source

pub fn split_line(&mut self) -> bool

Splits line at cursor position.

Source

pub fn unsplit_line(&mut self) -> bool

Unsplits (joins) the current line with the line in a row above.

Source

pub fn is_invalidated_content_region(&self) -> bool

Auto Trait Implementations§

§

impl Freeze for Plane

§

impl !RefUnwindSafe for Plane

§

impl Send for Plane

§

impl !Sync for Plane

§

impl Unpin for Plane

§

impl UnwindSafe for Plane

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.