Skip to main content

check_arity

Function check_arity 

Source
pub 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)

§Panics

Panics if argc != expected. Generated vtable shims call this inside with_r_unwind_protect_shim so a mismatch uses the tagged-condition transport and unwinds Rust-owned resources before returning.