From faa9fe63dc1e2a68274f15bcf8cc4b18fdcc925b Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Wed, 7 Feb 2024 15:47:27 +1100 Subject: [PATCH] chore(deps): upgrade pact ffi to 0.4.15 Signed-off-by: JP-Ellis --- hatch_build.py | 4 +- pact/v3/ffi.py | 772 +++++++++++++++++++++++++++++++----------------- pact/v3/pact.py | 4 +- 3 files changed, 502 insertions(+), 278 deletions(-) diff --git a/hatch_build.py b/hatch_build.py index 31c3b37165..c6e52b91d5 100644 --- a/hatch_build.py +++ b/hatch_build.py @@ -34,7 +34,9 @@ PACT_BIN_VERSION = os.getenv("PACT_BIN_VERSION", "2.1.0") PACT_BIN_URL = "https://github.com/pact-foundation/pact-ruby-standalone/releases/download/v{version}/pact-{version}-{os}-{machine}.{ext}" -PACT_LIB_VERSION = os.getenv("PACT_LIB_VERSION", "0.4.9") +# Latest version available at: +# https://github.com/pact-foundation/pact-reference/releases +PACT_LIB_VERSION = os.getenv("PACT_LIB_VERSION", "0.4.15") PACT_LIB_URL = "https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v{version}/{prefix}pact_ffi-{os}-{machine}.{ext}" diff --git a/pact/v3/ffi.py b/pact/v3/ffi.py index c0ee4b55c9..6ea24cf97d 100644 --- a/pact/v3/ffi.py +++ b/pact/v3/ffi.py @@ -127,7 +127,7 @@ class InteractionHandle: Handle to a HTTP Interaction. [Rust - `InteractionHandle`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/mock_server/handles/struct.InteractionHandle.html) + `InteractionHandle`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/mock_server/handles/struct.InteractionHandle.html) """ def __init__(self, ref: int) -> None: @@ -218,7 +218,7 @@ class PactHandle: Handle to a Pact. [Rust - `PactHandle`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/mock_server/handles/struct.PactHandle.html) + `PactHandle`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/mock_server/handles/struct.PactHandle.html) """ def __init__(self, ref: int) -> None: @@ -535,7 +535,7 @@ class ExpressionValueType(Enum): """ Expression Value Type. - [Rust `ExpressionValueType`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/models/expressions/enum.ExpressionValueType.html) + [Rust `ExpressionValueType`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/models/expressions/enum.ExpressionValueType.html) """ UNKNOWN = lib.ExpressionValueType_Unknown @@ -562,7 +562,7 @@ class GeneratorCategory(Enum): """ Generator Category. - [Rust `GeneratorCategory`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/models/generators/enum.GeneratorCategory.html) + [Rust `GeneratorCategory`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/models/generators/enum.GeneratorCategory.html) """ METHOD = lib.GeneratorCategory_METHOD @@ -590,7 +590,7 @@ class InteractionPart(Enum): """ Interaction Part. - [Rust `InteractionPart`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/mock_server/handles/enum.InteractionPart.html) + [Rust `InteractionPart`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/mock_server/handles/enum.InteractionPart.html) """ REQUEST = lib.InteractionPart_Request @@ -636,7 +636,7 @@ class MatchingRuleCategory(Enum): """ Matching Rule Category. - [Rust `MatchingRuleCategory`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/models/matching_rules/enum.MatchingRuleCategory.html) + [Rust `MatchingRuleCategory`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/models/matching_rules/enum.MatchingRuleCategory.html) """ METHOD = lib.MatchingRuleCategory_METHOD @@ -665,7 +665,7 @@ class PactSpecification(Enum): """ Pact Specification. - [Rust `PactSpecification`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/models/pact_specification/enum.PactSpecification.html) + [Rust `PactSpecification`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/models/pact_specification/enum.PactSpecification.html) """ UNKNOWN = lib.PactSpecification_Unknown @@ -697,7 +697,7 @@ class _StringResult(Enum): """ Internal enum from Pact FFI. - [Rust `StringResult`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/mock_server/enum.StringResult.html) + [Rust `StringResult`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/mock_server/enum.StringResult.html) """ FAILED = lib.StringResult_Failed @@ -844,7 +844,7 @@ def version() -> str: """ Return the version of the pact_ffi library. - [Rust `pactffi_version`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_version) + [Rust `pactffi_version`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_version) Returns: The version of the pact_ffi library as a string, in the form of `x.y.z`. @@ -864,7 +864,7 @@ def init(log_env_var: str) -> None: tracing subscriber. [Rust - `pactffi_init`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_init) + `pactffi_init`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_init) # Safety @@ -873,7 +873,7 @@ def init(log_env_var: str) -> None: raise NotImplementedError -def init_with_log_level(level: str) -> None: +def init_with_log_level(level: str = "INFO") -> None: """ Initialises logging, and sets the log level explicitly. @@ -881,7 +881,11 @@ def init_with_log_level(level: str) -> None: tracing subscriber. [Rust - `pactffi_init_with_log_level`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_init_with_log_level) + `pactffi_init_with_log_level`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_init_with_log_level) + + Args: + level: + One of TRACE, DEBUG, INFO, WARN, ERROR, NONE/OFF. Case-insensitive. # Safety @@ -897,7 +901,7 @@ def enable_ansi_support() -> None: On non-Windows platforms, this function is a no-op. [Rust - `pactffi_enable_ansi_support`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_enable_ansi_support) + `pactffi_enable_ansi_support`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_enable_ansi_support) # Safety @@ -915,7 +919,7 @@ def log_message( Log using the shared core logging facility. [Rust - `pactffi_log_message`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_log_message) + `pactffi_log_message`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_log_message) This is useful for callers to have a single set of logs. @@ -949,7 +953,7 @@ def match_message(msg_1: Message, msg_2: Message) -> Mismatches: If the messages match, the returned collection will be empty. [Rust - `pactffi_match_message`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_match_message) + `pactffi_match_message`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_match_message) """ raise NotImplementedError @@ -959,7 +963,7 @@ def mismatches_get_iter(mismatches: Mismatches) -> MismatchesIterator: Get an iterator over mismatches. [Rust - `pactffi_mismatches_get_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatches_get_iter) + `pactffi_mismatches_get_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatches_get_iter) """ raise NotImplementedError @@ -968,7 +972,7 @@ def mismatches_delete(mismatches: Mismatches) -> None: """ Delete mismatches. - [Rust `pactffi_mismatches_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatches_delete) + [Rust `pactffi_mismatches_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatches_delete) """ raise NotImplementedError @@ -977,7 +981,7 @@ def mismatches_iter_next(iter: MismatchesIterator) -> Mismatch: """ Get the next mismatch from a mismatches iterator. - [Rust `pactffi_mismatches_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatches_iter_next) + [Rust `pactffi_mismatches_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatches_iter_next) Returns a null pointer if no mismatches remain. """ @@ -988,7 +992,7 @@ def mismatches_iter_delete(iter: MismatchesIterator) -> None: """ Delete a mismatches iterator when you're done with it. - [Rust `pactffi_mismatches_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatches_iter_delete) + [Rust `pactffi_mismatches_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatches_iter_delete) """ raise NotImplementedError @@ -997,7 +1001,7 @@ def mismatch_to_json(mismatch: Mismatch) -> str: """ Get a JSON representation of the mismatch. - [Rust `pactffi_mismatch_to_json`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatch_to_json) + [Rust `pactffi_mismatch_to_json`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatch_to_json) """ raise NotImplementedError @@ -1006,7 +1010,7 @@ def mismatch_type(mismatch: Mismatch) -> str: """ Get the type of a mismatch. - [Rust `pactffi_mismatch_type`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatch_type) + [Rust `pactffi_mismatch_type`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatch_type) """ raise NotImplementedError @@ -1015,7 +1019,7 @@ def mismatch_summary(mismatch: Mismatch) -> str: """ Get a summary of a mismatch. - [Rust `pactffi_mismatch_summary`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatch_summary) + [Rust `pactffi_mismatch_summary`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatch_summary) """ raise NotImplementedError @@ -1024,7 +1028,7 @@ def mismatch_description(mismatch: Mismatch) -> str: """ Get a description of a mismatch. - [Rust `pactffi_mismatch_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatch_description) + [Rust `pactffi_mismatch_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatch_description) """ raise NotImplementedError @@ -1033,7 +1037,7 @@ def mismatch_ansi_description(mismatch: Mismatch) -> str: """ Get an ANSI-compatible description of a mismatch. - [Rust `pactffi_mismatch_ansi_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mismatch_ansi_description) + [Rust `pactffi_mismatch_ansi_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mismatch_ansi_description) """ raise NotImplementedError @@ -1043,7 +1047,7 @@ def get_error_message(length: int = 1024) -> str | None: Provide the error message from `LAST_ERROR` to the calling C code. [Rust - `pactffi_get_error_message`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_get_error_message) + `pactffi_get_error_message`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_get_error_message) This function should be called after any other function in the pact_matching FFI indicates a failure with its own error message, if the caller wants to @@ -1096,7 +1100,7 @@ def log_to_stdout(level_filter: LevelFilter) -> int: """ Convenience function to direct all logging to stdout. - [Rust `pactffi_log_to_stdout`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_log_to_stdout) + [Rust `pactffi_log_to_stdout`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_log_to_stdout) """ raise NotImplementedError @@ -1106,7 +1110,7 @@ def log_to_stderr(level_filter: LevelFilter | str = LevelFilter.ERROR) -> None: Convenience function to direct all logging to stderr. [Rust - `pactffi_log_to_stderr`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_log_to_stderr) + `pactffi_log_to_stderr`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_log_to_stderr) Args: level_filter: @@ -1130,7 +1134,7 @@ def log_to_file(file_name: str, level_filter: LevelFilter) -> int: Convenience function to direct all logging to a file. [Rust - `pactffi_log_to_file`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_log_to_file) + `pactffi_log_to_file`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_log_to_file) # Safety @@ -1144,7 +1148,7 @@ def log_to_buffer(level_filter: LevelFilter | str = LevelFilter.ERROR) -> None: """ Convenience function to direct all logging to a task local memory buffer. - [Rust `pactffi_log_to_buffer`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_log_to_buffer) + [Rust `pactffi_log_to_buffer`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_log_to_buffer) """ if isinstance(level_filter, str): level_filter = LevelFilter[level_filter.upper()] @@ -1158,7 +1162,7 @@ def logger_init() -> None: """ Initialize the FFI logger with no sinks. - [Rust `pactffi_logger_init`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_logger_init) + [Rust `pactffi_logger_init`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_logger_init) This initialized logger does nothing until `pactffi_logger_apply` has been called. @@ -1180,7 +1184,7 @@ def logger_attach_sink(sink_specifier: str, level_filter: LevelFilter) -> int: Attach an additional sink to the thread-local logger. [Rust - `pactffi_logger_attach_sink`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_logger_attach_sink) + `pactffi_logger_attach_sink`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_logger_attach_sink) This logger does nothing until `pactffi_logger_apply` has been called. @@ -1227,7 +1231,7 @@ def logger_apply() -> int: Apply the previously configured sinks and levels to the program. [Rust - `pactffi_logger_apply`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_logger_apply) + `pactffi_logger_apply`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_logger_apply) If no sinks have been setup, will set the log level to info and the target to standard out. @@ -1243,7 +1247,7 @@ def fetch_log_buffer(log_id: str) -> str: Fetch the in-memory logger buffer contents. [Rust - `pactffi_fetch_log_buffer`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_fetch_log_buffer) + `pactffi_fetch_log_buffer`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_fetch_log_buffer) This will only have any contents if the `buffer` sink has been configured to log to. The contents will be allocated on the heap and will need to be freed @@ -1269,7 +1273,7 @@ def parse_pact_json(json: str) -> Pact: Parses the provided JSON into a Pact model. [Rust - `pactffi_parse_pact_json`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_parse_pact_json) + `pactffi_parse_pact_json`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_parse_pact_json) The returned Pact model must be freed with the `pactffi_pact_model_delete` function when no longer needed. @@ -1286,7 +1290,7 @@ def pact_model_delete(pact: Pact) -> None: """ Frees the memory used by the Pact model. - [Rust `pactffi_pact_model_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_model_delete) + [Rust `pactffi_pact_model_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_model_delete) """ raise NotImplementedError @@ -1296,7 +1300,7 @@ def pact_model_interaction_iterator(pact: Pact) -> PactInteractionIterator: Returns an iterator over all the interactions in the Pact. [Rust - `pactffi_pact_model_interaction_iterator`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_model_interaction_iterator) + `pactffi_pact_model_interaction_iterator`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_model_interaction_iterator) The iterator will have to be deleted using the `pactffi_pact_interaction_iter_delete` function. The iterator will contain a @@ -1315,7 +1319,7 @@ def pact_spec_version(pact: Pact) -> PactSpecification: """ Returns the Pact specification enum that the Pact is for. - [Rust `pactffi_pact_spec_version`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_spec_version) + [Rust `pactffi_pact_spec_version`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_spec_version) """ raise NotImplementedError @@ -1324,7 +1328,7 @@ def pact_interaction_delete(interaction: PactInteraction) -> None: """ Frees the memory used by the Pact interaction model. - [Rust `pactffi_pact_interaction_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_interaction_delete) + [Rust `pactffi_pact_interaction_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_interaction_delete) """ raise NotImplementedError @@ -1333,7 +1337,7 @@ def async_message_new() -> AsynchronousMessage: """ Get a mutable pointer to a newly-created default message on the heap. - [Rust `pactffi_async_message_new`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_new) + [Rust `pactffi_async_message_new`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_new) # Safety @@ -1350,7 +1354,7 @@ def async_message_delete(message: AsynchronousMessage) -> None: """ Destroy the `AsynchronousMessage` being pointed to. - [Rust `pactffi_async_message_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_delete) + [Rust `pactffi_async_message_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_delete) """ raise NotImplementedError @@ -1360,7 +1364,7 @@ def async_message_get_contents(message: AsynchronousMessage) -> MessageContents: Get the message contents of an `AsynchronousMessage` as a `MessageContents` pointer. [Rust - `pactffi_async_message_get_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_get_contents) + `pactffi_async_message_get_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_get_contents) # Safety @@ -1379,7 +1383,7 @@ def async_message_get_contents_str(message: AsynchronousMessage) -> str: """ Get the message contents of an `AsynchronousMessage` in string form. - [Rust `pactffi_async_message_get_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_get_contents_str) + [Rust `pactffi_async_message_get_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_get_contents_str) # Safety @@ -1406,7 +1410,7 @@ def async_message_set_contents_str( Sets the contents of the message as a string. [Rust - `pactffi_async_message_set_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_set_contents_str) + `pactffi_async_message_set_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_set_contents_str) - `message` - the message to set the contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -1434,7 +1438,7 @@ def async_message_get_contents_length(message: AsynchronousMessage) -> int: Get the length of the contents of a `AsynchronousMessage`. [Rust - `pactffi_async_message_get_contents_length`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_get_contents_length) + `pactffi_async_message_get_contents_length`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_get_contents_length) # Safety @@ -1453,7 +1457,7 @@ def async_message_get_contents_bin(message: AsynchronousMessage) -> str: Get the contents of an `AsynchronousMessage` as bytes. [Rust - `pactffi_async_message_get_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_get_contents_bin) + `pactffi_async_message_get_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_get_contents_bin) # Safety @@ -1480,7 +1484,7 @@ def async_message_set_contents_bin( Sets the contents of the message as an array of bytes. [Rust - `pactffi_async_message_set_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_set_contents_bin) + `pactffi_async_message_set_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_set_contents_bin) * `message` - the message to set the contents for * `contents` - pointer to contents to copy from @@ -1507,7 +1511,7 @@ def async_message_get_description(message: AsynchronousMessage) -> str: Get a copy of the description. [Rust - `pactffi_async_message_get_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_get_description) + `pactffi_async_message_get_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_get_description) # Safety @@ -1533,7 +1537,7 @@ def async_message_set_description( """ Write the `description` field on the `AsynchronousMessage`. - [Rust `pactffi_async_message_set_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_set_description) + [Rust `pactffi_async_message_set_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_set_description) # Safety @@ -1558,7 +1562,7 @@ def async_message_get_provider_state( Get a copy of the provider state at the given index from this message. [Rust - `pactffi_async_message_get_provider_state`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_get_provider_state) + `pactffi_async_message_get_provider_state`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_get_provider_state) # Safety @@ -1583,7 +1587,7 @@ def async_message_get_provider_state_iter( """ Get an iterator over provider states. - [Rust `pactffi_async_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_async_message_get_provider_state_iter) + [Rust `pactffi_async_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_async_message_get_provider_state_iter) # Safety @@ -1600,7 +1604,7 @@ def consumer_get_name(consumer: Consumer) -> str: r""" Get a copy of this consumer's name. - [Rust `pactffi_consumer_get_name`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_consumer_get_name) + [Rust `pactffi_consumer_get_name`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_consumer_get_name) The copy must be deleted with `pactffi_string_delete`. @@ -1646,7 +1650,7 @@ def pact_get_consumer(pact: Pact) -> Consumer: `pactffi_pact_consumer_delete` when no longer required. [Rust - `pactffi_pact_get_consumer`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_get_consumer) + `pactffi_pact_get_consumer`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_get_consumer) # Errors @@ -1660,7 +1664,7 @@ def pact_consumer_delete(consumer: Consumer) -> None: """ Frees the memory used by the Pact consumer. - [Rust `pactffi_pact_consumer_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_consumer_delete) + [Rust `pactffi_pact_consumer_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_consumer_delete) """ raise NotImplementedError @@ -1669,7 +1673,7 @@ def message_contents_get_contents_str(contents: MessageContents) -> str: """ Get the message contents in string form. - [Rust `pactffi_message_contents_get_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_get_contents_str) + [Rust `pactffi_message_contents_get_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_get_contents_str) # Safety @@ -1696,7 +1700,7 @@ def message_contents_set_contents_str( Sets the contents of the message as a string. [Rust - `pactffi_message_contents_set_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_set_contents_str) + `pactffi_message_contents_set_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_set_contents_str) * `contents` - the message contents to set the contents for * `contents_str` - pointer to contents to copy from. Must be a valid @@ -1723,7 +1727,7 @@ def message_contents_get_contents_length(contents: MessageContents) -> int: """ Get the length of the message contents. - [Rust `pactffi_message_contents_get_contents_length`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_get_contents_length) + [Rust `pactffi_message_contents_get_contents_length`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_get_contents_length) # Safety @@ -1742,7 +1746,7 @@ def message_contents_get_contents_bin(contents: MessageContents) -> str: Get the contents of a message as a pointer to an array of bytes. [Rust - `pactffi_message_contents_get_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_get_contents_bin) + `pactffi_message_contents_get_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_get_contents_bin) # Safety @@ -1769,7 +1773,7 @@ def message_contents_set_contents_bin( Sets the contents of the message as an array of bytes. [Rust - `pactffi_message_contents_set_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_set_contents_bin) + `pactffi_message_contents_set_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_set_contents_bin) * `message` - the message contents to set the contents for * `contents_bin` - pointer to contents to copy from @@ -1798,7 +1802,7 @@ def message_contents_get_metadata_iter( Get an iterator over the metadata of a message. [Rust - `pactffi_message_contents_get_metadata_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_get_metadata_iter) + `pactffi_message_contents_get_metadata_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_get_metadata_iter) The returned pointer must be deleted with `pactffi_message_metadata_iter_delete` when done with it. @@ -1829,7 +1833,7 @@ def message_contents_get_matching_rule_iter( Get an iterator over the matching rules for a category of a message. [Rust - `pactffi_message_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_get_matching_rule_iter) + `pactffi_message_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_get_matching_rule_iter) The returned pointer must be deleted with `pactffi_matching_rules_iter_delete` when done with it. @@ -1869,7 +1873,7 @@ def request_contents_get_matching_rule_iter( r""" Get an iterator over the matching rules for a category of an HTTP request. - [Rust `pactffi_request_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_request_contents_get_matching_rule_iter) + [Rust `pactffi_request_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_request_contents_get_matching_rule_iter) The returned pointer must be deleted with `pactffi_matching_rules_iter_delete` when done with it. @@ -1906,7 +1910,7 @@ def response_contents_get_matching_rule_iter( r""" Get an iterator over the matching rules for a category of an HTTP response. - [Rust `pactffi_response_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_response_contents_get_matching_rule_iter) + [Rust `pactffi_response_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_response_contents_get_matching_rule_iter) The returned pointer must be deleted with `pactffi_matching_rules_iter_delete` when done with it. @@ -1944,7 +1948,7 @@ def message_contents_get_generators_iter( Get an iterator over the generators for a category of a message. [Rust - `pactffi_message_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_contents_get_generators_iter) + `pactffi_message_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_contents_get_generators_iter) The returned pointer must be deleted with `pactffi_generators_iter_delete` when done with it. @@ -1969,7 +1973,7 @@ def request_contents_get_generators_iter( Get an iterator over the generators for a category of an HTTP request. [Rust - `pactffi_request_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_request_contents_get_generators_iter) + `pactffi_request_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_request_contents_get_generators_iter) The returned pointer must be deleted with `pactffi_generators_iter_delete` when done with it. @@ -1994,7 +1998,7 @@ def response_contents_get_generators_iter( Get an iterator over the generators for a category of an HTTP response. [Rust - `pactffi_response_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_response_contents_get_generators_iter) + `pactffi_response_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_response_contents_get_generators_iter) The returned pointer must be deleted with `pactffi_generators_iter_delete` when done with it. @@ -2019,7 +2023,7 @@ def parse_matcher_definition(expression: str) -> MatchingRuleDefinitionResult: any generator. [Rust - `pactffi_parse_matcher_definition`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_parse_matcher_definition) + `pactffi_parse_matcher_definition`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_parse_matcher_definition) The following are examples of matching rule definitions: @@ -2055,7 +2059,7 @@ def matcher_definition_error(definition: MatchingRuleDefinitionResult) -> str: using the `pactffi_string_delete` function once done with it. [Rust - `pactffi_matcher_definition_error`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matcher_definition_error) + `pactffi_matcher_definition_error`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matcher_definition_error) """ raise NotImplementedError @@ -2069,7 +2073,7 @@ def matcher_definition_value(definition: MatchingRuleDefinitionResult) -> str: the `pactffi_string_delete` function once done with it. [Rust - `pactffi_matcher_definition_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matcher_definition_value) + `pactffi_matcher_definition_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matcher_definition_value) Note that different expressions values can have types other than a string. Use `pactffi_matcher_definition_value_type` to get the actual type of the @@ -2083,7 +2087,7 @@ def matcher_definition_delete(definition: MatchingRuleDefinitionResult) -> None: """ Frees the memory used by the result of parsing the matching definition expression. - [Rust `pactffi_matcher_definition_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matcher_definition_delete) + [Rust `pactffi_matcher_definition_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matcher_definition_delete) """ raise NotImplementedError @@ -2096,7 +2100,7 @@ def matcher_definition_generator(definition: MatchingRuleDefinitionResult) -> Ge NULL pointer, otherwise returns the generator as a pointer. [Rust - `pactffi_matcher_definition_generator`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matcher_definition_generator) + `pactffi_matcher_definition_generator`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matcher_definition_generator) The generator pointer will be a valid pointer as long as `pactffi_matcher_definition_delete` has not been called on the definition. @@ -2115,7 +2119,7 @@ def matcher_definition_value_type( If there was an error parsing the expression, it will return Unknown. [Rust - `pactffi_matcher_definition_value_type`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matcher_definition_value_type) + `pactffi_matcher_definition_value_type`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matcher_definition_value_type) """ raise NotImplementedError @@ -2124,7 +2128,7 @@ def matching_rule_iter_delete(iter: MatchingRuleIterator) -> None: """ Free the iterator when you're done using it. - [Rust `pactffi_matching_rule_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rule_iter_delete) + [Rust `pactffi_matching_rule_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rule_iter_delete) """ raise NotImplementedError @@ -2139,7 +2143,7 @@ def matcher_definition_iter( `pactffi_matching_rule_iter_delete` function once done with it. [Rust - `pactffi_matcher_definition_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matcher_definition_iter) + `pactffi_matcher_definition_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matcher_definition_iter) If there was an error parsing the expression, this function will return a NULL pointer. @@ -2155,7 +2159,7 @@ def matching_rule_iter_next(iter: MatchingRuleIterator) -> MatchingRuleResult: deleted but will be cleaned up when the iterator is deleted. [Rust - `pactffi_matching_rule_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rule_iter_next) + `pactffi_matching_rule_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rule_iter_next) Will return a NULL pointer when the iterator has advanced past the end of the list. @@ -2177,7 +2181,7 @@ def matching_rule_id(rule_result: MatchingRuleResult) -> int: Return the ID of the matching rule. [Rust - `pactffi_matching_rule_id`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rule_id) + `pactffi_matching_rule_id`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rule_id) The ID corresponds to the following rules: @@ -2223,7 +2227,7 @@ def matching_rule_value(rule_result: MatchingRuleResult) -> str: pointer. [Rust - `pactffi_matching_rule_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rule_value) + `pactffi_matching_rule_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rule_value) The associated values for the rules are: @@ -2271,7 +2275,7 @@ def matching_rule_pointer(rule_result: MatchingRuleResult) -> MatchingRule: Will return a NULL pointer if the matching rule result was a reference. [Rust - `pactffi_matching_rule_pointer`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rule_pointer) + `pactffi_matching_rule_pointer`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rule_pointer) # Safety @@ -2289,7 +2293,7 @@ def matching_rule_reference_name(rule_result: MatchingRuleResult) -> str: structure. I.e., [Rust - `pactffi_matching_rule_reference_name`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rule_reference_name) + `pactffi_matching_rule_reference_name`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rule_reference_name) ```json { @@ -2323,7 +2327,7 @@ def validate_datetime(value: str, format: str) -> None: `pactffi_get_error_message`. [Rust - `pactffi_validate_datetime`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_validate_datetime) + `pactffi_validate_datetime`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_validate_datetime) # Errors If the function receives a panic, it will return 2 and the message associated with the panic can be retrieved with `pactffi_get_error_message`. @@ -2351,7 +2355,7 @@ def generator_to_json(generator: Generator) -> str: Get the JSON form of the generator. [Rust - `pactffi_generator_to_json`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generator_to_json) + `pactffi_generator_to_json`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generator_to_json) The returned string must be deleted with `pactffi_string_delete`. @@ -2374,7 +2378,7 @@ def generator_generate_string(generator: Generator, context_json: str) -> str: function). [Rust - `pactffi_generator_generate_string`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generator_generate_string) + `pactffi_generator_generate_string`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generator_generate_string) If anything goes wrong, it will return a NULL pointer. """ @@ -2390,7 +2394,7 @@ def generator_generate_integer(generator: Generator, context_json: str) -> int: should be the values returned from the Provider State callback function). [Rust - `pactffi_generator_generate_integer`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generator_generate_integer) + `pactffi_generator_generate_integer`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generator_generate_integer) If anything goes wrong or the generator is not a type that can generate an integer value, it will return a zero value. @@ -2403,7 +2407,7 @@ def generators_iter_delete(iter: GeneratorCategoryIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_generators_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generators_iter_delete) + `pactffi_generators_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generators_iter_delete) """ raise NotImplementedError @@ -2413,7 +2417,7 @@ def generators_iter_next(iter: GeneratorCategoryIterator) -> GeneratorKeyValuePa Get the next path and generator out of the iterator, if possible. [Rust - `pactffi_generators_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generators_iter_next) + `pactffi_generators_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generators_iter_next) The returned pointer must be deleted with `pactffi_generator_iter_pair_delete`. @@ -2435,7 +2439,7 @@ def generators_iter_pair_delete(pair: GeneratorKeyValuePair) -> None: Free a pair of key and value returned from `pactffi_generators_iter_next`. [Rust - `pactffi_generators_iter_pair_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generators_iter_pair_delete) + `pactffi_generators_iter_pair_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generators_iter_pair_delete) """ raise NotImplementedError @@ -2444,7 +2448,7 @@ def sync_http_new() -> SynchronousHttp: """ Get a mutable pointer to a newly-created default interaction on the heap. - [Rust `pactffi_sync_http_new`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_new) + [Rust `pactffi_sync_http_new`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_new) # Safety @@ -2462,7 +2466,7 @@ def sync_http_delete(interaction: SynchronousHttp) -> None: Destroy the `SynchronousHttp` interaction being pointed to. [Rust - `pactffi_sync_http_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_delete) + `pactffi_sync_http_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_delete) """ raise NotImplementedError @@ -2472,7 +2476,7 @@ def sync_http_get_request(interaction: SynchronousHttp) -> HttpRequest: Get the request of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_request`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_request) + `pactffi_sync_http_get_request`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_request) # Safety @@ -2492,7 +2496,7 @@ def sync_http_get_request_contents(interaction: SynchronousHttp) -> str: Get the request contents of a `SynchronousHttp` interaction in string form. [Rust - `pactffi_sync_http_get_request_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_request_contents) + `pactffi_sync_http_get_request_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_request_contents) # Safety @@ -2519,7 +2523,7 @@ def sync_http_set_request_contents( Sets the request contents of the interaction. [Rust - `pactffi_sync_http_set_request_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_set_request_contents) + `pactffi_sync_http_set_request_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_set_request_contents) - `interaction` - the interaction to set the request contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -2547,7 +2551,7 @@ def sync_http_get_request_contents_length(interaction: SynchronousHttp) -> int: Get the length of the request contents of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_request_contents_length`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_request_contents_length) + `pactffi_sync_http_get_request_contents_length`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_request_contents_length) # Safety @@ -2566,7 +2570,7 @@ def sync_http_get_request_contents_bin(interaction: SynchronousHttp) -> bytes: Get the request contents of a `SynchronousHttp` interaction as bytes. [Rust - `pactffi_sync_http_get_request_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_request_contents_bin) + `pactffi_sync_http_get_request_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_request_contents_bin) # Safety @@ -2593,7 +2597,7 @@ def sync_http_set_request_contents_bin( Sets the request contents of the interaction as an array of bytes. [Rust - `pactffi_sync_http_set_request_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_set_request_contents_bin) + `pactffi_sync_http_set_request_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_set_request_contents_bin) - `interaction` - the interaction to set the request contents for - `contents` - pointer to contents to copy from @@ -2620,7 +2624,7 @@ def sync_http_get_response(interaction: SynchronousHttp) -> HttpResponse: Get the response of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_response`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_response) + `pactffi_sync_http_get_response`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_response) # Safety @@ -2640,7 +2644,7 @@ def sync_http_get_response_contents(interaction: SynchronousHttp) -> str: Get the response contents of a `SynchronousHttp` interaction in string form. [Rust - `pactffi_sync_http_get_response_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_response_contents) + `pactffi_sync_http_get_response_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_response_contents) # Safety @@ -2668,7 +2672,7 @@ def sync_http_set_response_contents( Sets the response contents of the interaction. [Rust - `pactffi_sync_http_set_response_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_set_response_contents) + `pactffi_sync_http_set_response_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_set_response_contents) - `interaction` - the interaction to set the response contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -2696,7 +2700,7 @@ def sync_http_get_response_contents_length(interaction: SynchronousHttp) -> int: Get the length of the response contents of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_response_contents_length`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_response_contents_length) + `pactffi_sync_http_get_response_contents_length`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_response_contents_length) # Safety @@ -2715,7 +2719,7 @@ def sync_http_get_response_contents_bin(interaction: SynchronousHttp) -> bytes: Get the response contents of a `SynchronousHttp` interaction as bytes. [Rust - `pactffi_sync_http_get_response_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_response_contents_bin) + `pactffi_sync_http_get_response_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_response_contents_bin) # Safety @@ -2742,7 +2746,7 @@ def sync_http_set_response_contents_bin( Sets the response contents of the `SynchronousHttp` interaction as bytes. [Rust - `pactffi_sync_http_set_response_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_set_response_contents_bin) + `pactffi_sync_http_set_response_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_set_response_contents_bin) - `interaction` - the interaction to set the response contents for - `contents` - pointer to contents to copy from @@ -2769,7 +2773,7 @@ def sync_http_get_description(interaction: SynchronousHttp) -> str: Get a copy of the description. [Rust - `pactffi_sync_http_get_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_description) + `pactffi_sync_http_get_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_description) # Safety @@ -2793,7 +2797,7 @@ def sync_http_set_description(interaction: SynchronousHttp, description: str) -> Write the `description` field on the `SynchronousHttp`. [Rust - `pactffi_sync_http_set_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_set_description) + `pactffi_sync_http_set_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_set_description) # Safety @@ -2818,7 +2822,7 @@ def sync_http_get_provider_state( Get a copy of the provider state at the given index from this interaction. [Rust - `pactffi_sync_http_get_provider_state`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_provider_state) + `pactffi_sync_http_get_provider_state`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_provider_state) # Safety @@ -2844,7 +2848,7 @@ def sync_http_get_provider_state_iter( Get an iterator over provider states. [Rust - `pactffi_sync_http_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_http_get_provider_state_iter) + `pactffi_sync_http_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_http_get_provider_state_iter) # Safety @@ -2869,7 +2873,7 @@ def pact_interaction_as_synchronous_http( longer required. [Rust - `pactffi_pact_interaction_as_synchronous_http`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_interaction_as_synchronous_http) + `pactffi_pact_interaction_as_synchronous_http`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_interaction_as_synchronous_http) # Safety This function is safe as long as the interaction pointer is a valid pointer. @@ -2888,7 +2892,7 @@ def pact_interaction_as_message(interaction: PactInteraction) -> Message: must be freed with `pactffi_message_delete` when no longer required. [Rust - `pactffi_pact_interaction_as_message`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_interaction_as_message) + `pactffi_pact_interaction_as_message`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_interaction_as_message) Note that if the interaction is a V4 `AsynchronousMessage`, it will be converted to a V3 `Message` before being returned. @@ -2913,7 +2917,7 @@ def pact_interaction_as_asynchronous_message( no longer required. [Rust - `pactffi_pact_interaction_as_asynchronous_message`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_interaction_as_asynchronous_message) + `pactffi_pact_interaction_as_asynchronous_message`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_interaction_as_asynchronous_message) Note that if the interaction is a V3 `Message`, it will be converted to a V4 `AsynchronousMessage` before being returned. @@ -2938,7 +2942,7 @@ def pact_interaction_as_synchronous_message( no longer required. [Rust - `pactffi_pact_interaction_as_synchronous_message`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_interaction_as_synchronous_message) + `pactffi_pact_interaction_as_synchronous_message`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_interaction_as_synchronous_message) # Safety This function is safe as long as the interaction pointer is a valid pointer. @@ -2953,7 +2957,7 @@ def pact_message_iter_delete(iter: PactMessageIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_message_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_message_iter_delete) + `pactffi_pact_message_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_message_iter_delete) """ lib.pactffi_pact_message_iter_delete(iter._ptr) @@ -2963,7 +2967,7 @@ def pact_message_iter_next(iter: PactMessageIterator) -> Message: Get the next message from the message pact. [Rust - `pactffi_pact_message_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_message_iter_next) + `pactffi_pact_message_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_message_iter_next) """ ptr = lib.pactffi_pact_message_iter_next(iter._ptr) if ptr == ffi.NULL: @@ -2977,7 +2981,7 @@ def pact_sync_message_iter_next(iter: PactSyncMessageIterator) -> SynchronousMes Get the next synchronous request/response message from the V4 pact. [Rust - `pactffi_pact_sync_message_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_sync_message_iter_next) + `pactffi_pact_sync_message_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_sync_message_iter_next) """ ptr = lib.pactffi_pact_sync_message_iter_next(iter._ptr) if ptr == ffi.NULL: @@ -2991,7 +2995,7 @@ def pact_sync_message_iter_delete(iter: PactSyncMessageIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_sync_message_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_sync_message_iter_delete) + `pactffi_pact_sync_message_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_sync_message_iter_delete) """ lib.pactffi_pact_sync_message_iter_delete(iter._ptr) @@ -3001,7 +3005,7 @@ def pact_sync_http_iter_next(iter: PactSyncHttpIterator) -> SynchronousHttp: Get the next synchronous HTTP request/response interaction from the V4 pact. [Rust - `pactffi_pact_sync_http_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_sync_http_iter_next) + `pactffi_pact_sync_http_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_sync_http_iter_next) """ ptr = lib.pactffi_pact_sync_http_iter_next(iter._ptr) if ptr == ffi.NULL: @@ -3015,7 +3019,7 @@ def pact_sync_http_iter_delete(iter: PactSyncHttpIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_sync_http_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_sync_http_iter_delete) + `pactffi_pact_sync_http_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_sync_http_iter_delete) """ lib.pactffi_pact_sync_http_iter_delete(iter._ptr) @@ -3025,7 +3029,7 @@ def pact_interaction_iter_next(iter: PactInteractionIterator) -> PactInteraction Get the next interaction from the pact. [Rust - `pactffi_pact_interaction_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_interaction_iter_next) + `pactffi_pact_interaction_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_interaction_iter_next) """ ptr = lib.pactffi_pact_interaction_iter_next(iter._ptr) if ptr == ffi.NULL: @@ -3039,7 +3043,7 @@ def pact_interaction_iter_delete(iter: PactInteractionIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_interaction_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_interaction_iter_delete) + `pactffi_pact_interaction_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_interaction_iter_delete) """ lib.pactffi_pact_interaction_iter_delete(iter._ptr) @@ -3049,7 +3053,7 @@ def matching_rule_to_json(rule: MatchingRule) -> str: Get the JSON form of the matching rule. [Rust - `pactffi_matching_rule_to_json`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rule_to_json) + `pactffi_matching_rule_to_json`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rule_to_json) The returned string must be deleted with `pactffi_string_delete`. @@ -3066,7 +3070,7 @@ def matching_rules_iter_delete(iter: MatchingRuleCategoryIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_matching_rules_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rules_iter_delete) + `pactffi_matching_rules_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rules_iter_delete) """ raise NotImplementedError @@ -3078,7 +3082,7 @@ def matching_rules_iter_next( Get the next path and matching rule out of the iterator, if possible. [Rust - `pactffi_matching_rules_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rules_iter_next) + `pactffi_matching_rules_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rules_iter_next) The returned pointer must be deleted with `pactffi_matching_rules_iter_pair_delete`. @@ -3100,7 +3104,7 @@ def matching_rules_iter_pair_delete(pair: MatchingRuleKeyValuePair) -> None: Free a pair of key and value returned from `message_metadata_iter_next`. [Rust - `pactffi_matching_rules_iter_pair_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matching_rules_iter_pair_delete) + `pactffi_matching_rules_iter_pair_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matching_rules_iter_pair_delete) """ raise NotImplementedError @@ -3110,7 +3114,7 @@ def message_new() -> Message: Get a mutable pointer to a newly-created default message on the heap. [Rust - `pactffi_message_new`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_new) + `pactffi_message_new`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_new) # Safety @@ -3132,7 +3136,7 @@ def message_new_from_json( Constructs a `Message` from the JSON string. [Rust - `pactffi_message_new_from_json`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_new_from_json) + `pactffi_message_new_from_json`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_new_from_json) # Safety @@ -3150,7 +3154,7 @@ def message_new_from_body(body: str, content_type: str) -> Message: Constructs a `Message` from a body with a given content-type. [Rust - `pactffi_message_new_from_body`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_new_from_body) + `pactffi_message_new_from_body`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_new_from_body) # Safety @@ -3168,7 +3172,7 @@ def message_delete(message: Message) -> None: Destroy the `Message` being pointed to. [Rust - `pactffi_message_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_delete) + `pactffi_message_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_delete) """ raise NotImplementedError @@ -3178,11 +3182,14 @@ def message_get_contents(message: Message) -> OwnedString | None: Get the contents of a `Message` in string form. [Rust - `pactffi_message_get_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_get_contents) + `pactffi_message_get_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_get_contents) # Safety - The returned string must be deleted with `pactffi_string_delete`. + The returned string must be deleted with `pactffi_string_delete` and can + outlive the message. This function must only ever be called from a foreign + language. Calling it from a Rust function that has a Tokio runtime in its + call stack can result in a deadlock. The returned string can outlive the message. @@ -3201,7 +3208,7 @@ def message_set_contents(message: Message, contents: str, content_type: str) -> Sets the contents of the message. [Rust - `pactffi_message_set_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_set_contents) + `pactffi_message_set_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_set_contents) # Safety @@ -3223,7 +3230,7 @@ def message_get_contents_length(message: Message) -> int: Get the length of the contents of a `Message`. [Rust - `pactffi_message_get_contents_length`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_get_contents_length) + `pactffi_message_get_contents_length`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_get_contents_length) # Safety @@ -3242,7 +3249,7 @@ def message_get_contents_bin(message: Message) -> str: Get the contents of a `Message` as a pointer to an array of bytes. [Rust - `pactffi_message_get_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_get_contents_bin) + `pactffi_message_get_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_get_contents_bin) # Safety @@ -3269,7 +3276,7 @@ def message_set_contents_bin( Sets the contents of the message as an array of bytes. [Rust - `pactffi_message_set_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_set_contents_bin) + `pactffi_message_set_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_set_contents_bin) # Safety @@ -3290,7 +3297,7 @@ def message_get_description(message: Message) -> OwnedString: Get a copy of the description. [Rust - `pactffi_message_get_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_get_description) + `pactffi_message_get_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_get_description) # Safety @@ -3313,7 +3320,7 @@ def message_set_description(message: Message, description: str) -> int: Write the `description` field on the `Message`. [Rust - `pactffi_message_set_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_set_description) + `pactffi_message_set_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_set_description) # Safety @@ -3335,7 +3342,7 @@ def message_get_provider_state(message: Message, index: int) -> ProviderState: Get a copy of the provider state at the given index from this message. [Rust - `pactffi_message_get_provider_state`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_get_provider_state) + `pactffi_message_get_provider_state`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_get_provider_state) # Safety @@ -3358,7 +3365,7 @@ def message_get_provider_state_iter(message: Message) -> ProviderStateIterator: Get an iterator over provider states. [Rust - `pactffi_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_get_provider_state_iter) + `pactffi_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_get_provider_state_iter) # Safety @@ -3376,7 +3383,7 @@ def provider_state_iter_next(iter: ProviderStateIterator) -> ProviderState: Get the next value from the iterator. [Rust - `pactffi_provider_state_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_iter_next) + `pactffi_provider_state_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_iter_next) # Safety @@ -3397,7 +3404,7 @@ def provider_state_iter_delete(iter: ProviderStateIterator) -> None: Delete the iterator. [Rust - `pactffi_provider_state_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_iter_delete) + `pactffi_provider_state_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_iter_delete) """ raise NotImplementedError @@ -3407,7 +3414,7 @@ def message_find_metadata(message: Message, key: str) -> str: Get a copy of the metadata value indexed by `key`. [Rust - `pactffi_message_find_metadata`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_find_metadata) + `pactffi_message_find_metadata`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_find_metadata) # Safety @@ -3433,7 +3440,7 @@ def message_insert_metadata(message: Message, key: str, value: str) -> int: Insert the (`key`, `value`) pair into this Message's `metadata` HashMap. [Rust - `pactffi_message_insert_metadata`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_insert_metadata) + `pactffi_message_insert_metadata`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_insert_metadata) # Safety @@ -3453,14 +3460,16 @@ def message_metadata_iter_next(iter: MessageMetadataIterator) -> MessageMetadata Get the next key and value out of the iterator, if possible. [Rust - `pactffi_message_metadata_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_metadata_iter_next) + `pactffi_message_metadata_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_metadata_iter_next) The returned pointer must be deleted with `pactffi_message_metadata_pair_delete`. # Safety - The underlying data must not change during iteration. + The underlying data must not change during iteration. This function must + only ever be called from a foreign language. Calling it from a Rust function + that has a Tokio runtime in its call stack can result in a deadlock. # Error Handling @@ -3474,7 +3483,7 @@ def message_get_metadata_iter(message: Message) -> MessageMetadataIterator: Get an iterator over the metadata of a message. [Rust - `pactffi_message_get_metadata_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_get_metadata_iter) + `pactffi_message_get_metadata_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_get_metadata_iter) # Safety @@ -3499,7 +3508,7 @@ def message_metadata_iter_delete(iter: MessageMetadataIterator) -> None: Free the metadata iterator when you're done using it. [Rust - `pactffi_message_metadata_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_metadata_iter_delete) + `pactffi_message_metadata_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_metadata_iter_delete) """ raise NotImplementedError @@ -3509,7 +3518,7 @@ def message_metadata_pair_delete(pair: MessageMetadataPair) -> None: Free a pair of key and value returned from `message_metadata_iter_next`. [Rust - `pactffi_message_metadata_pair_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_metadata_pair_delete) + `pactffi_message_metadata_pair_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_metadata_pair_delete) """ raise NotImplementedError @@ -3521,7 +3530,7 @@ def message_pact_new_from_json(file_name: str, json_str: str) -> MessagePact: The provided file name is used when generating error messages. [Rust - `pactffi_message_pact_new_from_json`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_new_from_json) + `pactffi_message_pact_new_from_json`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_new_from_json) # Safety @@ -3540,7 +3549,7 @@ def message_pact_delete(message_pact: MessagePact) -> None: Delete the `MessagePact` being pointed to. [Rust - `pactffi_message_pact_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_delete) + `pactffi_message_pact_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_delete) """ raise NotImplementedError @@ -3553,7 +3562,7 @@ def message_pact_get_consumer(message_pact: MessagePact) -> Consumer: pointer. [Rust - `pactffi_message_pact_get_consumer`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_get_consumer) + `pactffi_message_pact_get_consumer`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_get_consumer) # Safety @@ -3575,7 +3584,7 @@ def message_pact_get_provider(message_pact: MessagePact) -> Provider: pointer. [Rust - `pactffi_message_pact_get_provider`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_get_provider) + `pactffi_message_pact_get_provider`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_get_provider) # Safety @@ -3596,7 +3605,7 @@ def message_pact_get_message_iter( Get an iterator over the messages of a message pact. [Rust - `pactffi_message_pact_get_message_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_get_message_iter) + `pactffi_message_pact_get_message_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_get_message_iter) # Safety @@ -3621,7 +3630,7 @@ def message_pact_message_iter_next(iter: MessagePactMessageIterator) -> Message: Get the next message from the message pact. [Rust - `pactffi_message_pact_message_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_message_iter_next) + `pactffi_message_pact_message_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_message_iter_next) # Safety @@ -3640,7 +3649,7 @@ def message_pact_message_iter_delete(iter: MessagePactMessageIterator) -> None: Delete the iterator. [Rust - `pactffi_message_pact_message_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_message_iter_delete) + `pactffi_message_pact_message_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_message_iter_delete) """ raise NotImplementedError @@ -3650,7 +3659,7 @@ def message_pact_find_metadata(message_pact: MessagePact, key1: str, key2: str) Get a copy of the metadata value indexed by `key1` and `key2`. [Rust - `pactffi_message_pact_find_metadata`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_find_metadata) + `pactffi_message_pact_find_metadata`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_find_metadata) # Safety @@ -3678,7 +3687,7 @@ def message_pact_get_metadata_iter( Get an iterator over the metadata of a message pact. [Rust - `pactffi_message_pact_get_metadata_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_get_metadata_iter) + `pactffi_message_pact_get_metadata_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_get_metadata_iter) # Safety @@ -3705,7 +3714,7 @@ def message_pact_metadata_iter_next( Get the next triple out of the iterator, if possible. [Rust - `pactffi_message_pact_metadata_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_metadata_iter_next) + `pactffi_message_pact_metadata_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_metadata_iter_next) # Safety @@ -3723,7 +3732,7 @@ def message_pact_metadata_iter_delete(iter: MessagePactMetadataIterator) -> None """ Free the metadata iterator when you're done using it. - [Rust `pactffi_message_pact_metadata_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_metadata_iter_delete) + [Rust `pactffi_message_pact_metadata_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_metadata_iter_delete) """ raise NotImplementedError @@ -3732,7 +3741,7 @@ def message_pact_metadata_triple_delete(triple: MessagePactMetadataTriple) -> No """ Free a triple returned from `pactffi_message_pact_metadata_iter_next`. - [Rust `pactffi_message_pact_metadata_triple_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_pact_metadata_triple_delete) + [Rust `pactffi_message_pact_metadata_triple_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_pact_metadata_triple_delete) """ raise NotImplementedError @@ -3742,7 +3751,7 @@ def provider_get_name(provider: Provider) -> str: Get a copy of this provider's name. [Rust - `pactffi_provider_get_name`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_get_name) + `pactffi_provider_get_name`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_get_name) The copy must be deleted with `pactffi_string_delete`. @@ -3788,7 +3797,7 @@ def pact_get_provider(pact: Pact) -> Provider: `pactffi_pact_provider_delete` when no longer required. [Rust - `pactffi_pact_get_provider`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_get_provider) + `pactffi_pact_get_provider`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_get_provider) # Errors @@ -3803,7 +3812,7 @@ def pact_provider_delete(provider: Provider) -> None: Frees the memory used by the Pact provider. [Rust - `pactffi_pact_provider_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_provider_delete) + `pactffi_pact_provider_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_provider_delete) """ raise NotImplementedError @@ -3815,7 +3824,7 @@ def provider_state_get_name(provider_state: ProviderState) -> str: This needs to be deleted with `pactffi_string_delete`. [Rust - `pactffi_provider_state_get_name`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_get_name) + `pactffi_provider_state_get_name`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_get_name) # Safety @@ -3835,7 +3844,7 @@ def provider_state_get_param_iter( Get an iterator over the params of a provider state. [Rust - `pactffi_provider_state_get_param_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_get_param_iter) + `pactffi_provider_state_get_param_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_get_param_iter) # Safety @@ -3862,7 +3871,7 @@ def provider_state_param_iter_next( Get the next key and value out of the iterator, if possible. [Rust - `pactffi_provider_state_param_iter_next`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_param_iter_next) + `pactffi_provider_state_param_iter_next`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_param_iter_next) Returns a pointer to a heap allocated array of 2 elements, the pointer to the key string on the heap, and the pointer to the value string on the heap. @@ -3885,7 +3894,7 @@ def provider_state_delete(provider_state: ProviderState) -> None: Free the provider state when you're done using it. [Rust - `pactffi_provider_state_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_delete) + `pactffi_provider_state_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_delete) """ raise NotImplementedError @@ -3895,7 +3904,7 @@ def provider_state_param_iter_delete(iter: ProviderStateParamIterator) -> None: Free the provider state param iterator when you're done using it. [Rust - `pactffi_provider_state_param_iter_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_param_iter_delete) + `pactffi_provider_state_param_iter_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_param_iter_delete) """ raise NotImplementedError @@ -3905,7 +3914,7 @@ def provider_state_param_pair_delete(pair: ProviderStateParamPair) -> None: Free a pair of key and value. [Rust - `pactffi_provider_state_param_pair_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_provider_state_param_pair_delete) + `pactffi_provider_state_param_pair_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_provider_state_param_pair_delete) """ raise NotImplementedError @@ -3915,7 +3924,7 @@ def sync_message_new() -> SynchronousMessage: Get a mutable pointer to a newly-created default message on the heap. [Rust - `pactffi_sync_message_new`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_new) + `pactffi_sync_message_new`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_new) # Safety @@ -3933,7 +3942,7 @@ def sync_message_delete(message: SynchronousMessage) -> None: Destroy the `Message` being pointed to. [Rust - `pactffi_sync_message_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_delete) + `pactffi_sync_message_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_delete) """ raise NotImplementedError @@ -3943,7 +3952,7 @@ def sync_message_get_request_contents_str(message: SynchronousMessage) -> str: Get the request contents of a `SynchronousMessage` in string form. [Rust - `pactffi_sync_message_get_request_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_request_contents_str) + `pactffi_sync_message_get_request_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_request_contents_str) # Safety @@ -3970,7 +3979,7 @@ def sync_message_set_request_contents_str( Sets the request contents of the message. [Rust - `pactffi_sync_message_set_request_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_set_request_contents_str) + `pactffi_sync_message_set_request_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_set_request_contents_str) - `message` - the message to set the request contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -3998,7 +4007,7 @@ def sync_message_get_request_contents_length(message: SynchronousMessage) -> int Get the length of the request contents of a `SynchronousMessage`. [Rust - `pactffi_sync_message_get_request_contents_length`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_request_contents_length) + `pactffi_sync_message_get_request_contents_length`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_request_contents_length) # Safety @@ -4017,7 +4026,7 @@ def sync_message_get_request_contents_bin(message: SynchronousMessage) -> bytes: Get the request contents of a `SynchronousMessage` as a bytes. [Rust - `pactffi_sync_message_get_request_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_request_contents_bin) + `pactffi_sync_message_get_request_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_request_contents_bin) # Safety @@ -4044,7 +4053,7 @@ def sync_message_set_request_contents_bin( Sets the request contents of the message as an array of bytes. [Rust - `pactffi_sync_message_set_request_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_set_request_contents_bin) + `pactffi_sync_message_set_request_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_set_request_contents_bin) * `message` - the message to set the request contents for * `contents` - pointer to contents to copy from @@ -4071,7 +4080,7 @@ def sync_message_get_request_contents(message: SynchronousMessage) -> MessageCon Get the request contents of an `SynchronousMessage` as a `MessageContents`. [Rust - `pactffi_sync_message_get_request_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_request_contents) + `pactffi_sync_message_get_request_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_request_contents) # Safety @@ -4091,7 +4100,7 @@ def sync_message_get_number_responses(message: SynchronousMessage) -> int: Get the number of response messages in the `SynchronousMessage`. [Rust - `pactffi_sync_message_get_number_responses`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_number_responses) + `pactffi_sync_message_get_number_responses`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_number_responses) # Safety @@ -4112,7 +4121,7 @@ def sync_message_get_response_contents_str( Get the response contents of a `SynchronousMessage` in string form. [Rust - `pactffi_sync_message_get_response_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_response_contents_str) + `pactffi_sync_message_get_response_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_response_contents_str) # Safety @@ -4145,7 +4154,7 @@ def sync_message_set_response_contents_str( with default values. [Rust - `pactffi_sync_message_set_response_contents_str`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_set_response_contents_str) + `pactffi_sync_message_set_response_contents_str`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_set_response_contents_str) * `message` - the message to set the response contents for * `index` - index of the response to set. 0 is the first response. @@ -4177,7 +4186,7 @@ def sync_message_get_response_contents_length( Get the length of the response contents of a `SynchronousMessage`. [Rust - `pactffi_sync_message_get_response_contents_length`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_response_contents_length) + `pactffi_sync_message_get_response_contents_length`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_response_contents_length) # Safety @@ -4199,7 +4208,7 @@ def sync_message_get_response_contents_bin( Get the response contents of a `SynchronousMessage` as bytes. [Rust - `pactffi_sync_message_get_response_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_response_contents_bin) + `pactffi_sync_message_get_response_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_response_contents_bin) # Safety @@ -4230,7 +4239,7 @@ def sync_message_set_response_contents_bin( responses will be padded with default values. [Rust - `pactffi_sync_message_set_response_contents_bin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_set_response_contents_bin) + `pactffi_sync_message_set_response_contents_bin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_set_response_contents_bin) * `message` - the message to set the response contents for * `index` - index of the response to set. 0 is the first response @@ -4261,7 +4270,7 @@ def sync_message_get_response_contents( Get the response contents of an `SynchronousMessage` as a `MessageContents`. [Rust - `pactffi_sync_message_get_response_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_response_contents) + `pactffi_sync_message_get_response_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_response_contents) # Safety @@ -4281,7 +4290,7 @@ def sync_message_get_description(message: SynchronousMessage) -> str: Get a copy of the description. [Rust - `pactffi_sync_message_get_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_description) + `pactffi_sync_message_get_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_description) # Safety @@ -4305,7 +4314,7 @@ def sync_message_set_description(message: SynchronousMessage, description: str) Write the `description` field on the `SynchronousMessage`. [Rust - `pactffi_sync_message_set_description`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_set_description) + `pactffi_sync_message_set_description`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_set_description) # Safety @@ -4330,7 +4339,7 @@ def sync_message_get_provider_state( Get a copy of the provider state at the given index from this message. [Rust - `pactffi_sync_message_get_provider_state`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_provider_state) + `pactffi_sync_message_get_provider_state`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_provider_state) # Safety @@ -4356,7 +4365,7 @@ def sync_message_get_provider_state_iter( Get an iterator over provider states. [Rust - `pactffi_sync_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_sync_message_get_provider_state_iter) + `pactffi_sync_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_sync_message_get_provider_state_iter) # Safety @@ -4374,7 +4383,7 @@ def string_delete(string: OwnedString) -> None: Delete a string previously returned by this FFI. [Rust - `pactffi_string_delete`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_string_delete) + `pactffi_string_delete`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_string_delete) """ lib.pactffi_string_delete(string._ptr) @@ -4389,7 +4398,7 @@ def create_mock_server(pact_str: str, addr_str: str, *, tls: bool) -> int: the mock server is returned. [Rust - `pactffi_create_mock_server`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_create_mock_server) + `pactffi_create_mock_server`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_create_mock_server) * `pact_str` - Pact JSON * `addr_str` - Address to bind to in the form name:port (i.e. 127.0.0.1:80) @@ -4425,7 +4434,7 @@ def get_tls_ca_certificate() -> OwnedString: Fetch the CA Certificate used to generate the self-signed certificate. [Rust - `pactffi_get_tls_ca_certificate`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_get_tls_ca_certificate) + `pactffi_get_tls_ca_certificate`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_get_tls_ca_certificate) **NOTE:** The string for the result is allocated on the heap, and will have to be freed by the caller using pactffi_string_delete. @@ -4446,7 +4455,7 @@ def create_mock_server_for_pact(pact: PactHandle, addr_str: str, *, tls: bool) - operating system. The port of the mock server is returned. [Rust - `pactffi_create_mock_server_for_pact`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_create_mock_server_for_pact) + `pactffi_create_mock_server_for_pact`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_create_mock_server_for_pact) * `pact` - Handle to a Pact model created with created with `pactffi_new_pact`. @@ -4489,7 +4498,7 @@ def create_mock_server_for_transport( Create a mock server for the provided Pact handle and transport. [Rust - `pactffi_create_mock_server_for_transport`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_create_mock_server_for_transport) + `pactffi_create_mock_server_for_transport`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_create_mock_server_for_transport) Args: pact: @@ -4550,7 +4559,7 @@ def mock_server_matched(mock_server_handle: PactServerHandle) -> bool: if any request has not been successfully matched, or the method panics. [Rust - `pactffi_mock_server_matched`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mock_server_matched) + `pactffi_mock_server_matched`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mock_server_matched) """ return lib.pactffi_mock_server_matched(mock_server_handle._ref) @@ -4562,7 +4571,7 @@ def mock_server_mismatches( External interface to get all the mismatches from a mock server. [Rust - `pactffi_mock_server_mismatches`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mock_server_mismatches) + `pactffi_mock_server_mismatches`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mock_server_mismatches) # Errors @@ -4588,7 +4597,7 @@ def cleanup_mock_server(mock_server_handle: PactServerHandle) -> None: and cleanup any memory allocated for it. [Rust - `pactffi_cleanup_mock_server`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_cleanup_mock_server) + `pactffi_cleanup_mock_server`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_cleanup_mock_server) Args: mock_server_handle: @@ -4616,7 +4625,7 @@ def write_pact_file( directory to write the file to is passed as the second parameter. [Rust - `pactffi_write_pact_file`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_write_pact_file) + `pactffi_write_pact_file`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_write_pact_file) Args: mock_server_handle: @@ -4667,7 +4676,7 @@ def mock_server_logs(mock_server_handle: PactServerHandle) -> str: started. [Rust - `pactffi_mock_server_logs`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_mock_server_logs) + `pactffi_mock_server_logs`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_mock_server_logs) Raises: RuntimeError: If the logs for the mock server can not be retrieved. @@ -4690,7 +4699,7 @@ def generate_datetime_string(format: str) -> StringResult: string needs to be freed with the `pactffi_string_delete` function [Rust - `pactffi_generate_datetime_string`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generate_datetime_string) + `pactffi_generate_datetime_string`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generate_datetime_string) # Safety @@ -4707,7 +4716,7 @@ def check_regex(regex: str, example: str) -> bool: Checks that the example string matches the given regex. [Rust - `pactffi_check_regex`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_check_regex) + `pactffi_check_regex`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_check_regex) # Safety @@ -4726,7 +4735,7 @@ def generate_regex_value(regex: str) -> StringResult: `pactffi_string_delete` function. [Rust - `pactffi_generate_regex_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_generate_regex_value) + `pactffi_generate_regex_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_generate_regex_value) # Safety @@ -4741,7 +4750,7 @@ def free_string(s: str) -> None: [DEPRECATED] Frees the memory allocated to a string by another function. [Rust - `pactffi_free_string`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_free_string) + `pactffi_free_string`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_free_string) This function is deprecated. Use `pactffi_string_delete` instead. @@ -4763,7 +4772,7 @@ def new_pact(consumer_name: str, provider_name: str) -> PactHandle: Creates a new Pact model and returns a handle to it. [Rust - `pactffi_new_pact`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_new_pact) + `pactffi_new_pact`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_new_pact) Args: consumer_name: @@ -4783,12 +4792,25 @@ def new_pact(consumer_name: str, provider_name: str) -> PactHandle: ) +def pact_handle_to_pointer(pact: PactHandle) -> Pact: + """ + Unwraps a Pact handle to the underlying Pact. + + The Pact model which has been cloned from the Pact handle's inner Pact + model. + + The returned Pact model must be freed with the `pactffi_pact_model_delete` + function when no longer needed. + """ + raise NotImplementedError + + def new_interaction(pact: PactHandle, description: str) -> InteractionHandle: """ Creates a new HTTP Interaction and returns a handle to it. [Rust - `pactffi_new_interaction`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_new_interaction) + `pactffi_new_interaction`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_new_interaction) Args: pact: @@ -4813,7 +4835,7 @@ def new_message_interaction(pact: PactHandle, description: str) -> InteractionHa Creates a new message interaction and return a handle to it. [Rust - `pactffi_new_message_interaction`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_new_message_interaction) + `pactffi_new_message_interaction`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_new_message_interaction) Args: pact: @@ -4842,7 +4864,7 @@ def new_sync_message_interaction( Creates a new synchronous message interaction and return a handle to it. [Rust - `pactffi_new_sync_message_interaction`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_new_sync_message_interaction) + `pactffi_new_sync_message_interaction`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_new_sync_message_interaction) Args: pact: @@ -4867,7 +4889,7 @@ def upon_receiving(interaction: InteractionHandle, description: str) -> None: Sets the description for the Interaction. [Rust - `pactffi_upon_receiving`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_upon_receiving) + `pactffi_upon_receiving`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_upon_receiving) This function @@ -4904,7 +4926,7 @@ def given(interaction: InteractionHandle, description: str) -> None: Adds a provider state to the Interaction. [Rust - `pactffi_given`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_given) + `pactffi_given`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_given) Args: interaction: @@ -4930,7 +4952,7 @@ def interaction_test_name(interaction: InteractionHandle, test_name: str) -> Non used with V4 interactions. [Rust - `pactffi_interaction_test_name`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_interaction_test_name) + `pactffi_interaction_test_name`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_interaction_test_name) Args: interaction: @@ -4990,7 +5012,7 @@ def given_with_param( be parsed as JSON. [Rust - `pactffi_given_with_param`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_given_with_param) + `pactffi_given_with_param`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_given_with_param) Args: interaction: @@ -5031,7 +5053,7 @@ def given_with_params( with a `value` key. [Rust - `pactffi_given_with_params`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_given_with_params) + `pactffi_given_with_params`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_given_with_params) Args: interaction: @@ -5081,7 +5103,7 @@ def with_request(interaction: InteractionHandle, method: str, path: str) -> None Configures the request for the Interaction. [Rust - `pactffi_with_request`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_request) + `pactffi_with_request`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_request) Args: interaction: @@ -5095,7 +5117,7 @@ def with_request(interaction: InteractionHandle, method: str, path: str) -> None This may be a simple string in which case it will be used as-is, or it may be a [JSON matching - rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md) + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md) which allows regex patterns. For examples: ```json @@ -5129,7 +5151,7 @@ def with_query_parameter_v2( Configures a query parameter for the Interaction. [Rust - `pactffi_with_query_parameter_v2`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_query_parameter_v2) + `pactffi_with_query_parameter_v2`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_query_parameter_v2) To setup a query parameter with multiple values, you can either call this function multiple times with a different index value: @@ -5166,7 +5188,23 @@ def with_query_parameter_v2( ) ``` - See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md) + + If you want the matching rules to apply to all values (and not just the one + with the given index), make sure to set the value to be an array. + + ```python + with_query_parameter_v2( + handle, + "id", + 0, + json.dumps({ + "value": ["2"], + "pact:matcher:type": "regex", + "regex": r"\d+", + }), + ) + ``` Args: interaction: @@ -5184,7 +5222,7 @@ def with_query_parameter_v2( This may be a simple string in which case it will be used as-is, or it may be a [JSON matching - rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: If there was an error setting the query parameter. @@ -5205,7 +5243,7 @@ def with_specification(pact: PactHandle, version: PactSpecification) -> None: Sets the specification version for a given Pact model. [Rust - `pactffi_with_specification`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_specification) + `pactffi_with_specification`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_specification) Args: pact: @@ -5220,6 +5258,23 @@ def with_specification(pact: PactHandle, version: PactSpecification) -> None: raise RuntimeError(msg) +def handle_get_pact_spec_version(handle: PactHandle) -> PactSpecification: + """ + Fetches the Pact specification version for the given Pact model. + + [Rust + `pactffi_handle_get_pact_spec_version`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_handle_get_pact_spec_version) + + Args: + handle: + Handle to a Pact model. + + Returns: + The spec version for the Pact model. + """ + raise NotImplementedError + + def with_pact_metadata( pact: PactHandle, namespace: str, @@ -5234,7 +5289,7 @@ def with_pact_metadata( mock server for it has already started) [Rust - `pactffi_with_pact_metadata`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_pact_metadata) + `pactffi_with_pact_metadata`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_pact_metadata) Args: pact: @@ -5270,7 +5325,7 @@ def with_header_v2( r""" Configures a header for the Interaction. - [Rust `pactffi_with_header_v2`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_header_v2) + [Rust `pactffi_with_header_v2`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_header_v2) To setup a header with multiple values, you can either call this function multiple times with a different index value: @@ -5308,7 +5363,7 @@ def with_header_v2( ) ``` - See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md) Args: interaction: @@ -5330,7 +5385,7 @@ def with_header_v2( This may be a simple string in which case it will be used as-is, or it may be a [JSON matching - rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: If there was an error setting the header. @@ -5361,7 +5416,7 @@ def set_header( and generators can not be configured with it. [Rust - `pactffi_set_header`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_set_header) + `pactffi_set_header`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_set_header) If matching rules are required to be set, use `pactffi_with_header_v2`. @@ -5398,7 +5453,7 @@ def response_status(interaction: InteractionHandle, status: int) -> None: Configures the response for the Interaction. [Rust - `pactffi_response_status`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_response_status) + `pactffi_response_status`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_response_status) Args: interaction: @@ -5416,6 +5471,54 @@ def response_status(interaction: InteractionHandle, status: int) -> None: raise RuntimeError(msg) +def response_status_v2(interaction: InteractionHandle, status: str) -> None: + """ + Configures the response for the Interaction. + + [Rust + `pactffi_response_status_v2`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_response_status_v2) + + To include matching rules for the status (only statusCode or integer really + makes sense to use), include the matching rule JSON format with the value as + a single JSON document. I.e. + + ```python + response_status_v2( + handle, + json.dumps({ + "pact:generator:type": "RandomInt", + "min": 100, + "max": 399, + "pact:matcher:type": "statusCode", + "status": "nonError", + }), + ) + ``` + + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md) + + Args: + interaction: + Handle to the Interaction. + + status: + The response status. Defaults to 200. + + This may be a simple string in which case it will be used as-is, or + it may be a [JSON matching + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md). + + Raises: + RuntimeError: If the response status could not be set. + """ + success: bool = lib.pactffi_response_status_v2( + interaction._ref, status.encode("utf-8") + ) + if not success: + msg = f"The response status {status} could not be set for {interaction}." + raise RuntimeError(msg) + + def with_body( interaction: InteractionHandle, part: InteractionPart, @@ -5426,7 +5529,7 @@ def with_body( Adds the body for the interaction. [Rust - `pactffi_with_body`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_body) + `pactffi_with_body`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_body) For HTTP and async message interactions, this will overwrite the body. With asynchronous messages, the part parameter will be ignored. With synchronous @@ -5447,7 +5550,7 @@ def with_body( body: The body contents. For JSON payloads, matching rules can be embedded - in the body. See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md). + in the body. See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: If the body could not be specified. @@ -5463,6 +5566,45 @@ def with_body( raise RuntimeError(msg) +def with_binary_body( + interaction: InteractionHandle, + part: InteractionPart, + content_type: str | None, + body: bytes | None, +) -> None: + """ + Adds the body for the interaction. + + [Rust + `pactffi_with_binary_body`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_binary_body) + + For HTTP and async message interactions, this will overwrite the body. With + asynchronous messages, the part parameter will be ignored. With synchronous + messages, the request contents will be overwritten, while a new response + will be appended to the message. + + Args: + interaction: + Handle to the Interaction. + + part: + The part of the interaction to add the body to (Request or + Response). + + content_type: + The content type of the body. Will be ignored if a content type + header is already set. If `None`, the content type will be set to + `application/octet-stream`. + + body: + The body contents. If `None`, the body will be set to null. + + Raises: + RuntimeError: If the body could not be modified. + """ + raise NotImplementedError + + def with_binary_file( interaction: InteractionHandle, part: InteractionPart, @@ -5477,7 +5619,7 @@ def with_binary_file( already started) [Rust - `pactffi_with_binary_file`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_binary_file) + `pactffi_with_binary_file`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_binary_file) For HTTP and async message interactions, this will overwrite the body. With asynchronous messages, the part parameter will be ignored. With synchronous @@ -5518,6 +5660,36 @@ def with_binary_file( raise RuntimeError(msg) +def with_matching_rules( + interaction: InteractionHandle, + part: InteractionPart, + rules: str, +) -> None: + """ + Add matching rules to the interaction. + + [Rust + `pactffi_with_matching_rules`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_matching_rules) + + This function can be called multiple times, in which case the matching + rules will be merged. + + Args: + interaction: + Handle to the Interaction. + + part: + Request or response part (if applicable). + + rules: + JSON string of the matching rules to add to the interaction. + + Raises: + RuntimeError: If the rules could not be added. + """ + raise NotImplementedError + + def with_multipart_file_v2( # noqa: PLR0913 interaction: InteractionHandle, part: InteractionPart, @@ -5534,7 +5706,7 @@ def with_multipart_file_v2( # noqa: PLR0913 already started) or an error occurs. [Rust - `pactffi_with_multipart_file_v2`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_multipart_file_v2) + `pactffi_with_multipart_file_v2`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_multipart_file_v2) This function can be called multiple times. In that case, each subsequent call will be appended to the existing multipart body as a new part. @@ -5588,7 +5760,7 @@ def with_multipart_file( already started) or an error occurs. [Rust - `pactffi_with_multipart_file`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_multipart_file) + `pactffi_with_multipart_file`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_multipart_file) * `interaction` - Interaction handle to set the body for. * `part` - Request or response part. @@ -5625,7 +5797,7 @@ def pact_handle_get_message_iter(pact: PactHandle) -> PactMessageIterator: Get an iterator over all the messages of the Pact. [Rust - `pactffi_pact_handle_get_message_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_handle_get_message_iter) + `pactffi_pact_handle_get_message_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_handle_get_message_iter) # Safety @@ -5649,7 +5821,7 @@ def pact_handle_get_sync_message_iter(pact: PactHandle) -> PactSyncMessageIterat `pactffi_pact_sync_message_iter_delete`. [Rust - `pactffi_pact_handle_get_sync_message_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_handle_get_sync_message_iter) + `pactffi_pact_handle_get_sync_message_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_handle_get_sync_message_iter) # Safety @@ -5675,7 +5847,7 @@ def pact_handle_get_sync_http_iter(pact: PactHandle) -> PactSyncHttpIterator: `pactffi_pact_sync_http_iter_delete`. [Rust - `pactffi_pact_handle_get_sync_http_iter`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_handle_get_sync_http_iter) + `pactffi_pact_handle_get_sync_http_iter`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_handle_get_sync_http_iter) # Safety @@ -5696,7 +5868,7 @@ def new_message_pact(consumer_name: str, provider_name: str) -> MessagePactHandl Creates a new Pact Message model and returns a handle to it. [Rust - `pactffi_new_message_pact`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_new_message_pact) + `pactffi_new_message_pact`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_new_message_pact) * `consumer_name` - The name of the consumer for the pact. * `provider_name` - The name of the provider for the pact. @@ -5712,7 +5884,7 @@ def new_message(pact: MessagePactHandle, description: str) -> MessageHandle: Creates a new Message and returns a handle to it. [Rust - `pactffi_new_message`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_new_message) + `pactffi_new_message`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_new_message) * `description` - The message description. It needs to be unique for each Message. @@ -5727,7 +5899,7 @@ def message_expects_to_receive(message: MessageHandle, description: str) -> None Sets the description for the Message. [Rust - `pactffi_message_expects_to_receive`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_expects_to_receive) + `pactffi_message_expects_to_receive`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_expects_to_receive) * `description` - The message description. It needs to be unique for each message. @@ -5740,7 +5912,7 @@ def message_given(message: MessageHandle, description: str) -> None: Adds a provider state to the Interaction. [Rust - `pactffi_message_given`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_given) + `pactffi_message_given`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_given) * `description` - The provider state description. It needs to be unique for each message @@ -5758,7 +5930,7 @@ def message_given_with_param( Adds a provider state to the Message with a parameter key and value. [Rust - `pactffi_message_given_with_param`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_given_with_param) + `pactffi_message_given_with_param`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_given_with_param) * `description` - The provider state description. It needs to be unique. * `name` - Parameter name. @@ -5777,7 +5949,7 @@ def message_with_contents( Adds the contents of the Message. [Rust - `pactffi_message_with_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_with_contents) + `pactffi_message_with_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_with_contents) Accepts JSON, binary and other payload types. Binary data will be base64 encoded when serialised. @@ -5804,7 +5976,7 @@ def message_with_metadata(message_handle: MessageHandle, key: str, value: str) - Adds expected metadata to the Message. [Rust - `pactffi_message_with_metadata`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_with_metadata) + `pactffi_message_with_metadata`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_with_metadata) * `key` - metadata key * `value` - metadata value. @@ -5812,16 +5984,66 @@ def message_with_metadata(message_handle: MessageHandle, key: str, value: str) - raise NotImplementedError +def message_with_metadata_v2( + message_handle: MessageHandle, + key: str, + value: str, +) -> None: + """ + Adds expected metadata to the Message. + + [Rust + `pactffi_message_with_metadata_v2`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_with_metadata_v2) + + Args: + message_handle: + Handle to the Message. + + key: + Metadata key. + + value: + Metadata value. + + This may be a simple string in which case it will be used as-is, or + it may be a [JSON matching + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md). + + To include matching rules for the metadata, include the matching rule JSON + format with the value as a single JSON document. I.e. + + ```python + message_with_metadata_v2( + handle, + "contentType", + json.dumps({ + "pact:matcher:type": "regex", + "regex": "text/.*", + }), + ) + ``` + + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md). + """ + raise NotImplementedError + + def message_reify(message_handle: MessageHandle) -> OwnedString: """ Reifies the given message. [Rust - `pactffi_message_reify`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_message_reify) + `pactffi_message_reify`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_message_reify) Reification is the process of stripping away any matchers, and returning the - original contents. NOTE: the returned string needs to be deallocated with - the `free_string` function + original contents. + + # Safety + + The returned string needs to be deallocated with the `free_string` function. + This function must only ever be called from a foreign language. Calling it + from a Rust function that has a Tokio runtime in its call stack can result + in a deadlock. """ raise NotImplementedError @@ -5840,7 +6062,7 @@ def write_message_pact_file( pointer is passed, the current working directory is used. [Rust - `pactffi_write_message_pact_file`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_write_message_pact_file) + `pactffi_write_message_pact_file`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_write_message_pact_file) 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. @@ -5874,7 +6096,7 @@ def with_message_pact_metadata( version [Rust - `pactffi_with_message_pact_metadata`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_with_message_pact_metadata) + `pactffi_with_message_pact_metadata`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_with_message_pact_metadata) * `pact` - Handle to a Pact model * `namespace` - the top level metadat key to set any key values on @@ -5894,7 +6116,7 @@ def pact_handle_write_file( External interface to write out the pact file. [Rust - `pactffi_pact_handle_write_file`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_pact_handle_write_file) + `pactffi_pact_handle_write_file`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_pact_handle_write_file) This function should be called if all the consumer tests have passed. @@ -5934,7 +6156,7 @@ def free_pact_handle(pact: PactHandle) -> None: Delete a Pact handle and free the resources used by it. [Rust - `pactffi_free_pact_handle`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_free_pact_handle) + `pactffi_free_pact_handle`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_free_pact_handle) Raises: RuntimeError: If the handle could not be freed. @@ -5954,7 +6176,7 @@ def free_message_pact_handle(pact: MessagePactHandle) -> int: Delete a Pact handle and free the resources used by it. [Rust - `pactffi_free_message_pact_handle`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_free_message_pact_handle) + `pactffi_free_message_pact_handle`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_free_message_pact_handle) # Error Handling @@ -5971,7 +6193,7 @@ def verify(args: str) -> int: """ External interface to verifier a provider. - [Rust `pactffi_verify`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verify) + [Rust `pactffi_verify`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verify) * `args` - the same as the CLI interface, except newline delimited @@ -6001,7 +6223,7 @@ def verifier_new() -> VerifierHandle: free all allocated resources. [Rust - `pactffi_verifier_new`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_new) + `pactffi_verifier_new`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_new) Deprecated: This function is deprecated. Use `pactffi_verifier_new_for_application` which allows the calling @@ -6031,7 +6253,7 @@ def verifier_new_for_application(name: str, version: str) -> VerifierHandle: free all allocated resources [Rust - `pactffi_verifier_new_for_application`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_new_for_application) + `pactffi_verifier_new_for_application`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_new_for_application) # Safety @@ -6048,7 +6270,7 @@ def verifier_shutdown(handle: VerifierHandle) -> None: """ Shutdown the verifier and release all resources. - [Rust `pactffi_verifier_shutdown`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_shutdown) + [Rust `pactffi_verifier_shutdown`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_shutdown) """ raise NotImplementedError @@ -6067,7 +6289,7 @@ def verifier_set_provider_info( # noqa: PLR0913 Passing a NULL for any field will use the default value for that field. [Rust - `pactffi_verifier_set_provider_info`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_provider_info) + `pactffi_verifier_set_provider_info`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_provider_info) # Safety @@ -6090,7 +6312,7 @@ def verifier_add_provider_transport( Passing a NULL for any field will use the default value for that field. [Rust - `pactffi_verifier_add_provider_transport`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_add_provider_transport) + `pactffi_verifier_add_provider_transport`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_add_provider_transport) For non-plugin based message interactions, set protocol to "message" and set scheme to an empty string or "https" if secure HTTP is required. @@ -6115,7 +6337,7 @@ def verifier_set_filter_info( Set the filters for the Pact verifier. [Rust - `pactffi_verifier_set_filter_info`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_filter_info) + `pactffi_verifier_set_filter_info`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_filter_info) If `filter_description` is not empty, it needs to be as a regular expression. @@ -6142,7 +6364,7 @@ def verifier_set_provider_state( Set the provider state URL for the Pact verifier. [Rust - `pactffi_verifier_set_provider_state`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_provider_state) + `pactffi_verifier_set_provider_state`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_provider_state) `teardown` is a boolean value. If teardown state change requests should be made after an interaction is validated (default is false). Set it to greater @@ -6168,7 +6390,7 @@ def verifier_set_verification_options( Set the options used by the verifier when calling the provider. [Rust - `pactffi_verifier_set_verification_options`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_verification_options) + `pactffi_verifier_set_verification_options`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_verification_options) `disable_ssl_verification` is a boolean value. Set it to greater than zero to turn the option on. @@ -6189,7 +6411,7 @@ def verifier_set_coloured_output(handle: VerifierHandle, coloured_output: int) - By default, coloured output is enabled. [Rust - `pactffi_verifier_set_coloured_output`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_coloured_output) + `pactffi_verifier_set_coloured_output`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_coloured_output) `coloured_output` is a boolean value. Set it to greater than zero to turn the option on. @@ -6208,7 +6430,7 @@ def verifier_set_no_pacts_is_error(handle: VerifierHandle, is_error: int) -> int Enables or disables if no pacts are found to verify results in an error. [Rust - `pactffi_verifier_set_no_pacts_is_error`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_no_pacts_is_error) + `pactffi_verifier_set_no_pacts_is_error`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_no_pacts_is_error) `is_error` is a boolean value. Set it to greater than zero to enable an error when no pacts are found to verify, and set it to zero to disable this. @@ -6234,7 +6456,7 @@ def verifier_set_publish_options( # noqa: PLR0913 Set the options used when publishing verification results to the Broker. [Rust - `pactffi_verifier_set_publish_options`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_publish_options) + `pactffi_verifier_set_publish_options`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_publish_options) # Args @@ -6263,7 +6485,7 @@ def verifier_set_consumer_filters( Set the consumer filters for the Pact verifier. [Rust - `pactffi_verifier_set_consumer_filters`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_set_consumer_filters) + `pactffi_verifier_set_consumer_filters`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_set_consumer_filters) # Safety @@ -6283,7 +6505,7 @@ def verifier_add_custom_header( Adds a custom header to be added to the requests made to the provider. [Rust - `pactffi_verifier_add_custom_header`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_add_custom_header) + `pactffi_verifier_add_custom_header`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_add_custom_header) # Safety @@ -6298,7 +6520,7 @@ def verifier_add_file_source(handle: VerifierHandle, file: str) -> None: Adds a Pact file as a source to verify. [Rust - `pactffi_verifier_add_file_source`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_add_file_source) + `pactffi_verifier_add_file_source`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_add_file_source) # Safety @@ -6316,7 +6538,7 @@ def verifier_add_directory_source(handle: VerifierHandle, directory: str) -> Non All pacts from the directory that match the provider name will be verified. [Rust - `pactffi_verifier_add_directory_source`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_add_directory_source) + `pactffi_verifier_add_directory_source`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_add_directory_source) # Safety @@ -6340,7 +6562,7 @@ def verifier_url_source( The Pact file will be fetched from the URL. [Rust - `pactffi_verifier_url_source`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_url_source) + `pactffi_verifier_url_source`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_url_source) If a username and password is given, then basic authentication will be used when fetching the pact file. If a token is provided, then bearer token @@ -6369,7 +6591,7 @@ def verifier_broker_source( name. [Rust - `pactffi_verifier_broker_source`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_broker_source) + `pactffi_verifier_broker_source`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_broker_source) If a username and password is given, then basic authentication will be used when fetching the pact file. If a token is provided, then bearer token @@ -6408,7 +6630,7 @@ def verifier_broker_source_with_selectors( # noqa: PLR0913 `https://docs.pact.io/pact_broker/advanced_topics/consumer_version_selectors/`). [Rust - `pactffi_verifier_broker_source_with_selectors`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_broker_source_with_selectors) + `pactffi_verifier_broker_source_with_selectors`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_broker_source_with_selectors) The consumer version selectors must be passed in in JSON format. @@ -6435,7 +6657,7 @@ def verifier_execute(handle: VerifierHandle) -> int: """ Runs the verification. - [Rust `pactffi_verifier_execute`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_execute) + [Rust `pactffi_verifier_execute`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_execute) # Error Handling @@ -6452,7 +6674,7 @@ def verifier_cli_args() -> str: string. [Rust - `pactffi_verifier_cli_args`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_cli_args) + `pactffi_verifier_cli_args`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_cli_args) The purpose is to then be able to use in other languages which wrap the FFI library, to implement the same CLI functionality automatically without @@ -6512,7 +6734,7 @@ def verifier_logs(handle: VerifierHandle) -> OwnedString: function call to avoid leaking memory. [Rust - `pactffi_verifier_logs`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_logs) + `pactffi_verifier_logs`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_logs) Will return a NULL pointer if the logs for the verification can not be retrieved. @@ -6529,7 +6751,7 @@ def verifier_logs_for_provider(provider_name: str) -> OwnedString: function call to avoid leaking memory. [Rust - `pactffi_verifier_logs_for_provider`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_logs_for_provider) + `pactffi_verifier_logs_for_provider`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_logs_for_provider) Will return a NULL pointer if the logs for the verification can not be retrieved. @@ -6545,7 +6767,7 @@ def verifier_output(handle: VerifierHandle, strip_ansi: int) -> OwnedString: call to avoid leaking memory. [Rust - `pactffi_verifier_output`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_output) + `pactffi_verifier_output`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_output) * `strip_ansi` - This parameter controls ANSI escape codes. Setting it to a non-zero value @@ -6564,7 +6786,7 @@ def verifier_json(handle: VerifierHandle) -> OwnedString: call to avoid leaking memory. [Rust - `pactffi_verifier_json`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_verifier_json) + `pactffi_verifier_json`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_verifier_json) Will return a NULL pointer if the handle is invalid. """ @@ -6586,7 +6808,7 @@ def using_plugin( otherwise you will have plugin processes left running. [Rust - `pactffi_using_plugin`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_using_plugin) + `pactffi_using_plugin`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_using_plugin) Args: pact: @@ -6625,7 +6847,7 @@ def cleanup_plugins(pact: PactHandle) -> None: zero). [Rust - `pactffi_cleanup_plugins`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_cleanup_plugins) + `pactffi_cleanup_plugins`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_cleanup_plugins) """ lib.pactffi_cleanup_plugins(pact._ref) @@ -6644,7 +6866,7 @@ def interaction_contents( format of the JSON contents. [Rust - `pactffi_interaction_contents`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_interaction_contents) + `pactffi_interaction_contents`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_interaction_contents) Args: interaction: @@ -6700,7 +6922,7 @@ def matches_string_value( function once it is no longer required. [Rust - `pactffi_matches_string_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matches_string_value) + `pactffi_matches_string_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matches_string_value) * matching_rule - pointer to a matching rule * expected_value - value we expect to get as a NULL terminated string @@ -6731,7 +6953,7 @@ def matches_u64_value( function once it is no longer required. [Rust - `pactffi_matches_u64_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matches_u64_value) + `pactffi_matches_u64_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matches_u64_value) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -6761,7 +6983,7 @@ def matches_i64_value( function once it is no longer required. [Rust - `pactffi_matches_i64_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matches_i64_value) + `pactffi_matches_i64_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matches_i64_value) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -6791,7 +7013,7 @@ def matches_f64_value( function once it is no longer required. [Rust - `pactffi_matches_f64_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matches_f64_value) + `pactffi_matches_f64_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matches_f64_value) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -6821,7 +7043,7 @@ def matches_bool_value( function once it is no longer required. [Rust - `pactffi_matches_bool_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matches_bool_value) + `pactffi_matches_bool_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matches_bool_value) * matching_rule - pointer to a matching rule * expected_value - value we expect to get, 0 == false and 1 == true @@ -6853,7 +7075,7 @@ def matches_binary_value( # noqa: PLR0913 function once it is no longer required. [Rust - `pactffi_matches_binary_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matches_binary_value) + `pactffi_matches_binary_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matches_binary_value) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -6888,7 +7110,7 @@ def matches_json_value( function once it is no longer required. [Rust - `pactffi_matches_json_value`](https://docs.rs/pact_ffi/0.4.9/pact_ffi/?search=pactffi_matches_json_value) + `pactffi_matches_json_value`](https://docs.rs/pact_ffi/0.4.15/pact_ffi/?search=pactffi_matches_json_value) * matching_rule - pointer to a matching rule * expected_value - value we expect to get as a NULL terminated string diff --git a/pact/v3/pact.py b/pact/v3/pact.py index 4958684417..0a2880500d 100644 --- a/pact/v3/pact.py +++ b/pact/v3/pact.py @@ -483,7 +483,7 @@ def with_header( # JSON Matching Pact's matching rules are defined in the [upstream - documentation](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md) + documentation](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md) and support a wide range of matching rules. These can be specified using a JSON object as a strong using `json.dumps(...)`. For example, the above rule whereby the `X-Foo` header has multiple values can be @@ -723,7 +723,7 @@ def with_query_parameter(self, name: str, value: str) -> Self: ``` For more information on the format of the JSON object, see the [upstream - documentation](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.9/rust/pact_ffi/IntegrationJson.md). + documentation](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.4.15/rust/pact_ffi/IntegrationJson.md). Args: name: