Render the body for this variant, consuming where-bounds into `wc`. Picks `SequentialPlan` or `MustOccurPlan` based on `parse_mode`.
(&self, wc: &mut WhereCollector)
| 362 | /// Render the body for this variant, consuming where-bounds into `wc`. |
| 363 | /// Picks `SequentialPlan` or `MustOccurPlan` based on `parse_mode`. |
| 364 | fn body(&self, wc: &mut WhereCollector) -> TokenStream { |
| 365 | let ident = &self.ident; |
| 366 | let constructor = quote! { Self::#ident }; |
| 367 | if self.parse_mode == FieldParseMode::Sequential { |
| 368 | SequentialPlan { |
| 369 | fields: &self.fields, |
| 370 | members: &self.members, |
| 371 | post_parse_steps: &self.post_parse_steps, |
| 372 | constructor, |
| 373 | } |
| 374 | .render(wc) |
| 375 | } else { |
| 376 | MustOccurPlan { |
| 377 | fields: &self.fields, |
| 378 | members: &self.members, |
| 379 | post_parse_steps: &self.post_parse_steps, |
| 380 | parse_mode: self.parse_mode, |
| 381 | constructor, |
| 382 | hoisted: &[], |
| 383 | } |
| 384 | .render(wc) |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | fn discriminator(&self, shared_atom_paths: &[String], hoisted_type_var_names: &[&Ident]) -> TokenStream { |
| 389 | let all_optional = self.fields.iter().all(|f| f.ty.is_option()); |