pub fn build_precondition_checks(
inputs: &Punctuated<FnArg, Comma>,
skip_params: &HashSet<String>,
) -> PreconditionOutputExpand description
Build precondition checks for a function’s parameters.
Returns:
static_checks: Lines forming astopifnot(...)call for known typesfallback_params: Parameters needing validation (unknown custom types)
Static checks produce R-side stopifnot():
stopifnot(
"'a' must be numeric, logical, or raw" = is.numeric(a) || is.logical(a) || is.raw(a),
"'a' must have length 1" = length(a) == 1L
)Skips:
self/&self/&mut self(receiver args)- Parameters in
skip_params(e.g., match_arg params already validated) - Skip types (SEXP, Dots, ExternalPtr, etc.)