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

container attributes 'field_identifier' and 'variant_identifier' are not documented #1238

Open
Lireer opened this issue May 1, 2018 · 4 comments · May be fixed by serde-rs/serde-rs.github.io#146
Labels

Comments

@Lireer
Copy link
Contributor

Lireer commented May 1, 2018

The attribute field_identifier is shown in a comment in the example Manually deserialize struct, but I can't find any documentation explaining what it does.

The same applies to variant_identifier which I found while looking through the code.

@oli-obk oli-obk added the docs label May 1, 2018
@Mingun
Copy link
Contributor

Mingun commented Jun 23, 2018

Container attributes transparent, from and into are also undocumented

// Parse `#[serde(transparent)]`
Meta(Word(ref word)) if word == "transparent" => {
transparent.set_true();
}

// Parse `#[serde(from = "Type")]
Meta(NameValue(ref m)) if m.ident == "from" => {
if let Ok(from_ty) = parse_lit_into_ty(cx, &m.ident, &m.lit) {
type_from.set_opt(Some(from_ty));
}
}
// Parse `#[serde(into = "Type")]
Meta(NameValue(ref m)) if m.ident == "into" => {
if let Ok(into_ty) = parse_lit_into_ty(cx, &m.ident, &m.lit) {
type_into.set_opt(Some(into_ty));
}
}

@wigy-opensource-developer

@dtolnay I could find the documentation for transparent, from and into as container attributes, but the field_identifier and variant_identifier are still missing. Would you please shed some light on their usage?

@ximon18
Copy link

ximon18 commented Jun 23, 2021

I just came across this and noticed that field_identifier and variant_identifier are still not documented and, while I found GitHub issues referring to them, the context in those issues wasn't enough to make it clear what these attributes do or how they are supposed to be used (the examples given show only an isolated enum and not what the impact of the field on the enum is or how it fits into an actual use case). Documentation for these fields would be appreciated. If I understood what they do and why I would happily submit a PR... 😉

@hellow554
Copy link

Ping. Still not documented :/

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

Successfully merging a pull request may close this issue.

6 participants