rewrite_stream

Function rewrite_stream 

Source
pub fn rewrite_stream<F: Fn(TokenTree) -> TokenStream + Copy>(
    input: TokenStream,
    f: F,
) -> TokenStream
Expand description

Rewrites stream replacing each token with a sequence of tokens returned by the given function. The groups (e.g. token tree within braces) are unpacked, rewritten and repacked into groups – the function is applied recursively.