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

Ability to skip over _ prefixed fields #80

Open
v1gnesh opened this issue Aug 5, 2024 · 2 comments
Open

Ability to skip over _ prefixed fields #80

v1gnesh opened this issue Aug 5, 2024 · 2 comments

Comments

@v1gnesh
Copy link

v1gnesh commented Aug 5, 2024

How big of a task is it to skip over these fields when deriving Serialize?

Ex:

struct Ye {
    a: u16,
    _b: u8,
    c: u32,
}

should produce

{ "Ye":
  { 
    "a": 0,
    "c": 0
  }
}
@Licenser
Copy link
Member

Licenser commented Aug 5, 2024

I don't think it's a big task, but I'm not convinced we should do it. People might very well expect them to be included, especially since serde includes them as well.

Perhaps a better alternative would be to support the skip attribute? (which too isn't a big one I think)

@Licenser
Copy link
Member

Licenser commented Aug 5, 2024

adding skip in here

impl Parse for FieldAttrs {
should be rather stright forward :) we already have the much more complex skip_serializing_if

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

2 participants