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§

source

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

source

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).

source

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)

source

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.

source

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

source

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

source

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

source

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

source

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

source

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.

Implementors§