Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Apply generators to message's metadata #341

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rust/pact_ffi/src/models/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,17 +534,21 @@ ffi_fn! {
/// # Safety
///
/// 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
///
/// If no further data is present, returns NULL.
fn pactffi_message_metadata_iter_next(iter: *mut MessageMetadataIterator) -> *mut MessageMetadataPair {
let iter = as_mut!(iter);
let generated_metadata;

let metadata = match iter.message {
Either::Left(message) => {
let message = as_ref!(message);
&message.metadata
generated_metadata = block_on(generate_message(message, &GeneratorTestMode::Consumer, &hashmap!{}, &vec![], &hashmap!{})).metadata;
&generated_metadata
}
Either::Right(contents) => {
let contents = as_ref!(contents);
Expand Down
Loading