Struct Terminal

Source
pub struct Terminal<B>
where B: Backend,
{ pub backend: B, /* private fields */ }

Fields§

§backend: B

Implementations§

Source§

impl<B> Terminal<B>
where B: Backend,

Source

pub fn new(backend: B) -> Result<Terminal<B>>

Source

pub fn current_buffer_mut(&mut self) -> &mut Buffer

Source

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

Source

pub fn resize(&mut self, area: Rect) -> Result<()>

Source

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

Source

pub fn pre_render(&mut self) -> Result<Rect>

Get ready for rendering and return the maximum display size as Rect

Source

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

Source

pub fn render<C>( &mut self, component: &mut C, props: impl Borrow<C::Props>, ) -> Result<()>

Source

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

Source

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

Source

pub fn get_cursor(&mut self) -> Result<(u16, u16)>

Source

pub fn set_cursor(&mut self, x: u16, y: u16) -> Result<()>

Source

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

Source

pub fn size(&self) -> Result<Rect>

Trait Implementations§

Source§

impl<B> Debug for Terminal<B>
where B: Backend + Debug,

Source§

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

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

impl<B> Drop for Terminal<B>
where B: Backend,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<B> Freeze for Terminal<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for Terminal<B>
where B: RefUnwindSafe,

§

impl<B> Send for Terminal<B>
where B: Send,

§

impl<B> Sync for Terminal<B>
where B: Sync,

§

impl<B> Unpin for Terminal<B>
where B: Unpin,

§

impl<B> UnwindSafe for Terminal<B>
where B: 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, 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.