Trait macro_tools::IntoGenericArgs

source ·
pub trait IntoGenericArgs {
    // Required method
    fn into_generic_args(&self) -> AngleBracketedGenericArguments;
}
Expand description

A trait for converting a reference to an existing type into a syn::AngleBracketedGenericArguments.

This trait provides a mechanism to transform various types that represent generic parameters, such as syn::Generics, into a uniform syn::AngleBracketedGenericArguments. This is particularly useful when working with Rust syntax trees in procedural macros, allowing for the manipulation and merging of generic parameters from different syntactic elements.

Required Methods§

source

fn into_generic_args(&self) -> AngleBracketedGenericArguments

Converts a reference of the implementing type into syn::AngleBracketedGenericArguments.

This method should handle the conversion logic necessary to transform the implementing type’s generic parameter representations into the structured format required by syn::AngleBracketedGenericArguments, which is commonly used to represent generic parameters enclosed in angle brackets.

§Returns

A new instance of syn::AngleBracketedGenericArguments representing the generic parameters of the original type.

Implementors§