Function pact_ffi::plugins::pactffi_using_plugin
source · #[no_mangle]
pub extern "C" fn pactffi_using_plugin(
pact: PactHandle,
plugin_name: *const c_char,
plugin_version: *const c_char
) -> c_uint
Expand description
Add a plugin to be used by the test. The plugin needs to be installed correctly for this function to work.
plugin_name
is the name of the plugin to load.plugin_version
is the version of the plugin to load. It is optional, and can be NULL.
Returns zero on success, and a positive integer value on failure.
Note that plugins run as separate processes, so will need to be cleaned up afterwards by
calling pactffi_cleanup_plugins
otherwise you will have plugin processes left running.
§Safety
plugin_name
must be a valid pointer to a NULL terminated string. plugin_version
may be null,
and if not NULL must also be a valid pointer to a NULL terminated string. Invalid
pointers will result in undefined behaviour.
§Errors
1
- A general panic was caught.2
- Failed to load the plugin.3
- Pact Handle is not valid.
When an error errors, LAST_ERROR will contain the error message.