| Commit message (Collapse) | Author | Age |
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This reverts commit b5b0f7e97abe0dbd5b54a1fc69e764a124c271b2.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
usable (#6)
* Removing unnecessary lifetimes and borrows
* Add Message::{date,add_tag,remove_tag,remove_all_tags}
* Make sure clippy doesn't error out
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Most of this is plain copied from
https://github.com/Stebalien/notmuch-sys.
At some point, I would like to split this up again, but not right now.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Remove the 'Notmuch' prefix, as it pollutes the generated documentation.
It's rendundant, anyhow.
|
| |
|
|
| |
No longer necessary with the `From` and `Into` traits from std::convert.
|
| |
|
|
|
| |
Changes in commit 95d4fba8436417a6c27522ed9b51c19a9fd7c6f9
make the trait unnecessary. The `ToStr` trait is now sufficient.
|
| |
|
|
| |
Turns out to be useful outside of just enums.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Convenience methods for working the result of many of the native notmuch
functions.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
The ffi module now reproduces the notmuch C API, as defined in
`notmuch.h`, more-or-less verbatim.
|
| |
|