Skip to main content

parse_per_param_attr

Function parse_per_param_attr 

Source
pub(crate) fn parse_per_param_attr(
    attr: &Attribute,
) -> Result<Option<PerParamMiniextendrAttr>>
Expand description

Parse all per-parameter options from a #[miniextendr(...)] attribute.

Handles mixed content like #[miniextendr(match_arg, default = "\"Safe\"")] and #[miniextendr(choices("a", "b", "c"))].

Returns Ok(None) if attr is not a #[miniextendr(...)] attribute, if its content is not a list of options, or if it contains only function-level options (like strict) with no per-parameter options. A malformed inherits(...) / not_inherits(...) / no_na(...) is an error, as is preconditions = bool / no_preconditions = bool, a function-level form the parameter spells bare, and a formal that is not a string or is given twice.

ยงArguments

  • attr - A syn::Attribute to inspect. Only attributes with path miniextendr are considered.