Function pact_ffi::matching::pactffi_matches_binary_value

source ·
#[no_mangle]
pub extern "C" fn pactffi_matches_binary_value(
    matching_rule: *const MatchingRule,
    expected_value: *const c_uchar,
    expected_value_len: usize,
    actual_value: *const c_uchar,
    actual_value_len: usize,
    cascaded: u8
) -> *const c_char
Expand description

Determines if the binary value matches the given matching rule. If the value matches OK, will return a NULL pointer. If the value does not match, will return a error message as a NULL terminated string. The error message pointer will need to be deleted with the pactffi_string_delete function once it is no longer required.

  • matching_rule - pointer to a matching rule
  • expected_value - value we expect to get
  • expected_value_len - length of the expected value bytes
  • actual_value - value to match
  • actual_value_len - length of the actual value bytes
  • cascaded - if the matching rule has been cascaded from a parent. 0 == false, 1 == true

§Safety

The matching rule, expected value and actual value pointers must be a valid pointers. expected_value_len and actual_value_len must contain the number of bytes that the value pointers point to. Passing invalid lengths can lead to undefined behaviour.