Skip to main content

concat_props

Function concat_props 

Source
pub const fn concat_props<const N: usize>(
    groups: &[&[PropMeta]],
) -> [PropMeta; N]
Expand description

Join groups of prop metadata into one slice, at compile time.

The settings counterpart of usage_argv::spec::concat_flag_metas, for the same reason: a flattened struct’s props belong in the parent’s registry, and the parent’s macro expansion has only a type to reach them through.

N must be the summed length of groups. Two groups claiming the same name are refused here, at compile time — the parent and the struct it flattens each declared it, a collision neither expansion can see. A name is a key or an alias, because Registry::lookup checks both and takes the first match: an alias colliding with another group’s key makes one of the two unreachable by that name, which is the same bug as a duplicate key and quieter.