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

#1487 in Procedural macros

Download history 273/week @ 2023-11-20 259/week @ 2023-11-27 419/week @ 2023-12-04 307/week @ 2023-12-11 287/week @ 2023-12-18 109/week @ 2023-12-25 165/week @ 2024-01-01 209/week @ 2024-01-08 188/week @ 2024-01-15 156/week @ 2024-01-22 171/week @ 2024-01-29 182/week @ 2024-02-05 329/week @ 2024-02-12 366/week @ 2024-02-19 380/week @ 2024-02-26 455/week @ 2024-03-04

1,539 downloads per month
Used in 35 crates (via woptions_meta)

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
~33K SLoC