pub fn tokenize_types(&self) -> TokenStream {
        let generics = &self.generics;
        let mut tokens = TokenStream::new();

        if generics.params.is_empty() {
            return tokens;
        }

        let mut trailing_or_empty = true;
        for param in generics.params.pairs() {
            if let GenericParam::Lifetime(_) = *param.value() {
                trailing_or_empty = param.punct().is_some();
            }
        }
        for param in generics.params.pairs() {
            if let GenericParam::Lifetime(_) = **param.value() {
                continue;
            }
            if !trailing_or_empty {
                <Token![,]>::default().to_tokens(&mut tokens);
                trailing_or_empty = true;
            }
            match *param.value() {
                GenericParam::Lifetime(_) => unreachable!(),
                GenericParam::Type(param) => {
                    // Leave off the type parameter defaults
                    param.ident.to_tokens(&mut tokens);
                }
                GenericParam::Const(param) => {
                    // Leave off the const parameter defaults
                    param.ident.to_tokens(&mut tokens);
                }
            }
            param.punct().to_tokens(&mut tokens);
        }
        <Token![,]>::default().to_tokens(&mut tokens);
        tokens
    }
/// Tokenize type parameters.
/// It skips lifetimes and has no outer brackets.
Tokenize type parameters.
It skips lifetimes and has no outer brackets.
Tokenize type parameters . It skips lifetimes and has no outer brackets .
pub fn tokenize_types(&self) -> TokenStream {
        let generics = &self.generics;
        let mut tokens = TokenStream::new();
        if generics.params.is_empty() {
            return tokens;
        }
        let mut trailing_or_empty = true;
        for param in generics.params.pairs() {
            if let GenericParam::Lifetime(_) = *param.value() {
                trailing_or_empty = param.punct().is_some();
            }
        }
        for param in generics.params.pairs() {
            if let GenericParam::Lifetime(_) = **param.value() {
                continue;
            }
            if !trailing_or_empty {
                <Token![,]>::default().to_tokens(&mut tokens);
                trailing_or_empty = true;
            }
            match *param.value() {
                GenericParam::Lifetime(_) => unreachable!(),
                GenericParam::Type(param) => {
                    // Leave off the type parameter defaults
                    param.ident.to_tokens(&mut tokens);
                }
                GenericParam::Const(param) => {
                    // Leave off the const parameter defaults
                    param.ident.to_tokens(&mut tokens);
                }
            }
            param.punct().to_tokens(&mut tokens);
        }
        <Token![,]>::default().to_tokens(&mut tokens);
        tokens
    }
pub fn tokenize_types ( & self ) -> TokenStream { let generics = & self . generics ; let mut tokens = TokenStream :: new ( ) ; if generics . params . is_empty ( ) { return tokens ; } let mut trailing_or_empty = true ; for param in generics . params . pairs ( ) { if let GenericParam :: Lifetime ( _ ) = * param . value ( ) { trailing_or_empty = param . punct ( ) . is_some ( ) ; } } for param in generics . params . pairs ( ) { if let GenericParam :: Lifetime ( _ ) = * * param . value ( ) { continue ; } if ! trailing_or_empty { < Token ! [ ] > :: default ( ) . to_tokens ( & mut tokens ) ; trailing_or_empty = true ; } match * param . value ( ) { GenericParam :: Lifetime ( _ ) => unreachable ! ( ) , GenericParam :: Type ( param ) => { // Leave off the type parameter defaults param . ident . to_tokens ( & mut tokens ) ; } GenericParam :: Const ( param ) => { // Leave off the const parameter defaults param . ident . to_tokens ( & mut tokens ) ; } } param . punct ( ) . to_tokens ( & mut tokens ) ; } < Token ! [ ] > :: default ( ) . to_tokens ( & mut tokens ) ; tokens }
Tokenize type parameters.
Tokenize type parameters .
&self
&self