aboutsummaryrefslogtreecommitdiffstats
path: root/tests/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/main.rs')
-rw-r--r--tests/main.rs20
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 }
+ }
+ }
+}