Skip to main content

parse_method_class_check

Function parse_method_class_check 

Source
pub(crate) fn parse_method_class_check(
    meta: &ParseNestedMeta<'_>,
    per_param: &mut HashMap<String, ParamAttrs>,
    check: ClassCheck,
) -> Result<()>
Expand description

Method-level inherits(p = "a, b", q(class = "a, b", message = "...")) / not_inherits(...) (the same shape, check says which) on an impl or trait method: each entry names a parameter and the classes it must inherit from (one of) or must not inherit from (any of), optionally with the condition message of the class check. A nested value cannot be a bare list of literals, so the classes are one comma-separated string, as in choices(p = "a, b"). inherits(q(class = "a", when(class = "b, c", message = "..."))) adds a hint (#1824; parse_method_when). Shared by the inherent-impl and trait-impl method parsers.