pub mod barchart;
pub mod block;
pub mod calendar;
pub mod cancellable_loader;
pub mod canvas;
pub mod chart;
pub mod editor;
pub mod gauge;
pub mod image;
pub mod input;
pub mod line_gauge;
pub mod list;
pub mod loader;
pub mod markdown;
pub mod paragraph;
pub mod scrollbar;
pub mod select_list;
pub mod settings_list;
pub mod sparkline;
pub mod table;
pub mod tabs;
use crate::core::buffer::Buffer;
use crate::core::rect::Rect;
pub trait Widget {
fn render(self, area: Rect, buf: &mut Buffer);
}
pub trait StatefulWidget {
type State;
fn render(self, area: Rect, buf: &mut Buffer, state: &mut Self::State);
}
impl Widget for &str {
fn render(self, area: Rect, buf: &mut Buffer) {
buf.set_string(area.x, area.y, self, crate::core::style::Style::default());
}
}
impl Widget for String {
fn render(self, area: Rect, buf: &mut Buffer) {
buf.set_string(area.x, area.y, &self, crate::core::style::Style::default());
}
}