Skip to content

Feature request: Arbitrary pointer-sized data in attributes #864

@nikvoid

Description

@nikvoid

It may be useful to store arbitrary pointer-sized data in Shape. Currently the only attribute type supported is arbitrary text, and if you want, for example, associate some const value with field, you cannot do it properly.

const ID: usize = 42;

#[derive(Facet)
struct Struct {
    #[facet(const(id = ID))] // how should we call this attribute?
    x: u32,
}

// Add this variant to attribute enums
*Attribute::Const(&str, usize) // or use GenericPtr to allow wide pointers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions