Skip to content

Copy, deep-merge, and apply Rust attributes from one item to another

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

StrikeForceZero/meta_merge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Copy, deep-merge, and apply Rust attributes from one item to another

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages