Crates.io | notmuch |
lib.rs | notmuch |
version | 0.8.0 |
source | src |
created_at | 2018-03-21 08:36:58.422583 |
updated_at | 2022-06-06 17:42:06.249724 |
description | Rust interface and bindings for notmuch |
homepage | https://github.com/vhdirk/notmuch-rs |
repository | https://github.com/vhdirk/notmuch-rs |
max_upload_size | |
id | 56673 |
size | 217,373 |
This is not much more than a wrapper for the notmuch C api.
notmuch-rs expects libnotmuch development files to be installed on your system.
Add this to your Cargo.toml
:
[dependencies]
notmuch = "*"
and this to your crate root:
extern crate notmuch;
extern crate notmuch;
fn main() {
let mut mail_path = std::env::home_dir().unwrap();
mail_path.push(".mail");
let mut config_path = std::env::home_dir().unwrap();
config_path.push(".config/custom-notmuch-config-path");
let db = notmuch::Database::open_with_config(
&mail_path,
notmuch::DatabaseMode::ReadOnly,
&config_path,
None,
)
.unwrap();
let query = db.create_query("").unwrap();
let mut threads = query.search_threads().unwrap();
for thread in threads {
println!("thread {:?} {:?}", thread.subject(), thread.authors());
}
}
Notmuch makes no claims regarding thread safety. It does not seem to use any
thread locals, but I did not spot any locks. So, as far as I am concerned, it is
not thread safe. Hence, all pointers are internally tracked with Rc
s.
notmuch-rs started out from the following projects:
Any contributions are welcome!