Skip to main content

Tui

Struct Tui 

Source
pub struct Tui<E> { /* private fields */ }

Implementations§

Source§

impl<E: Send + 'static> Tui<E>

Source

pub fn draw(&mut self, frame: &mut Frame<'_>)

Source§

impl<E: Send + 'static> Tui<E>

Source

pub fn frame(&mut self, width: u16, height: u16) -> Buffer

Source

pub fn shot( &mut self, width: u16, height: u16, keys: &[KeyEvent], settle: bool, ) -> Buffer

Source

pub fn bench(&mut self, width: u16, height: u16, frames: usize) -> Vec<Bench>

Source§

impl<E: Send + 'static> Tui<E>

Source

pub fn new( name: impl Into<Cow<'static, str>>, version: impl Into<Cow<'static, str>>, accent: Color, ) -> Self

Source

pub fn palette(self, palette: Palette) -> Self

Source

pub fn words(self, words: Words) -> Self

Source

pub fn hints(self, hints: impl IntoIterator<Item = Hint<'static>>) -> Self

Source

pub fn min_size(self, width: u16, height: u16) -> Self

Source

pub fn title(self, text: impl Into<Cow<'static, str>>) -> Self

Source

pub fn title_spans<T: Into<Cow<'static, str>>>( self, spans: impl IntoIterator<Item = (T, Style)>, ) -> Self

Source

pub fn layout(self, layout: Layout) -> Self

Source

pub fn head(self, head: Head) -> Self

Source

pub fn role(self, name: impl Into<Cow<'static, str>>, style: Style) -> Self

Source

pub fn monochrome(self, mono: bool) -> Self

Source

pub fn group(self, label: impl Into<Label>) -> Self

Source

pub fn group_keys(self, keys: &'static [Key]) -> Self

Source

pub fn screen(self, label: impl Into<Label>, screen: impl Screen<E>) -> Self

Source

pub fn show(self, shown: impl Fn(Item) -> bool) -> Self

Source

pub fn overlay( self, section: Section, keys: &'static [Key], screen: impl Screen<E>, ) -> Self

Source

pub fn app(self, screen: impl Screen<E>) -> Self

Source

pub fn gate(self, screen: impl Screen<E>, shut: bool) -> Self

Source

pub fn activities(self, words: Activities) -> Self

Source

pub fn band(self, band: impl Band + 'static) -> Self

Source

pub fn top_band(self, band: impl Band + 'static) -> Self

Source

pub fn nav_keys(self, keys: NavKeys) -> Self

Source

pub fn focus_keys(self, next: &'static [Key], previous: &'static [Key]) -> Self

Source

pub fn help(self, help: Option<Help>) -> Self

Source

pub fn quit(self, mode: Mode) -> Self

Source

pub fn quit_window(self, window: Duration) -> Self

Source

pub fn quit_keys(self, keys: &'static [Key]) -> Self

Source

pub fn quit_sticky(self, sticky: bool) -> Self

Source

pub fn quit_tone(self, tone: Said) -> Self

Source

pub fn quit_hints(self, shown: bool) -> Self

Source

pub fn stop_keys(self, keys: &'static [Key]) -> Self

Source

pub fn through_keys(self, keys: &'static [Key]) -> Self

Source

pub fn eager(self, eager: bool) -> Self

Source

pub fn keep_facts(self, keep: bool) -> Self

Source

pub fn lit_again(self, lit: bool) -> Self

Source

pub fn hourglass_timing(self, delay: Duration, least: Duration) -> Self

Source

pub fn version_fit(self, fit: bool) -> Self

Source

pub fn modes(self, modes: Modes) -> Self

Source

pub fn header_look(self, look: HeaderLook) -> Self

Source

pub fn footer_look(self, look: FooterLook) -> Self

Source

pub fn on_key( self, hook: impl FnMut(KeyEvent, &mut Cx<'_, E>) -> bool + 'static, ) -> Self

Source

pub fn after_draw(self, hook: impl FnMut(Duration) + 'static) -> Self

Source

pub fn set_palette(&mut self, palette: Palette)

Source

pub fn set_words(&mut self, words: Words)

Source

pub fn set_layout(&mut self, layout: Layout)

Source

pub fn current_palette(&self) -> &Palette

Source

pub fn current(&self) -> Option<usize>

Source

pub fn names(&self) -> Vec<&str>

Source

pub fn find<T: Screen<E>>(&self) -> Option<&T>

Source

pub fn find_mut<T: Screen<E>>(&mut self) -> Option<&mut T>

Source

pub fn sender(&self) -> Sender<Wake<E>>

Source

pub fn waker(&self, screen: usize) -> Waker<E>

Source

pub fn go(&mut self, screen: usize) -> bool

Source

pub fn changed(&mut self, source: &str)

Source

pub fn start(&mut self)

Source

pub fn busy(&self) -> usize

Source

pub fn key(&mut self, key: KeyEvent) -> Flow

Source

pub fn paste(&mut self, text: &str)

Source

pub fn mouse(&mut self, mouse: MouseEvent)

Source

pub fn event(&mut self, screen: usize, event: E)

Source

pub fn loaded(&mut self, screen: usize, generation: u64, event: E) -> bool

Source

pub fn handle(&mut self, wake: Wake<E>) -> Flow

Source

pub fn pump(&mut self)

Source

pub fn settle(&mut self)

Source

pub fn advance(&mut self, by: Duration) -> Flow

Source

pub fn run(self) -> Result<()>

Source

pub fn run_in(&mut self, term: &mut Term) -> Result<()>

Auto Trait Implementations§

§

impl<E> !RefUnwindSafe for Tui<E>

§

impl<E> !Send for Tui<E>

§

impl<E> !Sync for Tui<E>

§

impl<E> !UnwindSafe for Tui<E>

§

impl<E> Freeze for Tui<E>

§

impl<E> Unpin for Tui<E>

§

impl<E> UnsafeUnpin for Tui<E>

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.