diff options
| author | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-04-14 12:03:16 +0200 |
|---|---|---|
| committer | Dirk Van Haerenborgh <vhdirk@gmail.com> | 2018-04-14 12:03:16 +0200 |
| commit | 6f343b3105eceef728d94ec120bd3320bce27225 (patch) | |
| tree | 02da0bcec5b27be2b9eee07f81a0dff39a998710 /tests | |
| parent | 2601c34228f88b572642149a8fef64a6a3e3570c (diff) | |
| download | mail-6f343b3105eceef728d94ec120bd3320bce27225.tar.gz | |
add readme and test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/main.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/main.rs b/tests/main.rs new file mode 100644 index 0000000..a6dd022 --- /dev/null +++ b/tests/main.rs @@ -0,0 +1,20 @@ +extern crate notmuch; + +fn main() { + + let mut mail_path = std::env::home_dir().unwrap(); + mail_path.push(".mail"); + + let db = notmuch::Database::open(&mail_path.to_str().unwrap().to_string(), notmuch::DatabaseMode::ReadOnly).unwrap(); + let query = db.create_query(&"".to_string()).unwrap(); + let mut threads = query.search_threads().unwrap(); + + loop { + match threads.next() { + Some(thread) => { + println!("thread {:?} {:?}", thread.subject(), thread.authors()); + }, + None => { break } + } + } +} |
