[][src]Function pact_mock_server_ffi::write_pact_file

#[no_mangle]pub extern "C" fn write_pact_file(
    mock_server_port: i32,
    directory: *const c_char
) -> i32

External interface to trigger a mock server to write out its 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.

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
1A general panic was caught
2The pact file was not able to be written
3A mock server with the provided port was not found