diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-19 16:13:03 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-03-19 16:13:03 +0100 |
| commit | 51fa75397dda2c280f29760e7b525caefc03642e (patch) | |
| tree | 56d6daed24929c51f01aa5757274fd7db38aa224 /src/main.rs | |
| parent | 5efd97fbdce0cf7de71a6bf8d56ad5a5fd3225ad (diff) | |
| download | mail-51fa75397dda2c280f29760e7b525caefc03642e.tar.gz | |
initial notmuch
Prints all unread+inbox from a hard-coded notmuch database.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs index 7c12a7c..1b30c67 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,9 @@ -use std::io::{Write, stdout}; -use crossterm::{cursor, execute, terminal}; - fn main() { - let mut stdout = stdout(); + let db = notmuch::Database::open(&"/home/gustav/.mail", notmuch::DatabaseMode::ReadOnly).unwrap(); + let query = db.create_query("tag:inbox and tag:unread").unwrap(); + let threads = query.search_threads().unwrap(); - execute!(stdout, terminal::Clear(terminal::ClearType::All)).unwrap(); - execute!(stdout, cursor::MoveTo(5, 5)).unwrap(); - write!(stdout, "wowee").unwrap(); - execute!(stdout, cursor::MoveTo(5, 7)).unwrap(); - write!(stdout, "eewow").unwrap(); - execute!(stdout, cursor::MoveTo(5, 7)).unwrap(); - write!(stdout, "WOWEE").unwrap(); + for thread in threads { + println!("thread {:?}, {:?}", thread.subject(), thread.authors()); + } } |
