Skip to content

feat: custom derive as config #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jjangga0214 opened this issue Oct 17, 2023 · 1 comment
Open

feat: custom derive as config #98

jjangga0214 opened this issue Oct 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@jjangga0214
Copy link

jjangga0214 commented Oct 17, 2023

Maybe sometimes custom derives would be needed, IMHO.

#[derive(Debug, Clone)]
pub struct TableOptions<'a> {
    // ... other fields are omitted for brevity. 

    /// any arbitrary derives to append
    extra_derives: Vec<&'a str>
}

How about this?
Thanks.

@hasezoey
Copy link
Collaborator

i dont think such a field would be a good idea, but maybe a callback function that runs custom code to extend the list? that way no multiple fields are necessary for each struct type and extra conditions can be added.

also i dont think it is currently possible with a callback function, until #87 is merged which refactored the generation to use a vector instead of static format!("{derive1}{derive2}")

@hasezoey hasezoey added the enhancement New feature or request label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants