Window

Struct Window 

Source
pub struct Window {
    pub mode: Mode,
    pub dimensions: Position,
    /* private fields */
}

Fields§

§mode: Mode§dimensions: Position

Size Of Window

Implementations§

Source§

impl Window

Source

pub fn new(width: u16, height: u16, buffer: Rc<RefCell<Buffer>>) -> Self

Source

pub fn with_position(self, pos: Position) -> Self

Source

pub fn with_line_numbers(self, line_number_type: LineNumbers) -> Self

Source

pub fn with_status_bar(self, state: bool) -> Self

Source

pub fn set_buffer(&mut self, buffer: Rc<RefCell<Buffer>>)

Source

pub fn set_number(&mut self, number_type: LineNumbers)

Source

pub fn buffer(&self) -> Ref<'_, Buffer>

Source

pub fn buffer_mut(&mut self) -> RefMut<'_, Buffer>

Source

pub fn dimensions(&self) -> Position

Source

pub fn position(&self) -> Position

Source

pub fn offset(&self) -> Position

Source

pub fn set_cursor(&mut self, pos: Position)

Source

pub fn height(&self) -> usize

Source

pub fn width(&self) -> usize

Source

pub fn text_width(&self) -> usize

Source

pub fn cursor_file(&self) -> Position

Source

pub fn cursor_screen(&self) -> Position

Source

pub fn scroll_down(&mut self, lines: usize)

Source

pub fn scroll_up(&mut self, lines: usize)

Source

pub fn move_cursor_down(&mut self, lines: usize)

Source

pub fn move_cursor_up(&mut self, lines: usize)

Source

pub fn adjust_cursor_x(&mut self)

Source

pub fn move_cursor_left(&mut self, cols: usize)

Source

pub fn scroll_left(&mut self, cols: usize)

Source

pub fn move_forward_by_word(&mut self)

Source

pub fn move_backward_by_word(&mut self)

Source

pub fn move_cursor_right(&mut self, cols: usize)

Source

pub fn scroll_right(&mut self, cols: usize)

Source

pub fn insert_newline(&mut self)

Source

pub fn first_char_in_line(&mut self)

Source

pub fn jump_to_first_line_buffer(&mut self)

Source

pub fn jump_to_last_line_buffer(&mut self)

Source

pub fn backspace(&mut self)

Source

pub fn delete(&mut self)

Source

pub fn insert_char(&mut self, c: char)

Source

pub fn delete_line(&mut self)

Source

pub fn home(&mut self)

Source

pub fn end(&mut self)

Source

pub fn save(&self)

Source

pub fn get_status_bar(&self) -> Option<((u16, u16), String)>

Source

pub fn get_line_number(&self) -> Option<((u16, u16), String)>

Source

pub fn get_text_feild(&self) -> Option<((u16, u16), String)>

Trait Implementations§

Source§

impl Debug for Window

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Window

§

impl !RefUnwindSafe for Window

§

impl !Send for Window

§

impl !Sync for Window

§

impl Unpin for Window

§

impl !UnwindSafe for Window

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.