Skip to content

allow fields to represent top level attributes #13

Open
@ModProg

Description

@ModProg

i.e.:

#[derive(FromAttr)]
#[attribute(flatten)]
struct FieldAttribute {
    default: FlagOrValue<Expr>,
    children: bool,
}

would parse

#[default]
#[default = <expr>]
// This is supported additionally, because
// `=` only supports a subset of expressions
#[default(<expr>)]

#[children]

We could support this maybe as a fieldlevel attribute as well, or allow the field value to be anything that implements FromAttr to allow hybrid structs with nested and unnested attributes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions