Skip to main content

standalone_body

Function standalone_body 

Source
pub fn standalone_body(
    call_expr: &str,
    final_return: &str,
    indent: &str,
) -> String
Expand description

Generate a standalone-function R wrapper body.

Returns the full body string: .val <- <call_expr>; if (...) return(...); <final_return>. Used for top-level #[miniextendr] functions (not class methods).

  • call_expr: The .Call() expression to evaluate
  • final_return: The expression to return (typically ".val" or "invisible(.val)")
  • indent: Leading whitespace for the body lines (e.g., " " for 2-space)