(attrs: &[Attribute])
| 32 | } |
| 33 | |
| 34 | pub fn extract_field_parse_mode(attrs: &[Attribute]) -> Result<FieldParseMode> { |
| 35 | let args = ParseModeArgs::from_attributes(attrs) |
| 36 | .map_err(|e| syn::Error::new(proc_macro2::Span::call_site(), e.to_string()))?; |
| 37 | Ok(match (args.all_must_occur, args.one_must_occur) { |
| 38 | (true, _) => FieldParseMode::AllMustOccur, |
| 39 | (_, true) => FieldParseMode::OneMustOccur, |
| 40 | _ => FieldParseMode::Sequential, |
| 41 | }) |
| 42 | } |
| 43 | |
| 44 | #[derive(Debug, Clone)] |
| 45 | pub struct Atom(ExprPath); |