Skip to main content

StructPath

Derive Macro StructPath 

Source
#[derive(StructPath)]
Expand description

#[derive(StructPath)] records a struct’s declared field names as #[doc(hidden)] associated consts, so paths!(Type::*) can return them without the caller listing every field by hand. Supports only a struct with named fields and, at most, lifetime generic parameters; anything else is a compile_error! on the offending item, spanned at the specific token that disqualifies it.