17 releases

0.1.17 Jul 18, 2022
0.1.16 Jul 17, 2022
0.1.7 Jun 29, 2022
0.1.4 May 31, 2022
0.1.0 Jan 15, 2022

#36 in #general-purpose

Download history 67/week @ 2025-12-28 87/week @ 2026-01-04 34/week @ 2026-01-11 232/week @ 2026-01-18 193/week @ 2026-01-25 198/week @ 2026-02-01 155/week @ 2026-02-08 186/week @ 2026-02-15 323/week @ 2026-02-22 209/week @ 2026-03-01 135/week @ 2026-03-08 199/week @ 2026-03-15 70/week @ 2026-03-22 76/week @ 2026-03-29 72/week @ 2026-04-05 105/week @ 2026-04-12

405 downloads per month
Used in 31 crates (3 directly)

MIT license

1MB
29K SLoC

Module :: proc_macro_tools

experimental rust-status docs.rs Open in Gitpod discord

Tools for writing procedural macroses.

Sample

#[ cfg( feature = "use_std" ) ]
{
  use proc_macro_tools::*;

  let code = qt!( core::option::Option< i8, i16, i32, i64 > );
  let tree_type = syn::parse2::< syn::Type >( code ).unwrap();
  let got = type_parameters( &tree_type, 0..=2 );
  got.iter().for_each( | e | println!( "{}", qt!( #e ) ) );
  /* print :
    i8
    i16
    i32
  */
}

To add to your project

cargo add proc_macro_tools

Try out from the repository

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

Dependencies

~1.5MB
~39K SLoC