<commit_before>//! Interface to a mock server provided by a plugin

use std::{env, thread};
use std::fmt::Write;
use std::path::PathBuf;

use anyhow::anyhow;
use itertools::Itertools;
use pact_models::pact::{Pact, write_pact};
use pact_models::PactSpecification;
use pact_plugin_driver::catalogue_manager::CatalogueEntry;
use pact_plugin_driver::mock_server::{MockServerConfig, MockServerDetails};
use pact_plugin_driver::plugin_manager::{shutdown_mock_server, start_mock_server};
use tokio::runtime::Handle;
use tracing::{debug, info};
use url::Url;

use pact_matching::metrics::{MetricEvent, send_metrics, send_metrics_async};
use pact_mock_server::matching::MatchResult;
use pact_mock_server::mock_server::MockServerMetrics;

use crate::mock_server::ValidatingMockServer;
use crate::util::panic_or_print_error;

/// Mock server that has been provided by a plugin
pub struct PluginMockServer {
  /// Details of the running mock server
  pub mock_server_details: MockServerDetails,
  /// Pact that is used to configure the mock server
  pub pact: Box<dyn Pact + Send + Sync>,
  /// Path to write any pact files to
  pub output_path: Option<PathBuf>,
  /// Catalogue entry for the transport
  pub catalogue_entry: CatalogueEntry,
}
<commit_msg>chore: cleanup some compiler warnings<commit_after>//! Interface to a mock server provided by a plugin

use std::{env, thread};
use std::fmt::Write;
use std::path::PathBuf;

use anyhow::anyhow;
use itertools::Itertools;
use pact_models::pact::{Pact, write_pact};
use pact_models::PactSpecification;
use pact_plugin_driver::catalogue_manager::CatalogueEntry;
use pact_plugin_driver::mock_server::{MockServerConfig, MockServerDetails};
use pact_plugin_driver::plugin_manager::{shutdown_mock_server, start_mock_server};
use tokio::runtime::Handle;
use tracing::{debug, info};
use url::Url;

use pact_matching::metrics::{MetricEvent, send_metrics_async};
use pact_mock_server::matching::MatchResult;
use pact_mock_server::mock_server::MockServerMetrics;

use crate::mock_server::ValidatingMockServer;
use crate::util::panic_or_print_error;

/// Mock server that has been provided by a plugin
pub struct PluginMockServer {
  /// Details of the running mock server
  pub mock_server_details: MockServerDetails,
  /// Pact that is used to configure the mock server
  pub pact: Box<dyn Pact + Send + Sync>,
  /// Path to write any pact files to
  pub output_path: Option<PathBuf>,
  /// Catalogue entry for the transport
  pub catalogue_entry: CatalogueEntry,
}

{'fraction_non_alphanumeric': 0.10728582866293035, 'fraction_numerical': 0.0, 'mean_word_length': 7.009615384615385, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4889380', 'n_tokens_mistral': 767, 'n_tokens_neox': 752, 'n_words': 217}