Skip to main content

Module generic

Module generic 

Source

Re-exportsยง

pub(crate) use rustc_ast as ast; ๐Ÿ”’
pub(crate) use Substructure::*; ๐Ÿ”’

Macrosยง

smallvec ๐Ÿ”’
Creates a SmallVec containing the arguments.

Structsยง

BlockOrExpr ๐Ÿ”’
The code snippets built up for derived code are sometimes used as blocks (e.g. in a function body) and sometimes used as expressions (e.g. in a match arm). This structure avoids committing to either form until necessary, avoiding the insertion of any unnecessary blocks.
FieldInfo ๐Ÿ”’
Summary of the relevant parts of a struct/enum field.
MethodDef ๐Ÿ”’
SmallVec ๐Ÿ”’
A Vec-like container that can store a small number of elements inline.
TraitDef ๐Ÿ”’
TypeParameter ๐Ÿ”’

Enumsยง

FieldlessVariantsStrategy ๐Ÿ”’
How to handle fieldless enum variants.
MethodBody ๐Ÿ”’
Substructure ๐Ÿ”’
A helper that makes the code for several derive macros easier to write as they all have a similar base structure.

Functionsยง

find_type_parameters ๐Ÿ”’
This method helps to extract all the type parameters referenced from a type. For a type parameter <T>, it looks for either a TyPath that is not global and starts with T, or a TyQPath. Also include bound generic params from the input type.
generics_without_defaults ๐Ÿ”’