Skip to main content

haystack_value_get_dict_len

Function haystack_value_get_dict_len 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn haystack_value_get_dict_len( val: *const Value, ) -> usize
Expand description

Get number of elements of a Dict Value

§Arguments

val A Dict Value

§Returns

  • number of elements
  • -1 if there was an error getting the length, in which case the last_error_message can be called to get the error message.

§Example

let val = haystack_value_make_dict();
assert!(haystack_value_is_dict(val));
assert_eq!(haystack_value_get_dict_len(val), 0);

§Safety

Panics on invalid input data