natural-derive

Crates.ionatural-derive
lib.rsnatural-derive
version0.4.0
sourcesrc
created_at2022-12-23 10:29:59.474927
updated_at2023-01-25 19:22:11.867258
descriptionProc macros for naturally deriving basic trait impls for new types.
homepagehttps://github.com/hseeberger/natural-derive
repositoryhttps://github.com/hseeberger/natural-derive
max_upload_size
id744444
size29,853
Heiko Seeberger (hseeberger)

documentation

https://github.com/hseeberger/natural-derive

README

natural-derive

Proc macros for naturally deriving basic trait impls for new types, i.e. respecting the structure and semantics of the inner type.

Example

use natural_derive::Add;

#[derive(Debug, PartialEq, Eq, Add)]
struct Kelvin(u32);

fn main() {
    let kelvin = Kelvin(42) + Kelvin(1);
    assert_eq!(kelvin, Kelvin(43));
}

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.

License

This code is open source software licensed under the Apache 2.0 License.

Commit count: 11

cargo fmt