Struct Screen

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

A Screen contains multiple windows. When initiated, a Screen only contains one window with id = 0.

Implementations§

Source§

impl Screen

Source

pub fn new() -> Screen

Create a new Screen with one window with id = 0.

Source

pub fn name_screen(name: &str) -> Screen

Create a new Screen with name

Source

pub fn set_name(&mut self, name: &str)

Set name to Screen

Source

pub fn set_window_name( &mut self, id: usize, name: &str, ) -> Result<(), ErrorKind>

Set name to window

Source

pub fn append_left_child(&mut self, id: usize) -> Result<usize, ErrorKind>

Splits window with id into a left and right window. If successfull, the left window keeps the id you passed, and the function returns Ok(id), with the id of the right window. If failed, returns Err(std::io::ErrorKind).

Source

pub fn append_down_child(&mut self, id: usize) -> Result<usize, ErrorKind>

Splits window with id into an up and down window. If successfull, the up window keeps the id you passed, and the function returns Ok(id), with the id of the down window. If failed, returns Err(std::io::ErrorKind).

Source

pub fn println(&mut self, id: usize, line: &str) -> Result<(), ErrorKind>

Print a new line in window with id. Returns () if successful, Err(std::io::ErrorKind) if not.

Source

pub fn print(&mut self, id: usize, line: &str) -> Result<(), ErrorKind>

Print line in window with id, but do not flush. Returns () if successful, Err(std::io::ErrorKind) if not.

Source

pub fn flush(&mut self, id: usize) -> Result<(), ErrorKind>

Flush window with id. Returns () if successful, Err(std::io::ErrorKind) if not.

Trait Implementations§

Source§

impl Debug for Screen

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Screen

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Screen

§

impl RefUnwindSafe for Screen

§

impl Send for Screen

§

impl Sync for Screen

§

impl Unpin for Screen

§

impl UnwindSafe for Screen

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.