pub struct Tui<'a, B: Backend> {
pub sender: Sender<Event>,
/* private fields */
}Fields§
§sender: Sender<Event>Implementations§
Source§impl<B: Backend> Tui<'_, B>
impl<B: Backend> Tui<'_, B>
pub fn new(terminal: Terminal<B>) -> Self
pub fn run_loop(&mut self, app: &mut App) -> Result<()>
Sourcepub fn init(&mut self) -> Result<()>
pub fn init(&mut self) -> Result<()>
Initializes the TUI.
get ready for TUI, enable the raw mode and set terminal props.
pub fn term(&mut self) -> Result<()>
pub fn is_running(&self) -> bool
Sourcepub fn exit(&mut self) -> Result<()>
pub fn exit(&mut self) -> Result<()>
Exits the TUI.
cleanup for TUI, disable the raw mode and set terminal props.
pub fn set_search_text(&mut self, text: &str)
pub fn handle_refresh_event(&mut self, _app: &mut App) -> Result<()>
pub fn handle_mouse_events( &mut self, mouse_event: MouseEvent, app: &mut App, ) -> Result<()>
pub fn handle_key_events( &mut self, key_event: KeyEvent, app: &mut App, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<'a, B> !Freeze for Tui<'a, B>
impl<'a, B> RefUnwindSafe for Tui<'a, B>where
B: RefUnwindSafe,
impl<'a, B> Send for Tui<'a, B>where
B: Send,
impl<'a, B> !Sync for Tui<'a, B>
impl<'a, B> Unpin for Tui<'a, B>where
B: Unpin,
impl<'a, B> UnwindSafe for Tui<'a, B>where
B: UnwindSafe,
Blanket Implementations§
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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