20 releases

0.2.18 Jul 18, 2022
0.2.17 Jul 17, 2022
0.2.13 Jun 13, 2022
0.2.12 May 26, 2022
0.1.0 Jan 10, 2022

#900 in Development tools

Download history 267/week @ 2022-10-18 614/week @ 2022-10-25 444/week @ 2022-11-01 462/week @ 2022-11-08 582/week @ 2022-11-15 139/week @ 2022-11-22 99/week @ 2022-11-29 262/week @ 2022-12-06 147/week @ 2022-12-13 833/week @ 2022-12-20 494/week @ 2022-12-27 202/week @ 2023-01-03 483/week @ 2023-01-10 479/week @ 2023-01-17 948/week @ 2023-01-24 303/week @ 2023-01-31

2,377 downloads per month
Used in 58 crates (5 directly)

MIT license

4MB
109K SLoC

Module :: meta_tools

experimental rust-status docs.rs Open in Gitpod discord

Collection of general purpose meta tools.

Sample :: variadic constructor of collections

Among other useful meta tools the module aggregates variadtic constructors of collections. For example macro hmap! for constructing a hash map.

use meta_tools::*;

let meta_map = hmap! { 3 => 13 };
let mut std_map = std::collections::HashMap::new();
std_map.insert( 3, 13 );
assert_eq!( meta_map, std_map );

Sample :: function-style call

Apply a macro for each element of a list.

Macro for_each may be called either in function-style way or in map-style way. Pass name of macro to apply to elements as the first arguments and elements after the macro name. Use comma as delimiter.

use meta_tools::*;
for_each!( dbg, "a", "b", "c" );

// generates
dbg!( "a" );
dbg!( "b" );
dbg!( "c" );

To add to your project

cargo add meta_tools

Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/meta_tools_trivial
cargo run

Dependencies

~7MB
~188K SLoC