aboutsummaryrefslogtreecommitdiffstats
path: root/src/macros.rs
Commit message (Collapse)AuthorAge
* Remove `NotmuchType` trait.C. Morgan Hamill2015-03-26
| | | | No longer necessary with the `From` and `Into` traits from std::convert.
* Rename `NotmuchEnum` trait to `NotmuchType`.C. Morgan Hamill2015-03-24
| | | | Turns out to be useful outside of just enums.
* 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.