aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
...
| * Disable trivial_numeric_casts lint in FFI callback.C. Morgan Hamill2015-03-26
| | | | | | | | | | We're casting from `c_double` to `f64`, which are the same thing, but I want to do it anyway to be explicit.
| * Remove `NotmuchType` trait.C. Morgan Hamill2015-03-26
| | | | | | | | No longer necessary with the `From` and `Into` traits from std::convert.
| * Make `ToCString` trait use std::convert traits.C. Morgan Hamill2015-03-26
| | | | | | | | Use `AsRef<Path>` instead of `AsOsStr`.
| * Change usage of `AsPath` to `AsRef<Path>`.C. Morgan Hamill2015-03-25
| | | | | | | | | | | | RFC 529[1] has landed. [1] https://github.com/rust-lang/rfcs/pull/529
| * Make methods borrow self mutably when appropriate.C. Morgan Hamill2015-03-24
| | | | | | | | | | | | | | | | | | Use of raw pointers and FFI functions mean that the compiler won't force us to be correct in our usage of `&self` vs. `&mut self`. These functions make changes to the notmuch database, and we want the type system to ensure we can't simultaneously manipulate the database from different functions.
| * Remove `ToStaticStr` trait.C. Morgan Hamill2015-03-24
| | | | | | | | | | Changes in commit 95d4fba8436417a6c27522ed9b51c19a9fd7c6f9 make the trait unnecessary. The `ToStr` trait is now sufficient.
| * Rename `NotmuchEnum` trait to `NotmuchType`.C. Morgan Hamill2015-03-24
| | | | | | | | Turns out to be useful outside of just enums.
| * Fix errors in FFI function signatures.C. Morgan Hamill2015-03-24
| |
| * Add `Database::upgrade()` and related methods.C. Morgan Hamill2015-03-20
| | | | | | | | | | Not so simple wrapper around notmuch API's `notmuch_database_upgrade()` function. Variants with and without a callback parameter are provided.
| * Add `Databased::needs_upgrade()` method.C. Morgan Hamill2015-03-20
| | | | | | | | | | Simple wrapper around notmuch API's `notmuch_database_needs_upgrade()` function.
| * Add `Database::version()` method.C. Morgan Hamill2015-03-20
| | | | | | | | | | Simple wrapper around notmuch API's `notmuch_database_get_version()` function.
| * Add `Database::path()' method.C. Morgan Hamill2015-03-20
| | | | | | | | | | Simple wrapper around notmuch API's `notmuch_database_get_path()` function.
| * Make `to_str()` method generic over lifetime.C. Morgan Hamill2015-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If I have this correct: The output `&str` will have the same lifetime as whatever the lifetime of the block in which it is called. This allows using it one the output of notmuch FFI calls, by propogating the lifetime of the safe wrapper object (e.g., `Database`) to the `&str` returned from `to_str()`. This mirrors the lifetime of the actual underlying C string. If I don't grok lifetimes as well as I think, this could be a lie. Future self: you should add unit tests to test the above explanation.
| * Add `Database::close()` method.C. Morgan Hamill2015-03-20
| | | | | | | | Simple wrapper around notmuch API's `notmuch_database_close()` function.
| * Implement `Drop` for `Database`.C. Morgan Hamill2015-03-20
| | | | | | | | | | Simple wrapper around notmuch API's `notmuch_database_destroy()` function.
| * Add `Database::compact()` and related methods.C. Morgan Hamill2015-03-20
| | | | | | | | | | Not so simple wrapper around notmuch API's `notmuch_database_compact()` function. Variants with and without a callback parameter are provided.
| * Add `Database::open()` method.C. Morgan Hamill2015-03-20
| | | | | | | | Simple wrapper around notmuch API's `notmuch_database_open()` function.
| * Add `Database::create()` method.C. Morgan Hamill2015-03-20
| | | | | | | | | | Simple wrapper around notmuch API's `notmuch_database_create()` function.
| * Add database module.C. Morgan Hamill2015-03-20
| | | | | | | | | | Add `database::Database`, `database::Version`, and `database::Mode` types.
| * Add `ToCString` trait.C. Morgan Hamill2015-03-20
| | | | | | | | | | | | | | | | Allows easy conversion of any `T: AsOsStr` to a `CString`, whose `as_ptr()` method is quite convenient for FFI calls. Note that `std::path::Path` implements `AsOsStr`, which means we can easily take paths and get a pointer to `*const libc::c_char`.
| * Add crate-level `Result` type to error module.C. Morgan Hamill2015-03-20
| | | | | | | | `Result<T, E>` where `E` is always the local `Error` type.
| * Add `cause()` method to `Error` type.C. Morgan Hamill2015-03-20
| | | | | | | | Returns the underlying error type, if any.
| * Add error module with crate's `Error` type.C. Morgan Hamill2015-03-20
| | | | | | | | | | | | | | | | | | Implement `Display`, `Error`, and various `FromError<T>` traits on `Error`, allowing the use of `try!` on the various `Result` types in the crate. Note that currently the only error variants are those thrown from a lower-level operation.
| * Implement `Error` for `NotmuchStatus`.C. Morgan Hamill2015-03-20
| | | | | | | | | | | | | | | | | | | | Entails implementation of `ToStr` and `Display`, also. Note that the `to_str()` method uses the `to_static_str()` method on the `ToStaticStr` trait internally --- this is how I expect to use the latter. This lets me provide a uniform `to_str()` method in the rest of the API, while transparently handling the differences between C string lifetimes.
| * Add `ToStr` and `ToStaticStr` traits.C. Morgan Hamill2015-03-20
| | | | | | | | | | | | | | | | Allow easy mapping of borrowed C strings to borrowed strings with appropriate lifetimes. I have some doubts about this, as I'm not 100% on how lifetimes interact with the notmuch-provided strings yet.
| * Add convenience methods to `notmuch_status_t`.C. Morgan Hamill2015-03-19
| | | | | | | | | | Convenience methods for working the result of many of the native notmuch functions.
| * Add `NotmuchEnum` trait and `notmuch_enum!` macro.C. Morgan Hamill2015-03-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements enum types in pairs, specifying the type and variant names of each, like so: notmuch_enum! { pub enum enum_name => EnumName { variant_one => VariantOne, variant_two => VariantTwo } } Which expands to: pub enum enum_name { variant_one, variant_two } pub enum EnumName { VariantOne, VariantTwo } The `NotmuchEnum` trait also entails two functions to convert between the defined pairs, `from_notmuch_t()` and `to_notmuch_t()`. The macro takes care of their implementation, also. Yes, this is purely aesthetic whimsy: I wanted the types in the `ffi` module to match the types from the `notmuch.h` file, and I wanted the types I used within (and exported by) this crate to match the expected Rust convention.
| * Add notmuch C API bindings.C. Morgan Hamill2015-03-17
| | | | | | | | | | The ffi module now reproduces the notmuch C API, as defined in `notmuch.h`, more-or-less verbatim.
| * Add empty ffi module.C. Morgan Hamill2015-03-17
| |
| * Add root module at src/lib.rs.C. Morgan Hamill2015-03-13
| | | | | | | | Use libc crate.
| * Add .gitignore file.C. Morgan Hamill2015-03-13
| | | | | | | | Set to ignore Cargo.lock and /target/.
| * Create empty crate.C. Morgan Hamill2015-03-13
| | | | Initial version of Cargo.toml.
* initial notmuchGustav Sörnäs2021-03-19
| | | | Prints all unread+inbox from a hard-coded notmuch database.
* initial commitGustav Sörnäs2021-03-19
Trying out crossterm.