summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-01-14 20:51:05 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-14 20:56:22 +0100
commit6f499c36f565a9a68203767ffbf64c9b17e29f7e (patch)
tree4cb31dcb4f0917ae186f2280e76a519dd9cb8925
parent328601602712958ad5e201d239f62440a1b02401 (diff)
Add getters for MailListingData
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--Cargo.toml1
-rw-r--r--src/maillist_view.rs16
2 files changed, 16 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index b089734..8709e72 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,6 +17,7 @@ cursive_core = "0.1"
cursive_table_view.git = "https://git.sr.ht/~matthiasbeyer/cursive_table_view"
env_logger = "0.7"
flexi_logger = "*"
+getset = "0.1"
handlebars = "3"
log = "0.4"
mailparse.git = "https://git.sr.ht/~matthiasbeyer/mailparse"
diff --git a/src/maillist_view.rs b/src/maillist_view.rs
index f0b90c2..fa4fb97 100644
--- a/src/maillist_view.rs
+++ b/src/maillist_view.rs
@@ -18,6 +18,7 @@ use cursive_table_view::TableViewItem;
use chrono::naive::NaiveDateTime;
use notmuch::Message;
use notmuch::MessageOwner;
+use getset::Getters;
use crate::main_view::MainView;
use crate::mail_view::MailView;
@@ -174,14 +175,27 @@ pub enum MailListingColumn {
Subject,
}
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, Getters)]
pub struct MailListingData {
+ #[getset(get = "pub")]
mail_id: String,
+
+ #[getset(get = "pub")]
filename: PathBuf,
+
+ #[getset(get = "pub")]
tags: Vec<String>,
+
+ #[getset(get = "pub")]
date: String,
+
+ #[getset(get = "pub")]
from: String,
+
+ #[getset(get = "pub")]
to: String,
+
+ #[getset(get = "pub")]
subject: String,
}