Macro dummy_api

Source
macro_rules! dummy_api {
    ($vis:vis mod $($count_down:tt)*) => { ... };
    ($vis:vis pm2 mod $($count_down:tt)*) => { ... };
}
Expand description
$vis fn b(_) -> _ {}
$vis fn c(_, _) -> _ {}
$vis mod a {
    pub fn b(_) -> _ {}
    pub fn c(_, _) -> _ {}
    pub mod a { ... }
}

Nesting the above mod a. The number of the mods equals the number of the input tts. The innermost mod is empty.

  • When b() is called with a non-empty TokenStream, it always generates a const D_NUM: usize.
  • When b() is called with an empty TokenStream, it always returns a usize.
  • c() always replaces the input item with a const NUM: usize.

Those usize values are respectively equal to the nest-depths of the functions that output them. The nest-depth of the outermost function is 0.