#[no_mangle]
pub extern "C" fn pactffi_write_message_pact_file(
    pact: MessagePactHandle,
    directory: *const c_char,
    overwrite: bool
) -> i32
Expand description

External interface to write out the message pact file. This function should be called if all the consumer tests have passed. The directory to write the file to is passed as the second parameter. If a NULL pointer is passed, the current working directory is used.

If overwrite is true, the file will be overwritten with the contents of the current pact. Otherwise, it will be merged with any existing pact file.

Returns 0 if the pact file was successfully written. Returns a positive code if the file can not be written, or there is no mock server running on that port or the function panics.

§Errors

Errors are returned as positive values.

ErrorDescription
1The pact file was not able to be written
2The message pact for the given handle was not found