pub trait PactPlugin:
Send
+ Sync
+ 'static {
// Required methods
fn init_plugin<'life0, 'async_trait>(
&'life0 self,
request: Request<InitPluginRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<InitPluginResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_catalogue<'life0, 'async_trait>(
&'life0 self,
request: Request<Catalogue>,
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn compare_contents<'life0, 'async_trait>(
&'life0 self,
request: Request<CompareContentsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CompareContentsResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn configure_interaction<'life0, 'async_trait>(
&'life0 self,
request: Request<ConfigureInteractionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConfigureInteractionResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn generate_content<'life0, 'async_trait>(
&'life0 self,
request: Request<GenerateContentRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<GenerateContentResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start_mock_server<'life0, 'async_trait>(
&'life0 self,
request: Request<StartMockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StartMockServerResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown_mock_server<'life0, 'async_trait>(
&'life0 self,
request: Request<ShutdownMockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ShutdownMockServerResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_mock_server_results<'life0, 'async_trait>(
&'life0 self,
request: Request<MockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MockServerResults>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn prepare_interaction_for_verification<'life0, 'async_trait>(
&'life0 self,
request: Request<VerificationPreparationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<VerificationPreparationResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn verify_interaction<'life0, 'async_trait>(
&'life0 self,
request: Request<VerifyInteractionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<VerifyInteractionResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Generated trait containing gRPC methods that should be implemented for use with PactPluginServer.
Required Methods§
Sourcefn init_plugin<'life0, 'async_trait>(
&'life0 self,
request: Request<InitPluginRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<InitPluginResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init_plugin<'life0, 'async_trait>(
&'life0 self,
request: Request<InitPluginRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<InitPluginResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check that the plugin loaded OK. Returns the catalogue entries describing what the plugin provides
Sourcefn update_catalogue<'life0, 'async_trait>(
&'life0 self,
request: Request<Catalogue>,
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_catalogue<'life0, 'async_trait>(
&'life0 self,
request: Request<Catalogue>,
) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updated catalogue. This will be sent when the core catalogue has been updated (probably by a plugin loading).
Sourcefn compare_contents<'life0, 'async_trait>(
&'life0 self,
request: Request<CompareContentsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CompareContentsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compare_contents<'life0, 'async_trait>(
&'life0 self,
request: Request<CompareContentsRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<CompareContentsResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to perform a comparison of some contents (matching request)
Sourcefn configure_interaction<'life0, 'async_trait>(
&'life0 self,
request: Request<ConfigureInteractionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConfigureInteractionResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn configure_interaction<'life0, 'async_trait>(
&'life0 self,
request: Request<ConfigureInteractionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ConfigureInteractionResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to configure/setup the interaction for later verification. Data returned will be persisted in the pact file.
Sourcefn generate_content<'life0, 'async_trait>(
&'life0 self,
request: Request<GenerateContentRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<GenerateContentResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_content<'life0, 'async_trait>(
&'life0 self,
request: Request<GenerateContentRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<GenerateContentResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Request to generate the content using any defined generators
Sourcefn start_mock_server<'life0, 'async_trait>(
&'life0 self,
request: Request<StartMockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StartMockServerResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_mock_server<'life0, 'async_trait>(
&'life0 self,
request: Request<StartMockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<StartMockServerResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start a mock server
Sourcefn shutdown_mock_server<'life0, 'async_trait>(
&'life0 self,
request: Request<ShutdownMockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ShutdownMockServerResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown_mock_server<'life0, 'async_trait>(
&'life0 self,
request: Request<ShutdownMockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<ShutdownMockServerResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Shutdown a running mock server TODO: Replace the message types with MockServerRequest and MockServerResults in the next major version
Sourcefn get_mock_server_results<'life0, 'async_trait>(
&'life0 self,
request: Request<MockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MockServerResults>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_mock_server_results<'life0, 'async_trait>(
&'life0 self,
request: Request<MockServerRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<MockServerResults>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the matching results from a running mock server
Sourcefn prepare_interaction_for_verification<'life0, 'async_trait>(
&'life0 self,
request: Request<VerificationPreparationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<VerificationPreparationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_interaction_for_verification<'life0, 'async_trait>(
&'life0 self,
request: Request<VerificationPreparationRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<VerificationPreparationResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare an interaction for verification. This should return any data required to construct any request so that it can be amended before the verification is run
Sourcefn verify_interaction<'life0, 'async_trait>(
&'life0 self,
request: Request<VerifyInteractionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<VerifyInteractionResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn verify_interaction<'life0, 'async_trait>(
&'life0 self,
request: Request<VerifyInteractionRequest>,
) -> Pin<Box<dyn Future<Output = Result<Response<VerifyInteractionResponse>, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the verification for the interaction.