#email #notmuch

notmuch

Rust interface and bindings for notmuch

25 releases

Uses old Rust 2015

0.7.1 Dec 17, 2021
0.7.0 Oct 26, 2021
0.6.0 Nov 16, 2019
0.5.0 Dec 23, 2018
0.0.9 Mar 27, 2018

#8 in Email

Download history 20/week @ 2021-10-07 46/week @ 2021-10-14 64/week @ 2021-10-21 21/week @ 2021-10-28 214/week @ 2021-11-04 138/week @ 2021-11-11 105/week @ 2021-11-18 32/week @ 2021-11-25 95/week @ 2021-12-02 126/week @ 2021-12-09 429/week @ 2021-12-16 489/week @ 2021-12-23 383/week @ 2021-12-30 123/week @ 2022-01-06 351/week @ 2022-01-13 134/week @ 2022-01-20

1,060 downloads per month
Used in 4 crates (3 directly)

GPL-3.0+

120KB
1.5K SLoC

notmuch-rs

This is not much more than a wrapper for the notmuch C api.

Build Status Crate version Download statistics License Join the chat at https://gitter.im/notmuch-rs/Lobby

Building

notmuch-rs expects libnotmuch development files to be installed on your system.

Using

Add this to your Cargo.toml:

[dependencies]
notmuch = "*"

and this to your crate root:

extern crate notmuch;

Example

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, notmuch::DatabaseMode::ReadOnly).unwrap();
    let query = db.create_query("").unwrap();
    let mut threads = query.search_threads().unwrap();

    for thread in threads {
        println!("thread {:?} {:?}", thread.subject(), thread.authors());
    }
}

Concurrency

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 Rcs.

Acknowledgements

notmuch-rs started out from the following projects:

Any contributions are welcome!

Dependencies

~0.6–1MB
~24K SLoC