Skip to content
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

Add option to generator for skippable fields #3

Open
jhorstmann opened this issue May 25, 2024 · 1 comment
Open

Add option to generator for skippable fields #3

jhorstmann opened this issue May 25, 2024 · 1 comment

Comments

@jhorstmann
Copy link
Owner

  • Add a configuration object to any struct::read or fill methods, with a boolean per skippable field
  • Adjust generated match statements, for example
match last_field_id {
    ...
    3 => if !config.skip_meta_data {
        self.meta_data.fill_field(input, field_type)?;
    }
@jhorstmann
Copy link
Owner Author

The config would have to be a generic parameter on the CompactThriftInput trait. That is a bit annoying since that parameter would be unused by all the implementations on standard types, and would cause additional code generation during monomorphization for different config types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant