Thanks to visit codestin.com
Credit goes to lib.rs

2 releases

Uses new Rust 2024

0.1.1 Oct 14, 2025
0.1.0 Oct 14, 2025

#17 in #apply


Used in 2 crates (via meta_merge)

MIT/Apache

71KB
1.5K SLoC

Meta Merge

License Crates.io Downloads Docs CI

Example

Basic

use meta_merge::*;

#[export(copy(prepend))]
#[derive(Debug)]
struct DefaultFoo;

#[apply(CopyDefaultFoo!)]
#[derive(PartialEq)]
struct Foo;

/* becomes:
#[derive(Debug)]
#[derive(PartialEq)]
struct Foo;
*/
use meta_merge::*;
use serde::{Deserialize, Serialize};
use serde_json::json;

#[allow(dead_code)]
#[export(merge)]
#[derive(Debug, Serialize, Deserialize)]
struct DefaultFoo;

#[apply(MergeDefaultFoo!)]
#[derive(PartialEq)]
struct Foo {
    a: u32,
    b: String,
    c: bool,
}

/* becomes:
#[derive(PartialEq, Debug, Serialize, Deserialize)]
struct Foo {
    a: u32,
    b: String,
    c: bool,
}
*/

License

All code in this repository is dual-licensed under either:

at your option. This means you can select the license you prefer.

Your Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

Dependencies

~4MB
~92K SLoC