1#![allow(unexpected_cfgs)]
2
3use std::io;
4use std::io::Write;
5use std::time::Duration;
6
7use rand::rngs::ThreadRng;
8
9pub mod decode;
10pub mod input_buffer;
11pub mod layout;
12pub mod prompt;
13pub mod style;
14
15pub mod components;
16
17pub use layout::Size;
18
19pub struct RenderContext {
21 pub terminal_size: Size,
22 pub elapsed: Duration,
23}
24
25pub trait Component {
32 fn render<W: Write>(
33 &self,
34 writer: &mut W,
35 ctx: &RenderContext,
36 rng: &mut ThreadRng,
37 ) -> io::Result<()>;
38}