Skip to main content

choice_param_doc_map

Function choice_param_doc_map 

Source
pub(crate) fn choice_param_doc_map(
    c_ident: &str,
    per_param: &HashMap<String, ParamAttrs>,
) -> HashMap<String, String>
Expand description

Build the R-formal → auto-generated @param text map for a method’s choice params: the write-time placeholder for a match_arg param (the wrapper writer renders it from the enum’s MatchArg::CHOICES, #210), the literal One of "a", "b". line for a choices(...) param (ParamAttrs::literal_choices_doc, the same text a standalone function gets). Pass to MethodDocBuilder::with_choice_param_docs in each class generator.

Takes the per-param attribute map directly (rather than &ParsedMethod) so it’s shared by both the inherent-impl (MethodContext) and trait-impl (TraitMethodContext, miniextendr_impl_trait/method_context.rs) paths.