27 releases

Uses old Rust 2015

0.8.0 Jun 6, 2022
0.7.1 Dec 17, 2021
0.7.0 Oct 26, 2021
0.6.0 Nov 16, 2019
0.0.9 Mar 27, 2018

#951 in Database interfaces

Download history 245/week @ 2023-11-30 68/week @ 2023-12-07 97/week @ 2023-12-14 68/week @ 2023-12-21 126/week @ 2023-12-28 132/week @ 2024-01-04 219/week @ 2024-01-11 277/week @ 2024-01-18 264/week @ 2024-01-25 279/week @ 2024-02-01 311/week @ 2024-02-08 316/week @ 2024-02-15 460/week @ 2024-02-22 298/week @ 2024-02-29 308/week @ 2024-03-07 248/week @ 2024-03-14

1,366 downloads per month
Used in 9 crates (7 directly)

GPL-3.0+

145KB
2K 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 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());
    }
}

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

~1.5MB
~40K SLoC