pub struct Tui<B: Backend> {
pub events: EventHandler,
pub paused: bool,
/* private fields */
}
Expand description
Text-based user interface.
Tui
is responsible for setting up the terminal
and initializing the interface. Terminal event
handler can be accessed via events
field.
Fields§
§events: EventHandler
Terminal event handler.
paused: bool
Is the interface paused?
Implementations§
source§impl<B: Backend> Tui<B>
impl<B: Backend> Tui<B>
sourcepub fn new(terminal: Terminal<B>, events: EventHandler) -> Self
pub fn new(terminal: Terminal<B>, events: EventHandler) -> Self
Constructs a new instance of Tui
.
sourcepub fn init(&mut self) -> Result<()>
pub fn init(&mut self) -> Result<()>
Initializes the terminal interface.
It enables the raw mode and sets terminal properties.
sourcepub fn toggle_pause(&mut self) -> Result<()>
pub fn toggle_pause(&mut self) -> Result<()>
Toggles the paused
state of interface.
It disables the key input and exits the terminal interface on pause (and vice-versa).
sourcepub fn enable_mouse_capture(&mut self) -> Result<()>
pub fn enable_mouse_capture(&mut self) -> Result<()>
Enables the mouse capture.
sourcepub fn disable_mouse_capture(&mut self) -> Result<()>
pub fn disable_mouse_capture(&mut self) -> Result<()>
Disables the mouse capture.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Tui<B>where
B: Freeze,
impl<B> !RefUnwindSafe for Tui<B>
impl<B> Send for Tui<B>where
B: Send,
impl<B> !Sync for Tui<B>
impl<B> Unpin for Tui<B>where
B: Unpin,
impl<B> !UnwindSafe for Tui<B>
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.