context-mapper 0.1.1

Single rust macro for generating different maps
Documentation
  • Coverage
  • 12.5%
    1 out of 8 items documented1 out of 7 items with examples
  • Size
  • Source code size: 9.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.42 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Dzordzu

Context Mapper

Single rust macro for generating different maps

Links

Example

#[derive(ContextMapper)]
#[context_mapper(
    impl(
        context = info::general
        converter = MyConv::to_info,
        type = info::Info,
        fn = general_info
        vis = pub(crate)
    ),
    function(
        context = info::all
        converter = MyConv::to_info,
        type = info::Info,
        fn = all_info
    ),

)]
struct Person {
    name: String,
    address: info::Address,
    age: usize,

    /// Let's hide it for the geneal info, but show for the rest
    #[context_attribute(context(name=info::general, skip))]
    is_a_reptile: bool
}

//
let person = Person {
    //};

person.general_info();
all_info(&person);