1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! # rustom
//!
//! A library for building rich, stateful terminal user interfaces and
//! dashboards, modeled after the immediate mode widget architecture that
//! has become the standard approach for Rust TUIs: an in-memory `Buffer`
//! that widgets render into, a diff based `Terminal` that only repaints
//! what changed, and a pluggable `Backend` trait so the rendering core does
//! not care whether it is talking to `crossterm`, a test harness, or
//! anything else.
//!
//! ## Quick start
//!
//! ```no_run
//! use std::io;
//! use rustom::layout::{Constraint, Direction, Layout};
//! use rustom::style::{Color, Style};
//! use rustom::widgets::{Block, Borders, Paragraph};
//!
//! fn run() -> io::Result<()> {
//! let mut terminal = rustom::init()?;
//! terminal.draw(|frame| {
//! let chunks = Layout::default()
//! .direction(Direction::Vertical)
//! .constraints([Constraint::Length(3), Constraint::Fill(1)])
//! .split(frame.area());
//!
//! let title = Block::bordered().title("rustom");
//! frame.render_widget(title, chunks[0]);
//!
//! let body = Paragraph::new("Hello from rustom.")
//! .style(Style::new().fg(Color::Cyan))
//! .block(Block::bordered());
//! frame.render_widget(body, chunks[1]);
//! })?;
//! rustom::restore()?;
//! Ok(())
//! }
//! ```
use ;
use execute;
use ;
pub use Backend;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// The default terminal type most applications will use: a crossterm
/// backed `Terminal` writing to stdout.
pub type DefaultTerminal = ;
/// Puts the terminal into raw mode and the alternate screen, and returns a
/// ready to use `Terminal`. Pair this with [`restore`] before the process
/// exits so the user's shell is left in a sane state.
/// Reverses the effect of [`init`]: leaves the alternate screen and
/// disables raw mode. Call this before returning from `main` or on any
/// error path, otherwise the terminal will be left unusable.