Module generic_params

Source
Expand description

Functions and structures to handle and manipulate generic parameters using the syn crate. It’s designed to support macro-driven code generation by simplifying, merging, extracting, and decomposing syn::Generics.

Re-exports§

pub use super::super::generic_params;

Modules§

exposed
Exposed namespace of the module.
orphan
Orphan namespace of the module.
own
Own namespace of the module.
prelude
Prelude to use essentials: use my_module::prelude::*.

Structs§

GenericsRef
A wrapper around a reference to syn::Generics to provide convenient helper methods for generating token streams related to generic parameters.
GenericsWithWhere
A GenericsWithWhere struct to handle the parsing of Rust generics with an explicit where clause.

Functions§

decompose
Decomposes syn::Generics into components suitable for different usage contexts in Rust implementations, specifically focusing on different requirements for impl blocks and type definitions.
merge
Merges two syn::Generics instances into a new one.
names
Extracts the names of type parameters, lifetimes, and const parameters from the given Generics.
only_names
Extracts parameter names from the given Generics, dropping bounds, defaults, and the where clause.