diff options
Diffstat (limited to 'schist_desktop_gui/src/gui/components/table.rs')
| -rw-r--r-- | schist_desktop_gui/src/gui/components/table.rs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/schist_desktop_gui/src/gui/components/table.rs b/schist_desktop_gui/src/gui/components/table.rs new file mode 100644 index 0000000..4c6d810 --- /dev/null +++ b/schist_desktop_gui/src/gui/components/table.rs @@ -0,0 +1,42 @@ +use std::collections::HashMap; + +mod view_table; + +#[derive(Clone, Debug, Default)] +pub struct Table<Ix> +where + Ix: Clone + std::fmt::Debug, +{ + pub cols: Vec<Column<Ix>>, + pub rows: Vec<HashMap<Ix, Value>>, +} + +#[derive(Clone, Debug)] +pub enum Value { + String(String), + Currency(i32), +} + +#[derive(Clone, Debug)] +pub struct Column<Ix> +where + Ix: Clone + std::fmt::Debug, +{ + pub index: Ix, + pub name: String, +} + +impl<Ix> Column<Ix> +where + Ix: Clone + std::fmt::Debug, +{ + pub fn new(index: Ix, name: &str) -> Self { + Self { + index, + name: name.to_string(), + } + } +} + +#[derive(Clone, Debug)] +pub enum Message {} |
