• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H03-May-2022-179163

doc/H03-May-2022-849669

src/H03-May-2022-2,7602,275

tests/H03-May-2022-5,1243,924

.cargo-checksum.jsonH A D03-May-202289 11

.cargo_vcs_info.jsonH A D01-Jan-197074 65

.gitignoreH A D23-Jan-202138 54

CHANGELOG.mdH A D23-Jan-20212.7 KiB7659

CONTRIBUTING.mdH A D23-Jan-2021637 1511

Cargo.tomlH A D01-Jan-19701.2 KiB4135

Cargo.toml.orig-cargoH A D23-Jan-2021685 2722

LICENSE-APACHEH A D23-Jan-202110.6 KiB202169

LICENSE-MITH A D23-Jan-20211 KiB2016

README.mdH A D23-Jan-20211.7 KiB5638

book.tomlH A D23-Jan-2021254 1612

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