MCPcopy Create free account
hub / github.com/csskit/csskit / extract_field_parse_mode

Function extract_field_parse_mode

crates/csskit_derives/src/attributes.rs:34–42  ·  view source on GitHub ↗
(attrs: &[Attribute])

Source from the content-addressed store, hash-verified

32}
33
34pub 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)]
45pub struct Atom(ExprPath);

Callers 1

deriveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected