Skip to content

Derive macros as a library crate #1900

@Kestrer

Description

@Kestrer

I'm writing a derive macro for a trait that requires Deserialize, and writing implementations by hand is very tedious. It would be useful if Serde could provide a non-proc macro crate with the same functionality as the proc macro crate, so I can simply invoke all of Serde's derive logic from a proc macro.

It could be called serde_derive2 or something, and it would expose the implementation of the derive functions as functions that use proc_macro2 types (maybe it could also support different names for the serde attribute). Like what currently goes on with serde_derive_internals it can be a module of serde_derive as well as an external crate.

If this is a good idea I'm happy to make a PR for it.

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