Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.github/ | H | 03-May-2022 | - | 179 | 163 | |
doc/ | H | 03-May-2022 | - | 849 | 669 | |
src/ | H | 03-May-2022 | - | 2,760 | 2,275 | |
tests/ | H | 03-May-2022 | - | 5,124 | 3,924 | |
.cargo-checksum.json | H A D | 03-May-2022 | 89 | 1 | 1 | |
.cargo_vcs_info.json | H A D | 01-Jan-1970 | 74 | 6 | 5 | |
.gitignore | H A D | 23-Jan-2021 | 38 | 5 | 4 | |
CHANGELOG.md | H A D | 23-Jan-2021 | 2.7 KiB | 76 | 59 | |
CONTRIBUTING.md | H A D | 23-Jan-2021 | 637 | 15 | 11 | |
Cargo.toml | H A D | 01-Jan-1970 | 1.2 KiB | 41 | 35 | |
Cargo.toml.orig-cargo | H A D | 23-Jan-2021 | 685 | 27 | 22 | |
LICENSE-APACHE | H A D | 23-Jan-2021 | 10.6 KiB | 202 | 169 | |
LICENSE-MIT | H A D | 23-Jan-2021 | 1 KiB | 20 | 16 | |
README.md | H A D | 23-Jan-2021 | 1.7 KiB | 56 | 38 | |
book.toml | H A D | 23-Jan-2021 | 254 | 16 | 12 |
README.md
1# Derivative 2 3[![Crates.io](https://img.shields.io/crates/v/derivative.svg?maxAge=3600)](https://crates.io/crates/derivative) 4[![Crates.io](https://img.shields.io/crates/l/derivative.svg?maxAge=3600)](https://github.com/mcarton/rust-derivative#license) 5![Continuous integration](https://github.com/mcarton/rust-derivative/workflows/Continuous%20integration/badge.svg) 6 7This crate provides a set of alternative customizable `#[derive]` attributes for Rust. 8 9## [Documentation][documentation] 10## Stability 11 12This crate is stable and follows semver. It requires *rustc 1.34 or later* and changing the minimal rustc version will be considered a semver breaking change. 13 14## What it does 15 16```rust 17#[derive(Derivative)] 18#[derivative(Debug)] 19struct Foo { 20 foo: u8, 21 #[derivative(Debug="ignore")] 22 bar: u8, 23} 24 25// Prints `Foo { foo: 42 }` 26println!("{:?}", Foo { foo: 42, bar: 1 }); 27``` 28 29Check the [documentation] for more! 30 31## License 32 33Licensed under either of 34 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or 35 <http://www.apache.org/licenses/LICENSE-2.0>) 36 * MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>) 37 38at your option. 39 40## Acknowledgements 41 42This is inspired from how [`serde`] wonderfully handles attributes. 43This also takes some code and ideas from `serde` itself. 44 45Some tests are directly adapted from `rustc`'s tests. 46 47## Contribution 48 49Unless you explicitly state otherwise, any contribution intentionally submitted 50for inclusion in the work by you, as defined in the Apache-2.0 license, shall 51be dual licensed as above, without any additional terms or conditions. 52 53[`serde`]: https://crates.io/crates/serde 54[documentation]: https://mcarton.github.io/rust-derivative/latest/index.html 55[rustc]: https://github.com/rust-lang/rust 56