Skip to main content

Tui

Struct Tui 

Source
pub struct Tui<W>
where W: Write,
{ pub terminal: Terminal<CrosstermBackend<W>>, pub area: Rect, pub config: TerminalConfig, }

Fields§

§terminal: Terminal<CrosstermBackend<W>>§area: Rect§config: TerminalConfig

Implementations§

Source§

impl<W> Tui<W>
where W: Write,

Source

pub fn new_with_writer(writer: W, config: TerminalConfig) -> Result<Self>

Source

pub fn enter(&mut self) -> Result<()>

Source

pub fn alternate_screen(&mut self) -> Result<()>

Source

pub fn enter_execute(&mut self)

Source

pub fn resize(&mut self, area: Rect)

Source

pub fn redraw(&mut self)

Source

pub fn return_execute(&mut self) -> Result<()>

Source

pub fn exit(&mut self)

Source

pub fn get_cursor_y(timeout: Duration) -> Result<u16>

Source

pub fn scroll_up(backend: &mut CrosstermBackend<W>, lines: u16) -> Result<u16>

Source

pub fn size() -> Result<(u16, u16)>

Source

pub fn full_size() -> Option<(u16, u16)>

Source

pub fn is_fullscreen(&self) -> bool

Source

pub fn set_fullscreen(&mut self)

Source§

impl Tui<Box<dyn Write + Send>>

Source

pub fn new(config: TerminalConfig) -> Result<Self>

Trait Implementations§

Source§

impl<W> Drop for Tui<W>
where W: Write,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<W> Freeze for Tui<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for Tui<W>
where W: RefUnwindSafe,

§

impl<W> Send for Tui<W>
where W: Send,

§

impl<W> Sync for Tui<W>
where W: Sync,

§

impl<W> Unpin for Tui<W>
where W: Unpin,

§

impl<W> UnsafeUnpin for Tui<W>
where W: UnsafeUnpin,

§

impl<W> UnwindSafe for Tui<W>
where W: UnwindSafe,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> MaybeExt for T

Source§

fn take_from(&mut self, maybe: Option<T>)

Merge from maybe by taking.
Source§

fn clone_from(&mut self, maybe: &Option<T>)
where T: Clone,

Merge from maybe by cloning.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> TransformExt for T

Source§

fn transform<Q>(self, transform: impl FnOnce(T) -> Q) -> Q

Source§

fn transform_if(self, condition: bool, transform: impl FnOnce(T) -> T) -> T

Example Read more
Source§

fn modify<Q>(self, modify: impl FnOnce(&mut T) -> Q) -> T

Source§

fn modify_if<Q>(self, condition: bool, modify: impl FnOnce(&mut T) -> Q) -> T

Example Read more
Source§

fn cmp_exch<'a, E>(&'a mut self, expected: E, new: T) -> bool
where &'a mut T: PartialEq<E>,

Example Read more
Source§

fn dbg(self) -> T
where T: Debug,

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.
Source§

impl<T> SSS for T
where T: Send + Sync + 'static,

Source§

impl<T> Selection for T