blob: 8c68ca336d80c7f237baa5d7f3108adcc2d27a7f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
extern crate notmuch;
fn main() {
let mut mail_path = std::env::home_dir().unwrap();
mail_path.push(".mail");
match notmuch::Database::open(&mail_path.to_str().unwrap().to_string(), notmuch::DatabaseMode::ReadOnly){
Ok(db) => {
#[cfg(feature = "v0_21")]
{
let rev = db.revision();
println!("db revision: {:?}", rev);
}
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 }
}
}
},
Err(err) =>{
println!("Got error while trying to open db: {:?}", err);
}
}
}
|