Check if the function has the expected number of arguments
(&self, expected: usize)
| 95 | |
| 96 | /// Check if the function has the expected number of arguments |
| 97 | pub fn validate_argument_count(&self, expected: usize) -> FunctionResult<()> { |
| 98 | if self.argument_count() != expected { |
| 99 | return Err(FunctionError::InvalidArgumentCount { |
| 100 | expected, |
| 101 | actual: self.argument_count(), |
| 102 | }); |
| 103 | } |
| 104 | Ok(()) |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | /// Core trait for all functions - just implement this for any function |