Skip to main content

check_arity

Function check_arity 

Source
pub unsafe fn check_arity(argc: i32, expected: i32, method_name: &str)
Expand description

Check that the number of arguments matches expected arity.

§Arguments

  • argc - Actual number of arguments
  • expected - Expected number of arguments
  • method_name - Name of method (for error messages)

§Safety

Must be called on R’s main thread (may call rf_error).

§Errors

Calls rf_error if argc != expected.